Godot: rendering and shaders¶
Renderers, shader and pipeline compilation, materials and shaders, instancing and level of detail. The engine-independent rendering rules are in Graphics and GPU rendering. Profiling and texture import are in Content and performance, and frame budgets are in Game development.
Entries are sorted by score from 1 to 10 (criteria): 9โ10 start here or strongly recommended, 6โ8 recommended, 1โ5 further reading or conditional.
Adopted references¶
The rendering and performance sections of the Godot docs are the baseline. The rules below add the choices and settings that are easy to miss.
- 7 Overview of renderers (Godot docs): the Forward+, Mobile and Compatibility renderers, how to choose and switch between them, and a feature comparison.
- 7 GPU optimization (Godot docs): draw calls and state changes, reusing shaders and materials, pixel versus vertex cost, texture reads and compression, transparency, and mobile tile-based renderers.
- 7 Optimizing 3D performance (Godot docs): culling and occlusion culling, transparent objects, level of detail, impostors, automatic and manual instancing, baked lighting and large worlds.
Key rules¶
Renderer and pipeline compilation¶
- 7
GODOT-16Choose the renderer for the platforms and oldest hardware you ship to: Forward+ for desktop games that need advanced rendering features, Mobile for mobile devices and standalone XR, and Compatibility for the web, older devices or the widest hardware support. Set therendering/renderer/rendering_method.mobileand.weboverrides when platforms need different renderers, and decide early: switching later means adjusting scenes, lighting and environments, most of all between Compatibility and the other two renderers. This appliesGFX-1. (Godot, Overview of renderers, ProjectSettings, rendering_method.mobile) - 7
GODOT-17In Forward+ and Mobile, let pipeline precompilation see everything during loading: show a simple scene that uses every rendering feature the game needs, such as MSAA, reflection probes or VoxelGI, before loading most assets, and instance effects that scripts add during play once as hidden nodes. Watch the debugger's pipeline compilation monitors for compilations outside loading screens. In Compatibility, show each material, shader and particle effect for at least one frame while loading instead. This appliesGFX-5. (Godot, Reducing stutter from shader (pipeline) compilations, Performance, pipeline compilation monitors)
Materials, instancing and level of detail¶
- 7
GODOT-18Reuse materials, and where you can't, reuse shaders: share one material across objects and give each object its own values through per-instance uniforms (instance uniform), not a unique material. Put values that many shaders read, such as wind or the player's position, in global shader uniforms set withRenderingServer.global_shader_parameter_set(), and don't read them back every frame, which makes the calling thread wait for the rendering thread. This appliesGFX-10. (Godot, GPU optimization: reuse shaders and materials, Shading language: per-instance uniforms, global uniforms) - 6
GODOT-19Draw thousands of identical objects, such as grass, flocks or particles, with a MultiMesh, and split it into several MultiMeshes by area, because Godot culls a MultiMesh only as a whole. In Forward+, opaque or alpha-tested MeshInstance3D nodes that share a mesh and material are instanced automatically. This appliesGFX-10. (Godot, Optimizing 3D performance: instancing, Optimization using MultiMeshes) - 6
GODOT-20Keep the mesh LODs that Godot generates on import, and add visibility ranges (HLOD) where a group of objects should turn into one simpler mesh or an impostor in the distance, or where distant effects should disappear. The two work together, even on the same mesh. This appliesGFX-14. (Godot, Mesh level of detail (LOD), Visibility ranges (HLOD), Optimizing 3D performance: level of detail)