@@ -427,10 +427,10 @@ All 40 shader permutations are generated at **compile time** by `build.rs`:
427427
428428```
429429Total: 40 shaders
430- - Mode 0: 16 shaders (all vertex formats)
431- - Mode 1: 8 shaders (formats with NORMAL)
432- - Mode 2: 8 shaders (formats with NORMAL)
433- - Mode 3: 8 shaders (formats with NORMAL)
430+ - Mode 0: 24 shaders (all vertex formats; TANGENT requires NORMAL )
431+ - Mode 1: 16 shaders (formats with NORMAL; optionally TANGENT )
432+ - Mode 2: 16 shaders (formats with NORMAL; optionally TANGENT )
433+ - Mode 3: 16 shaders (formats with NORMAL; optionally TANGENT )
434434```
435435
436436** Why compile-time?**
@@ -446,15 +446,16 @@ Shaders are generated from WGSL templates with placeholder replacement:
446446- ` shaders/mode0_lambert.wgsl ` — Mode 0 template
447447- ` shaders/mode1_matcap.wgsl ` — Mode 1 template
448448- ` shaders/blinnphong_common.wgsl ` — Modes 2-3 common code
449- - ` shaders/common.wgsl ` — Shared utilities
449+ - ` shaders/common/* .wgsl ` — Shared bindings/ utilities (concatenated in-order by the build script)
450450
451451** Placeholders replaced:**
452452
453453Vertex inputs:
454454- ` //VIN_UV ` → ` @location(1) uv: vec2<f32>, `
455- - ` //VIN_COLOR ` → ` @location(2) color: vec4 <f32>, `
456- - ` //VIN_NORMAL ` → ` @location(3) normal : u32, `
455+ - ` //VIN_COLOR ` → ` @location(2) color: vec3 <f32>, `
456+ - ` //VIN_NORMAL ` → ` @location(3) normal_packed : u32, `
457457- ` //VIN_SKINNED ` → bone indices/weights
458+ - ` //VIN_TANGENT ` → ` @location(6) tangent_packed: u32, `
458459
459460Vertex shader body:
460461- ` //VS_UV ` → UV passthrough
@@ -573,10 +574,10 @@ The EPU supports two independent environment layers (base and overlay) that can
573574// Configure base layer (layer 0)
574575fn env_gradient (layer : u32 , zenith : u32 , sky_horizon : u32 , ground_horizon : u32 ,
575576 nadir : u32 , azim : f32 , shift : f32 , elev : f32 ,
576- disk : u32 , halo : u32 , intensity : u32 , haze : u32 , warmth : u32 , cloudiness : u32 )
577+ disk : u32 , halo : u32 , intensity : u32 , haze : u32 , warmth : u32 , cloudiness : u32 , cloud_phase : u32 )
577578
578579// Configure overlay layer (layer 1) with a different mode
579- fn env_scatter (layer : u32 , variant : u32 , density : u32 , ... )
580+ fn env_cells (layer : u32 , family : u32 , variant : u32 , density : u32 , ... )
580581
581582// Set blend mode for overlay compositing
582583fn env_blend (mode : u32 ) // 0=alpha, 1=add, 2=multiply, 3=screen
@@ -589,7 +590,7 @@ fn draw_env()
589590- Layer 0 (base ): Primary environment layer
590591- Layer 1 (overlay ): Secondary layer composited on top
591592- Same mode can be used on both layers with different parameters
592- - Example : Stars (layer 0 ) + rain (layer 1 ), both using scatter mode
593+ - Example : Stars (layer 0 ) + rain (layer 1 ), both using Cells mode ( family 0 , variants 0 / 1 )
593594
594595* * Ambient calculation : **
595596```
@@ -741,7 +742,7 @@ Invalidate on:
741742| ` nethercore-zx/src/graphics/buffer/mod.rs ` | Buffer management |
742743| ` nethercore-zx/src/graphics/command_buffer.rs ` | Virtual render pass |
743744| ` nethercore-zx/src/graphics/texture_manager.rs ` | Texture loading and VRAM tracking |
744- | ` nethercore-zx/src/shader_gen.rs ` | Shader permutation system |
745+ | ` nethercore-zx/src/shader_gen/ ` | Shader permutation system |
745746| ` nethercore-zx/shaders/*.wgsl ` | Shader templates |
746747
747748---
0 commit comments