# TexelAtlas Godot 4 3D Look-Dev Playbook

> Compact, zero-truncation agent guide for building game-quality 3D scenes in **Godot 4** (Godot 4.4–4.7 Forward+ / Mobile; verified against `4.7 (checked against 4.7.2-stable; since-tags 4.0+)`).
> Read this BEFORE writing scene code. Every technique `slug` resolves to `https://texelatlas.vercel.app/t/<slug>.md` with verified equations, parameters, and failure modes.

## 1. Recommended Godot 4 Pipeline Architecture

- 1. Forward+ renderer with `WorldEnvironment`: sky/HDRI `Environment` + `TonemapMode = AGX` + `sdfgi_enabled` or `VoxelGI` + `ssao_enabled` (with `ssao_light_affect`).
- 2. `DirectionalLight3D` with `PSSM 4 Splits` (`directional_shadow_blend_splits = true`) for exteriors, or tight shadow distances for interiors/turntables.
- 3. `StandardMaterial3D`: enable `clearcoat`, `anisotropy`, `subsurface_scattering`, `heightmap_deep_parallax` (POM) for close-up relief, and `ALPHA_HASH` / `ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE` for alpha cutouts.
- 4. Optional `VolumetricFog` / height `Fog` + selective `Glow` (`hdr_threshold = 1.0`, `blend_mode = Softlight/Additive`) + `taa` or `msaa_3d = 4x`.

## 2. Scene Archetype Recipes (Pick 1 Technique Per Stage)

### Outdoor Architecture (`outdoor-architecture`)
Daylight or dusk exteriors, streets, plazas, buildings, and walkable outdoor spaces with crisp near-to-far shadows and atmospheric depth.
- **sky/ibl**: `rayleigh-mie-single-scattering` (builtin) + `split-sum-ibl` (builtin) · **shadows**: `cascaded-shadow-maps` (builtin) + `percentage-closer-soft-shadows` (builtin) · **ao/gi**: `n8ao` + `ground-truth-ambient-occlusion` · **materials/micro**: `clearcoat-layer` (builtin) + `parallax-occlusion-mapping` (builtin) · **water/volumes**: `exponential-height-fog` (builtin) + `planar-reflections-oblique-clipping` · **post/aa**: `agx-tonemapping` (builtin) + `dual-filter-bloom` (builtin)

### Interiors, Characters & Product Look-Dev (`interior-product`)
Rooms, galleries, character portraits, and automotive/product turntables with accurate area lights, local reflections, and layered PBR materials.
- **sky/ibl**: `split-sum-ibl` (builtin) + `ltc-area-lights` (builtin) · **shadows**: `percentage-closer-soft-shadows` (builtin) + `contact-shadows` · **ao/gi**: `lightmap-baking` (builtin) + `ground-truth-ambient-occlusion` · **materials/micro**: `disney-principled-brdf` (builtin) + `clearcoat-layer` (builtin) · **water/volumes**: `screen-space-reflections` (builtin) · **post/aa**: `agx-tonemapping` (builtin) + `smaa` (builtin)

### Sci-Fi, Cyberpunk, Space & Night Scenes (`scifi-night-neon`)
Dark moody interiors, rain-slicked neon streets, cockpits, and space environments with area lights, wet reflections, volumetric beams, and controlled HDR bloom.
- **sky/ibl**: `split-sum-ibl` (builtin) + `ltc-area-lights` (builtin) · **shadows**: `percentage-closer-soft-shadows` (builtin) + `contact-shadows` · **ao/gi**: `screen-space-gi` (builtin) + `ground-truth-ambient-occlusion` · **materials/micro**: `anisotropic-ggx` (builtin) + `clearcoat-layer` (builtin) · **water/volumes**: `screen-space-reflections` (builtin) + `froxel-volumetric-fog` (builtin) · **post/aa**: `agx-tonemapping` (builtin) + `dual-filter-bloom` (builtin)

### Stylized, Painterly & NPR Worlds (`stylized-npr`)
Cohesive cel-shaded, anime, watercolor, ink-contour, or dithered 3D worlds with clean silhouette discipline and anti-aliased shading bands.
- **sky/ibl**: `environment-mapping-cubemaps` (builtin) + `hosek-wilkie-sky` · **shadows**: `cascaded-shadow-maps` (builtin) + `percentage-closer-filtering` (builtin) · **ao/gi**: `n8ao` + `hbao` · **materials/micro**: `toon-shading` (builtin) + `inverted-hull-outline` (builtin) · **water/volumes**: `exponential-height-fog` (builtin) · **post/aa**: `agx-tonemapping` (builtin) + `smaa` (builtin)

### Oceans, Lakes & Coastal Environments (`water-coastal`)
Open seas, rivers, pools, and shorelines combining physical Fresnel, oblique planar reflections or FFT/Gerstner waves, and caustics.
- **sky/ibl**: `split-sum-ibl` (builtin) + `hillaire-sky-atmosphere` · **shadows**: `cascaded-shadow-maps` (builtin) + `percentage-closer-filtering` (builtin) · **ao/gi**: `ground-truth-ambient-occlusion` + `n8ao` · **materials/micro**: `fresnel-schlick-approximation` (builtin) + `weathering-simulation` · **water/volumes**: `exponential-height-fog` (builtin) + `planar-reflections-oblique-clipping` · **post/aa**: `agx-tonemapping` (builtin) + `dual-filter-bloom` (builtin)

### Large Terrain, Forests & Open Landscapes (`terrain-foliage`)
Wide natural vistas with anti-aliased grass and foliage, distance LOD, non-repeating rock/ground textures, clouds, and aerial perspective.
- **sky/ibl**: `split-sum-ibl` (builtin) + `hillaire-sky-atmosphere` · **shadows**: `cascaded-shadow-maps` (builtin) + `contact-shadows` · **ao/gi**: `ground-truth-ambient-occlusion` + `multi-bounce-ambient-occlusion` · **materials/micro**: `triplanar-mapping` (builtin) + `hashed-alpha-testing` (builtin) · **water/volumes**: `exponential-height-fog` (builtin) + `nubis-volumetric-clouds` · **post/aa**: `agx-tonemapping` (builtin) + `smaa` (builtin)

## 3. Prototype Shortcuts to Avoid (Upgrade Table)

| Common Agent Shortcut | Visual Symptom | TexelAtlas Upgrade |
|---|---|---|
| Single DirectionalLight shadow frustum stretched across a large (>20m) scene | Blurry, blocky shadows up close and objects looking detached from the ground | `cascaded-shadow-maps`, `percentage-closer-soft-shadows` — Use Cascaded Shadow Maps (`CSM` in Three.js or built-in CSM in Godot/Unity/Unreal) for large worlds, or tightly fitted `PCSS` + `contact-shadows` for compact scenes, with tuned `normalBias`. |
| Uniform roughness/metalness PBR materials with default flat normal maps | Flat, plastic-looking surfaces where painted metal, glass, cloth, skin, wood, and stone read identically | `clearcoat-layer`, `parallax-occlusion-mapping`, `toksvig-mipmapping` — Separate materials physically (`MeshPhysicalMaterial` / OpenPBR `clearcoat`, `sheen`, `anisotropy`, `iridescence`, or subsurface scattering), author varied roughness/AO maps, use POM/detail normals on close-up surfaces, and add `toksvig-mipmapping` to curb specular shimmer. |
| Skipping ambient occlusion or applying heavy monochrome SSAO | Props, characters, and geometry look pasted onto floors, or bright surfaces turn muddy gray in crevices | `n8ao`, `ground-truth-ambient-occlusion`, `multi-bounce-ambient-occlusion` — Enable `N8AO` or `GTAO` (half-res depth-aware denoise) and pair with multi-bounce albedo tinting so bright crevices stay clean and natural. |
| Repeating UV textures on large floors, walls, roads, or terrain | Obvious grid/checkerboard repetition across wide surfaces | `hex-tiling`, `triplanar-mapping`, `weathering-simulation` — Break periodicity with `hex-tiling` or `triplanar-mapping` (for steep slopes/cliffs) and layer low-frequency world-space roughness/color variation. |
| Hard alphaTest cutouts or unsorted alpha-blended cards (foliage, hair, fences, decals) | Sparkling distant edges, popping silhouettes, or broken transparency sorting | `hashed-alpha-testing`, `octahedral-impostors` — Use `alphaToCoverage` + hashed alpha testing (`hashed-alpha-testing`) with MSAA for order-independent anti-aliased cutouts. |
| Flat ambient fill + uncalibrated exposure / linear sRGB clipping (no IBL) | Washed-out shadows, flat ungrounded reflections, and neon/sun highlights clipping to harsh yellow or white | `split-sum-ibl`, `agx-tonemapping`, `exponential-height-fog` — Bake your environment (HDRI, studio rig, or procedural sky) into a prefiltered IBL cubemap (`PMREM`), add subtle atmospheric depth where appropriate, and finish with `AgX` or `Khronos PBR Neutral` + selective HDR bloom (`threshold >= 0.9`). |
| Hand-rolled `sin(x)*cos(y)` surface ripples or mirror blends without Fresnel/oblique clip | Artificial repeating stripes on liquids or broken reflection clipping on glossy/mirror planes | `planar-reflections-oblique-clipping`, `screen-space-reflections`, `fresnel-schlick-approximation` — Use physical Schlick Fresnel (`F0`), Lengyel oblique near-plane clipping for flat mirrors/water, `screen-space-reflections` for wet streets/glossy floors, and multi-directional or FFT/Gerstner waves for open water. |

## 4. Godot 4 Pitfalls & Pass Ordering

- Enable `directional_shadow_blend_splits = true` to avoid visible cascade seam lines across large scenes.
- When using `heightmap_deep_parallax`, keep `min_layers >= 8, max_layers >= 24` and pair with normal maps so grazing angles stay crisp.

## 5. Top Verified Godot 4 Built-In & Official Switches (99 total; fetch `https://texelatlas.vercel.app/t/<slug>.md`)

### Sky, IBL & GI
- **Reflection probes with parallax-corrected cubemaps** (`reflection-probes-parallax-corrected-cubemaps`) [builtin · 0.0607ms T4] — `ReflectionProbe.box_projection = true`
- **Split-Sum Image-Based Lighting** (`split-sum-ibl`) [builtin · 0.0613ms T4] — `Environment.background_mode = Sky; Sky.radiance_size`
- **Environment mapping, cubemaps and skyboxes** (`environment-mapping-cubemaps`) [builtin · 0.1615ms T4] — `WorldEnvironment > Environment.background_mode = BG_SKY with a Sky (PanoramaSkyMaterial for HDR`
- **Linearly Transformed Cosines for Area Lights** (`ltc-area-lights`) [builtin · 0.2775ms T4] — `Add an AreaLight3D node`
- **Lightmap Baking** (`lightmap-baking`) [builtin · 0.8339ms T4] — `Add a LightmapGI node and bake (LightmapGI.bake())`
- **Screen-Space Global Illumination** (`screen-space-gi`) [builtin · 8.0356ms T4] — `Environment.ssil_enabled = true`

### Shadows & Ambient Occlusion
- **Hashed alpha testing / alpha-to-coverage for foliage** (`hashed-alpha-testing`) [builtin · 0.0744ms T4] — `BaseMaterial3D.transparency = TRANSPARENCY_ALPHA_HASH; alpha_antialiasing_mode = ALPHA_ANTIALIA`
- **Percentage-Closer Filtering** (`percentage-closer-filtering`) [builtin · 0.6316ms T4] — `Project Settings > Rendering > Lights And Shadows > Positional Shadow > Soft Shadow Filter Qual`
- **Percentage-Closer Soft Shadows** (`percentage-closer-soft-shadows`) [builtin · 1.6496ms T4] — `Light3D.light_size (omni/spot) or Light3D.light_angular_distance (directional)`
- **Cascaded Shadow Maps** (`cascaded-shadow-maps`) [builtin · 2.1515ms T4] — `DirectionalLight3D.directional_shadow_mode = DirectionalLight3D.SHADOW_PARALLEL_4_SPLITS`
- **Shadow map depth bias (constant, slope-scale, normal offset)** (`shadow-map-bias-slope-scale-normal-offset`) [builtin · 0.0325ms T4] — `Light3D.shadow_bias and Light3D.shadow_normal_bias`
- **Shadow Mapping** (`shadow-mapping`) [builtin · 0.0984ms T4] — `Light3D.shadow_enabled = true`

### Materials, BRDF & Micro-Detail
- **Triplanar mapping** (`triplanar-mapping`) [builtin · 0.0423ms T4] — `BaseMaterial3D.uv1_triplanar = true`
- **Schlick Fresnel approximation** (`fresnel-schlick-approximation`) [builtin · 0.0514ms T4] — `BaseMaterial3D.specular_mode = SPECULAR_SCHLICK_GGX (default)`
- **Anisotropic GGX** (`anisotropic-ggx`) [builtin · 0.0614ms T4] — `BaseMaterial3D.anisotropy_enabled = true`
- **Disney principled BRDF** (`disney-principled-brdf`) [builtin · 0.0703ms T4] — `BaseMaterial3D supports Burley diffuse (DIFFUSE_BURLEY) with Schlick-GGX specular, metallic, ro`
- **Separable subsurface scattering** (`separable-sss`) [builtin · 0.0719ms T4] — `BaseMaterial3D.subsurf_scatter_enabled = true`
- **Clearcoat layer** (`clearcoat-layer`) [builtin · 0.0727ms T4] — `BaseMaterial3D.clearcoat_enabled = true`

### Water, Fog & Volumes
- **Exponential Height Fog** (`exponential-height-fog`) [builtin · 0.0776ms T4] — `Environment.fog_enabled = true; Environment.fog_height / fog_height_density`
- **Ray-marched Rayleigh/Mie Single Scattering** (`rayleigh-mie-single-scattering`) [builtin · 1.3947ms T4] — `Sky.sky_material = PhysicalSkyMaterial (rayleigh_coefficient, mie_coefficient)`
- **Froxel Volumetric Fog** (`froxel-volumetric-fog`) [builtin · 11.0497ms T4] — `Environment.volumetric_fog_enabled = true (plus FogVolume nodes)`
- **Henyey-Greenstein Phase Function** (`henyey-greenstein-phase-function`) [builtin · 0.1049ms T4] — `Environment.volumetric_fog_anisotropy drives henyey_greenstein(cos_theta, g) in volumetric_fog_`
- **Ray-marched Participating Media** (`volume-ray-marching`) [builtin · 12.8474ms T4] — `Environment.volumetric_fog_enabled = true with FogVolume and FogMaterial (density, density_text`

### Post-Processing, Tonemapping & AA
- **AgX** (`agx-tonemapping`) [builtin · 0.0387ms T4] — `Environment.tonemap_mode = Environment.TONE_MAPPER_AGX`
- **Temporal Anti-Aliasing** (`temporal-anti-aliasing`) [builtin · 0.1956ms T4] — `Viewport.use_taa = true`
- **SMAA** (`smaa`) [builtin · 0.2174ms T4] — `Viewport.screen_space_aa = Viewport.SCREEN_SPACE_AA_SMAA`
- **Screen-space reflections** (`screen-space-reflections`) [builtin · 0.5894ms T4] — `Environment.ssr_enabled = true`
- **Dual-filter and progressive-downsample bloom** (`dual-filter-bloom`) [builtin · 3.5692ms T4] — `WorldEnvironment > Environment.glow_enabled (multi-level mip pyramid bloom)`
- **Linear-space rendering and gamma correction** (`linear-color-workflow`) [builtin · 0.0291ms T4] — `Forward+ and Mobile renderers shade in linear HDR; sRGB textures decode automatically`

### Stylized, Foliage & Performance
- **Inverted-hull outlines** (`inverted-hull-outline`) [builtin · 0.0752ms T4] — `BaseMaterial3D.grow = true on a next_pass material with cull_mode = CULL_FRONT`
- **Reverse-Z and floating-point depth buffers** (`reverse-z-depth-buffer`) [builtin · 0.0943ms T4] — `Always on in the RenderingDevice renderers (Forward+, Mobile)`
- **Toon / cel shading with lighting ramps** (`toon-shading`) [builtin · 0.2921ms T4] — `BaseMaterial3D.diffuse_mode = DIFFUSE_TOON; specular_mode = SPECULAR_TOON`
- **SDF and multi-channel SDF text rendering** (`msdf-sdf-text-rendering`) [builtin · 0.0517ms T4] — `FontFile.multichannel_signed_distance_field = true (Label3D/Label/RichTextLabel)`
- **Basis Universal / KTX2 supercompression** (`basis-universal-ktx2`) [builtin · 0.1162ms T4] — `Import dock > Compress > Mode = Basis Universal (stores KTX2/UASTC/ETC1S)`
- **glTF 2.0 asset format** (`gltf-2-0`) [builtin · 0.1393ms T4] — `Import .gltf/.glb as a scene; GLTFDocument for runtime load and export`

## 6. Quantitative Look-Dev Gates & Mandatory Phase-2 Polish Pass

- **Roughness Contrast Gate:** Span `<= 0.06` (wet puddles, clearcoat, glass, polished metal) to `>= 0.88` (matte asphalt, plaster, fabric, dry bark) using paired PBR maps — never let a scene collapse into uniform `0.4–0.6` plastic.
- **Lighting & HDR Discipline:** Establish a clear warm-vs-cool focal hierarchy backed by prefiltered IBL + area lights; drive emissives at HDR `1.5–4.5` with bloom `threshold >= 0.92` so glow kisses sources without milky wash.
- **Silhouette & Framing Rule:** Never leave bare box primitives or unframed glowing rectangles; frame walls, eaves, signs, and openings with trim, bevels, conduits/cables, and grounded street/floor props, and verify curved UV orientation (`LatheGeometry` labels).
- **Mandatory Phase-2 Polish Pass:** After building v1, capture screenshots across Hero, Close-Up, and Grazing views, score all 8 checkpoints at https://texelatlas.vercel.app/guides/scene-audit.md (matching defects against https://texelatlas.vercel.app/api/v1/symptoms.json or MCP `texel_diagnose`), and execute a dedicated upgrade pass fixing your **3 weakest visual areas** before finishing.
