Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32) -> VertexOutput {
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
let tile = floor((in.document_position - uniforms.pattern_origin) / uniforms.checker_size);
let parity = i32(tile.x + tile.y) & 1;
let luminance = vec3<f32>(select(1.0, 0.8, parity == 1));
return vec4<f32>(luminance, 1.0);
let luminance = select(1.0, 0.8, parity == 1);

let fw = fwidthFine(in.document_position);
let coverage_max = 1.0 - smoothstep(uniforms.rect_max - fw, uniforms.rect_max, in.document_position);
let coverage_min = smoothstep(uniforms.rect_min, uniforms.rect_min + fw, in.document_position);
Comment thread
timon-schelling marked this conversation as resolved.
let coverage = coverage_max * coverage_min;
let alpha = coverage.x * coverage.y;

return vec4<f32>(vec3<f32>(luminance), alpha);
}
2 changes: 1 addition & 1 deletion node-graph/libraries/wgpu-executor/src/background/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl BackgroundCompositor {
compilation_options: Default::default(),
targets: &[Some(wgpu::ColorTargetState {
format,
blend: None,
blend: Some(wgpu::BlendState::ALPHA_BLENDING),
write_mask: wgpu::ColorWrites::ALL,
})],
}),
Expand Down
Loading