summaryrefslogtreecommitdiff
path: root/cnn_v3/shaders/gbuf_deferred.wgsl
diff options
context:
space:
mode:
Diffstat (limited to 'cnn_v3/shaders/gbuf_deferred.wgsl')
-rw-r--r--cnn_v3/shaders/gbuf_deferred.wgsl8
1 files changed, 4 insertions, 4 deletions
diff --git a/cnn_v3/shaders/gbuf_deferred.wgsl b/cnn_v3/shaders/gbuf_deferred.wgsl
index 2ed4ce3..bcc42cc 100644
--- a/cnn_v3/shaders/gbuf_deferred.wgsl
+++ b/cnn_v3/shaders/gbuf_deferred.wgsl
@@ -40,9 +40,9 @@ fn fs_main(@builtin(position) pos: vec4f) -> @location(0) vec4f {
let normal = oct_decode(vec2f(bx.y, ny_d.x));
let diffuse = max(0.0, dot(normal, KEY_LIGHT));
- // feat_tex1[2] = pack4x8unorm(mip2.g, mip2.b, shadow, transp)
- let t1 = textureLoad(feat_tex1, coord, 0);
- let shadow = unpack4x8unorm(t1.z).z;
+ // feat_tex1[3] = pack4x8unorm(dif.r, dif.g, dif.b, spare) — dif = diffuse*shadow
+ let t1 = textureLoad(feat_tex1, coord, 0);
+ let dif = unpack4x8unorm(t1.w).x;
- return vec4f(albedo * (AMBIENT + diffuse * shadow), 1.0);
+ return vec4f(albedo * (AMBIENT + dif), 1.0);
}