Use when working with 3D-specific systems — materials, lighting, shadows, environment, global illumination, fog, LOD, occlusion culling, and decals in Godot 4.3+
Use when working with 3D-specific systems — materials, lighting, shadows, environment, global illumination, fog, LOD, occlusion culling, and decals in Godot 4.3+
3D Essentials in Godot 4.3+
All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, then C#.
Related skills:player-controller for CharacterBody3D movement, physics-system for 3D collision shapes and raycasting, camera-system for Camera3D follow and transitions, shader-basics for spatial shaders and post-processing, godot-optimization for 3D performance tuning, animation-system for AnimationTree and 3D animation blending.
1. 3D Coordinate System & Core Nodes
Coordinate System
Godot uses a right-handed coordinate system with metric units (1 unit = 1 meter):
Axis
Direction
Color
X
Right
Red
Y
Up
Green
Z
Out of screen (+Z toward viewer)
Blue
Cameras and lights point along -Z by default. When a character "faces forward," they look along -Z.
Essential 3D Nodes
Node
Purpose
Node3D
Base transform node — position, rotation, scale
MeshInstance3D
Displays a mesh with a material
Camera3D
Required to render 3D — perspective or orthogonal
DirectionalLight3D
Sun/moon — parallel rays, cheapest light
OmniLight3D
Point light — emits in all directions
SpotLight3D
Cone light — flashlights, spotlights
WorldEnvironment
Sky, fog, tonemap, post-processing
Decal
Projected texture onto surfaces
GPUParticles3D
GPU-driven particle effects
CSGBox3D etc.
Constructive Solid Geometry — prototyping
GridMap
3D tile-based level building
Godot 4.7+:GridMap exposes its internal octants for spatial queries — cell_octant_size = 8 (cells per octant, per axis) plus get_used_octants(), get_used_octants_by_item(item), get_octants_in_bounds(bounds) (includes empty octants), get_used_octants_in_bounds(bounds), get_used_cells_in_octant(octant_coords), get_used_cells_in_octant_by_item(octant_coords, item), and get_octant_coords_from_cell_coords(cell_coords). Octant and cell coordinates are Vector3i (returned in Array[Vector3i]); bounds is a local-space AABB.
Godot 4.7+:CSGShape3D gains automatic smoothing — enable autosmooth (default false) and tune smoothing_angle (default 50.0): faces meeting at an angle greater than smoothing_angle are smoothed, smaller angles stay sharp; a value below 0.1 disables all smoothing (a performance escape hatch). Children of a CSGCombiner3D are treated as a single mesh.
Create a StandardMaterial3D at runtime, assign to mesh.material_override, and drive emissive flashes via Tween. Use .duplicate() to make per-instance copies so changing one mesh's material doesn't affect others.
See references/materials-and-lighting-recipes.md for the full GDScript and C# recipes (basic material setup, emissive flash, per-instance duplicate, dynamic OmniLight3D explosion).
3. Lighting
Light Types Comparison
Light
Shape
Shadows
Cost
Max Visible
DirectionalLight3D
Parallel rays
PSSM
Cheapest
8 (Forward+)
OmniLight3D
Sphere
Cube/Dual Paraboloid
Medium
512 clustered*
SpotLight3D
Cone
Single texture
Cheap
512 clustered*
AreaLight3D (4.7+)
Rectangle
PCSS soft
Most expensive
—
*Forward+ shares 512 clustered element slots among omni lights, spot lights, decals, and reflection probes.
AreaLight3D emits light from a rectangle along the node's -Z — neon tubes, screens, softbox panels — with PCSS soft shadows driven by light_size. Key properties: area_size = Vector2(1, 1) (meters), area_range = 5.0, area_attenuation = 1.0 (2.0 = physically accurate inverse square), area_normalize_energy = true (resizing keeps total output stable), optional area_texture for textured emission (Forward+/Mobile only). Mobile support is limited and Compatibility cannot cast area-light shadows; in Forward+, a single visible area light adds clustered-lighting cost to all rendered objects — reserve for cinematics or high-end targets.
Prefer shadow_normal_bias over shadow_bias against acne; keep directional_shadow_max_distance at the minimum needed (50–100 m typical). Bake modes: Disabled (fully real-time, default), Static (fully baked, no runtime cost), Dynamic (indirect baked, direct real-time).
Configure global rendering — sky background, tonemapping, glow, SSR, SSAO/SSIL/SDFGI, depth-of-field — through a WorldEnvironment node holding an Environment resource. Pick a tonemap (Linear, Reinhard, Filmic, ACES, or AgX) on the Environment resource. Forward+ enables SSAO, SSIL, SSR, and SDFGI; mobile/compatibility renderers omit these.
See references/environment-and-post.md for the full setup recipes (sky options, tonemap modes, all post-processing effects, the 4.6+ glow-before-tonemapping pipeline change, AgX tonemap_white / tonemap_contrast controls, and the 4.6+ SSR quality upgrade).
Godot 4.7+:display/window/hdr/request_hdr_output (default false, promoted to a basic project setting) requests HDR display output for the main window and editor where supported, auto-switching between HDR and SDR as screens or system settings change; it forces Viewport.use_hdr_2d on for the main viewport (other SubViewports must enable it themselves). Read only at startup — toggle Window.hdr_output_requested at runtime.
⚠️ Changed in Godot 4.7: The rendering/reflections/sky_reflections/roughness_layers default changed from 7 to 8, altering sky-reflection roughness mip distribution for projects that left it at the default. Set it back to 7 to keep the 4.6 output. See the 4.7 migration guide.
5. Global Illumination
Five GI options trade quality for cost: none (ambient only) → ReflectionProbe (localized) → LightmapGI (best quality, baked) → VoxelGI (small/medium dynamic) → SDFGI (large open-world). VoxelGI/SDFGI/LightmapGI require Forward+. The 4.5+ subsections below (Specular Occlusion, Bent Normal Maps) stay inline because they apply across GI methods.
See references/global-illumination.md for the methods comparison table, ReflectionProbe scene + code recipe, LightmapGI bake workflow, and SDFGI configuration.
Specular Occlusion from Ambient Light (Godot 4.5+)
Godot 4.5+ automatically computes specular occlusion from the ambient light probe when LightmapGI, VoxelGI, or SDFGI is active. Prevents unrealistically bright speculars in areas that receive little indirect light (under eaves, inside crevices, in corners). No API change — re-bake after upgrading to see the improvement on metallic / low-roughness surfaces. ReflectionProbe alone does not provide specular occlusion.
Bent Normal Maps (Godot 4.5+)
Bent normal maps encode the mean unoccluded direction from each texel — the average direction toward open sky across the hemisphere. When assigned to the Bent Normal slot on StandardMaterial3D, Godot uses this information to improve indirect lighting directionality and specular occlusion accuracy. The result is more realistic ambient lighting on complex surfaces like cloth, carved stone, or organic shapes.
Inspector setup: In StandardMaterial3D, enable Bent Normal → assign your tangent-space bent normal texture (baked from Marmoset, Substance, or xNormal).
Most visible on: materials that combine low roughness or high metallic values with baked GI (LightmapGI / VoxelGI / SDFGI). On fully rough dielectric surfaces the benefit is subtler. Use on hero assets; skip on background geometry.
Three layers: depth/height fog set on WorldEnvironment.environment (cheap, all renderers), volumetric fog (Forward+ only — godrays through depth), and FogVolume nodes for localized fog effects (interior rooms, pits, atmospheric volumes).
See references/fog-recipes.md for the full GDScript and C# recipes — depth/height fog setup, volumetric fog parameters and performance notes, and FogVolume placement.
⚠️ Changed in Godot 4.7: Volumetric fog is now blended using transmittance instead of opacity, so existing volumetric fog can look different after upgrading. Enable the project setting rendering/environment/fog/use_legacy_blending (default false) to restore the previous behavior. See GH-119414.
7. Decals
Decal nodes project a texture onto whatever surfaces fall within their bounding box — bullet holes, blood splatter, ground details, signage. All renderers support decals; performance scales with overdraw and decal count.
See references/decals.md for the scene setup, runtime spawning recipe (GDScript + C#), and the per-renderer decal limits.
8. Optimization — LOD, Culling, MultiMesh
Four tools: automatic mesh LOD (set on import or per MeshInstance3D), manual VisibilityRange for staged swaps, occlusion culling via OccluderInstance3D, and MultiMeshInstance3D for thousands of identical meshes in one draw call.
SSAO / SSIL / SSR / Volumetric Fog / SDFGI / VoxelGI
Yes
No
No
LightmapGI / Glow / Bloom
Yes
Yes
Yes
Max Omni+Spot per mesh
512 clustered
8+8
8+8 (adjustable)
Target
Desktop/Console
Mobile/Mid-range
Low-end/WebGL
Choose in Project Settings → Rendering → Renderer → Rendering Method. Rule of thumb: Forward+ for desktop, Mobile for mobile, Compatibility only for web or very low-end hardware.
Godot 4.7+: Vulkan raytracing (RenderingDevice BLAS/TLAS and raytracing pipelines) shipped experimental in 4.7 and is not yet recommended for production.
10. Common Pitfalls
Quick symptom → cause → fix table covering black scenes, dark objects without ambient light, shadow acne and peter-panning, popping shadows, flat materials, invisible decals, transparency sorting artifacts, SDFGI light leaking, missing volumetric fog, and invisible MultiMesh instances.