Skip to content

Commit 10a1c36

Browse files
committed
Make background transparent
1 parent 7bcee70 commit 10a1c36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/with_winit/src/shader.wgsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ fn render(fragCoord: vec2<f32>, light_color: vec3<f32>) -> vec4<f32> {
9999
var light = 7.0 + 2.0 * dot(surf_normal, light_position);
100100
light = light / (0.2 * pow(length(light_position - p), 3.5));
101101

102-
return vec4<f32>(light * light_color, 1.0) * 2.0;
102+
let alpha = select(0.0, 1.0, i < 90);
103+
return vec4<f32>(light * light_color, alpha) * 2.0;
103104
}
104105

105106
@fragment

0 commit comments

Comments
 (0)