From c1b505356cd2f425ab1a12bb004eceabb08cb144 Mon Sep 17 00:00:00 2001 From: numzero Date: Sun, 17 Nov 2024 20:14:04 +0300 Subject: [PATCH] Keep opacity independent of direction --- src/bin/wireframe/mesh.wgsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/wireframe/mesh.wgsl b/src/bin/wireframe/mesh.wgsl index 0de69b4..70dcea2 100644 --- a/src/bin/wireframe/mesh.wgsl +++ b/src/bin/wireframe/mesh.wgsl @@ -37,7 +37,7 @@ fn vs_main(ver: VertexInput) -> VertexOutput { var out: VertexOutput; var light = dot(ver.normal, normalize(vec3(1., 1., 1.))); light = .7 + .3 * light; - out.vertex_color = light * mesh.color; + out.vertex_color = vec4(light * mesh.color.xyz, mesh.color.w); out.clip_position = camera.mvp * vec4(ver.position, 1.); return out; }