diff --git a/kubi/shaders/world.wgsl b/kubi/shaders/world.wgsl index ed5d35d..96b54a7 100644 --- a/kubi/shaders/world.wgsl +++ b/kubi/shaders/world.wgsl @@ -39,10 +39,20 @@ var s_diffuse: sampler; @fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { - let color: vec4 = textureSample(t_diffuse, s_diffuse, in.uv, in.tex_index); + // not actual lighting; makes it easier to distinguish unlit faces + let light: f32 = + abs(in.normal.x) + .85 * + abs(in.normal.y) + .65 * + abs(in.normal.z); + + let color: vec4 = + textureSample(t_diffuse, s_diffuse, in.uv, in.tex_index) + * vec4(light, light, light, 1.0); + if (color.a < 0.5) { discard; } + return color; }