Actually do anaglyph
This commit is contained in:
+8
-2
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user