Skip to content

Commit

Permalink
Removed unused code, modified mask to render into a separate scene, a…
Browse files Browse the repository at this point in the history
…dded additional comments, cleaned up description
  • Loading branch information
cmhhelgeson committed Apr 3, 2024
1 parent a7f9b26 commit f1ffdce
Show file tree
Hide file tree
Showing 6 changed files with 235 additions and 112 deletions.
9 changes: 8 additions & 1 deletion sample/stencilMask/fullscreenQuad.vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ struct Uniforms {
offset_x: f32,
offset_y: f32,
radius_scale: f32,
sdf_id: u32,
scale_to_canvas_x: f32,
scale_to_canvas_y:f32,
}

@group(0) @binding(0) var<uniform> uniforms: Uniforms;
Expand All @@ -33,8 +36,12 @@ fn vertexMain(@builtin(vertex_index) VertexIndex : u32) -> VertexOutput {

var output : VertexOutput;
let mask_offset = vec2f(uniforms.offset_x, uniforms.offset_y);
// scale_to_canvas is effectively a transformation that takes our quad positions from NDC space to canvas space.
let scale_to_canvas = vec2<f32>(uniforms.scale_to_canvas_x, uniforms.scale_to_canvas_y);
let posCS = pos[VertexIndex] * scale_to_canvas;
let offsetCS = mask_offset * scale_to_canvas;
output.Position = vec4(
pos[VertexIndex] / uniforms.radius_scale + mask_offset,
posCS * uniforms.radius_scale + offsetCS,
0.0,
1.0
);
Expand Down
24 changes: 0 additions & 24 deletions sample/stencilMask/instanced.vert.wgsl

This file was deleted.

Loading

0 comments on commit f1ffdce

Please sign in to comment.