Actually do anaglyph

This commit is contained in:
2024-11-03 13:49:10 -05:00
parent b025f72604
commit a0e39796bf
4 changed files with 55 additions and 2 deletions
+8 -2
View File
@@ -41,9 +41,15 @@ var u_texture: texture_2d<f32>;
@group(0) @binding(1)
var u_sampler: sampler;
struct Colors {
left: vec4<f32>,
right: vec4<f32>,
};
@group(0) @binding(2)
var<uniform> colors: Colors;
@fragment
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
return textureSample(u_texture, u_sampler, in.tex_coords);
// return vec4<f32>(0.3, 0.2, 0.1, 1.0);
let brt = textureSample(u_texture, u_sampler, in.tex_coords);
return colors.left * brt[0] + colors.right * brt[1];
}