Skip to content

Texture Baking

Procedural generation reduces memory usage by generating surface detail at runtime, removing the need to include large texture assets in your build. However, this increases GPU load, as shaders must be evaluated each frame.

To balance performance and memory, we have included editor tools for baking procedural spherical materials into static textures. These baked textures can then be used with provided shaders for spherical flow maps and static materials, trading increased memory footprint for improved runtime performance.

Material context menu item

Procedural texture baking is accesed through a context menu by right clicking on the material's inpector window:

Bake Texture Context Menu

You can bake and apply all textures - color, heightmap, smoothness and emission, automatically determined by the body selected. Earth-like have all 4 whereas gas giants only have color and smoothness. Or you can bake maps individually.

Selecting any option will open the 'Bake Texture from Material' wizard:

Bake Texture Wizard

If you tick the Assign Texture To Material checkbox, the static texture will be automatically applied to the material, and the material's 'Render Mode' will be changed appropriately:

Cubemap Properties

Render Mode Property

Choosing Bake and Apply All Textures also does this automatically.

Flowmaps

Stars and gas giants can utilise flow maps when in static texture rendering mode, in order to simulate the dynamic flow of the procedural shader. There are a few default flow map texture included in this asset, but you can also create your own with external tools like Photoshop or Flowmap Painter.

Flowmap Properties

Flowmap Shader Graph

When importing these textures in Unity, make sure they are not imported as sRGB textures, as that will read the flow data incorrectly:

Import Settings

Be wary of Texture Sizes

Baking large 4K cubemap face textures will actually create 4x4 = 16K sized textures:

4K Texture Preview

Be mindful when creating multiple of these as your project can quickly balloon in size.