How to Optimize Materials for Real-Time Rendering

Last reviewed

Optimise materials by choosing the lowest resolution that holds the detail at the camera distance, sharing one material across many objects, and removing maps that do not change what the viewer sees. Keep the texture size at power-of-two dimensions, let the engine generate mipmaps, and pack data maps into fewer channels when the engine supports it.

Choose the resolution by distance

A 2048 pixel map is only useful if the surface fills the screen. For a prop seen from a few metres, 512 or 1024 often gives the same visible detail. Test at the largest on-screen size, not at full zoom in the editor.

Remove maps that do not change the result

A height map used only for parallax costs memory and a shader pass. If the surface is far from the camera or the normal map carries the relief, leave it out. Metallic maps for a material that is entirely dielectric can be a single value.

Pack data maps where the engine allows

Roughness, metallic and ambient occlusion are single-channel data. Many engines let you store them in the red, green and blue channels of one texture, which cuts the number of samples. The packing layout is engine specific, so follow its documentation.

Share materials and check mipmaps

Each unique material is a draw-state change. Use one material for a family of props, and vary the colour with a tint or a small atlas. Keep mipmaps on for every texture that is seen at different distances, since aliasing from missing mipmaps is more visible than a slightly larger file.

  • Use power-of-two sizes such as 512, 1024 and 2048 so the engine can compress and mip them cleanly.
  • Measure the frame cost in the engine before and after a change. Estimates are often wrong.