$npx -y skills add thedivergentai/GD-Agentic-Skills --skill godot-3d-materialsExpert patterns for Godot 3D PBR materials using StandardMaterial3D including albedo, metallic/roughness workflows, normal maps, ORM texture packing, transparency modes, and shader conversion. Use when creating realistic 3D surfaces, PBR workflows, or material optimization. Trigg
| 1 | # 3D Materials |
| 2 | |
| 3 | Expert guidance for PBR materials and StandardMaterial3D in Godot. |
| 4 | |
| 5 | ## NEVER Do |
| 6 | |
| 7 | - **NEVER use separate metallic/roughness/AO textures** — Use ORM packing (1 RGB texture with Occlusion/Roughness/Metallic channels) to save texture slots and memory. |
| 8 | - **NEVER forget to enable normal_enabled** — Normal maps don't work unless you set `normal_enabled = true`. Silent failure is common. |
| 9 | - **NEVER use TRANSPARENCY_ALPHA for cutout materials** — Use TRANSPARENCY_ALPHA_SCISSOR or TRANSPARENCY_ALPHA_HASH instead. Full alpha blending is expensive and causes sorting issues. |
| 10 | - **NEVER set metallic = 0.5** — Materials are either metallic (1.0) or dielectric (0.0). Values between are physically incorrect except for rust/dirt transitions. |
| 11 | - **NEVER use emission without HDR** — Emission values > 1.0 only work with HDR rendering enabled in Project Settings. |
| 12 | - **NEVER use transparent materials for large environmental surfaces** — Transparent objects cannot rely on the Z-buffer for early fragment rejection, resulting in massive overdraw. If only a tiny part of a mesh is transparent, split the mesh into two surfaces: one opaque, one transparent. |
| 13 | - **NEVER create hundreds of slightly varied StandardMaterial3D resources if performance is dropping** — Godot minimizes GPU state changes by automatically reusing the underlying shader for materials that share the exact same configuration flags (checkboxes). Try to group your material configurations. |
| 14 | - **NEVER attempt to fix Z-fighting strictly by moving objects further apart** — Floating-point precision degrades over distance. To fix flickering textures, increase your Camera3D's `Near` plane property and decrease the `Far` property to compress the precision range. |
| 15 | - **NEVER use unique Material resources per MeshInstance3D** — This breaks draw call batching. Use 'Instance Uniforms' to vary parameters while keeping a single shared material. |
| 16 | - **NEVER use Decals on dynamic moving actors without a Cull Mask** — Bullet holes should not stick to the player's face as they walk over them. Mask out character layers. |
| 17 | |
| 18 | --- |
| 19 | |
| 20 | ## Godot 4.7: Materials |
| 21 | |
| 22 | - **AreaLight3D** pairs with emissive materials for physically correct rectangular emitters. |
| 23 | - `Texture2D.get_format()` unified on base class for portable compressed textures. |
| 24 | |
| 25 | ## Available Scripts |
| 26 | |
| 27 | > **MANDATORY**: Read the appropriate script before implementing the corresponding pattern. |
| 28 | |
| 29 | ### [material_fx.gd](scripts/material_fx.gd) |
| 30 | Runtime material property animation for damage effects, dissolve, and texture swapping. Use for dynamic material state changes. |
| 31 | |
| 32 | ### [pbr_material_builder.gd](scripts/pbr_material_builder.gd) |
| 33 | Runtime PBR material creation with ORM textures and triplanar mapping. |
| 34 | |
| 35 | ### [organic_material.gd](scripts/organic_material.gd) |
| 36 | Subsurface scattering and rim lighting setup for organic surfaces (skin, leaves). Use for realistic character or vegetation materials. |
| 37 | |
| 38 | ### [triplanar_world.gdshader](scripts/triplanar_world.gdshader) |
| 39 | Triplanar projection shader for terrain without UV mapping. Blends textures based on surface normals. Use for cliffs, caves, or procedural terrain. |
| 40 | |
| 41 | ### [pbr_orm_packer.gd](scripts/pbr_orm_packer.gd) |
| 42 | Expert PBR resource utility. Packs Ambient Occlusion, Roughness, and Metallic into a single ORM texture to optimize VRAM and draw calls. |
| 43 | |
| 44 | ### [vertex_wind_sway.gdshader](scripts/vertex_wind_sway.gdshader) |
| 45 | High-performance GPU-driven foliage animation. Uses vertex world coordinates and vertex color weight painting to simulate wind without skeletons. |
| 46 | |
| 47 | ### [triplanar_world_projection.gdshader](scripts/triplanar_world_projection.gdshader) |
| 48 | UV-less environment mapping. Projects textures along X/Y/Z axes for organic blending over complex rocks and terrain. |
| 49 | |
| 50 | ### [subsurface_scattering_setup.gd](scripts/subsurface_scattering_setup.gd) |
| 51 | Configuring realistic organic materials. Covers Skin Mode, Transmittance, and depth scattering settings for Forward+ rendering. |
| 52 | |
| 53 | ### [instance_uniform_batching.gdshader](scripts/instance_uniform_batching.gdshader) |
| 54 | Architecture pattern for high-speed batching. Allows 10,000 meshes to share one material while maintaining unique colors or health states via instance uniforms. |
| 55 | |
| 56 | ### [decal_placer_expert.gd](scripts/decal_placer_expert.gd) |
| 57 | Dynamic 3D decal system with cull masking and life-cycle management for impact effects. |
| 58 | |
| 59 | ### [transparency_sorting_fix.gd](scripts/transparency_sorting_fix.gd) |
| 60 | Solving visual a |