diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-22 19:29:01 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-22 19:29:01 +0100 |
| commit | 7b89a7130a998017de98dde363a8d9be61d7d44e (patch) | |
| tree | 2b45a3253a5770170d787915b5c3d18fd69e40ac /src/effects/shaders.cc | |
| parent | c5e66964c0463219019d0439ec20b79248637fa4 (diff) | |
feat(cnn_v3): GBufferEffect Pass 2 — SDF shadow raymarching
Implements gbuf_shadow.wgsl: fullscreen render pass that reads depth
from Pass 1, reconstructs world-space positions, evaluates a proxy-box
SDF for each object (via inv_model), computes soft shadows for both
directional lights using shadowWithStoredDistance(), and writes shadow
factor to the RGBA8Unorm node_shadow_ target consumed by gbuf_pack.wgsl.
Bind layout: B0=GlobalUniforms, B1=ObjectsBuffer (storage-read),
B2=texture_depth_2d, B3=GBufLightsUniforms.
Sky fragments (depth=1.0) are output as 1.0 (fully lit).
Falls back to clear(1.0) if pipeline is not ready.
36/36 tests pass.
handoff(Gemini): Pass 2 done. Pass 3 (transparency) still TODO.
Phase 4 (type-aware SDF) optional after visual validation.
Diffstat (limited to 'src/effects/shaders.cc')
| -rw-r--r-- | src/effects/shaders.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/effects/shaders.cc b/src/effects/shaders.cc index 37b7d09..a74d920 100644 --- a/src/effects/shaders.cc +++ b/src/effects/shaders.cc @@ -117,6 +117,7 @@ const char* ntsc_rgb_shader_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_NTSC_RGB); const char* ntsc_yiq_shader_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_NTSC_YIQ); const char* gbuf_raster_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_RASTER); const char* gbuf_pack_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_PACK); +const char* gbuf_shadow_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_SHADOW); const char* gbuf_view_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_GBUF_VIEW); const char* cnn_v3_enc0_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_ENC0); const char* cnn_v3_enc1_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_CNN_V3_ENC1); |
