From ab7b784b7907cc4d33187d2d343048b1a092bbc9 Mon Sep 17 00:00:00 2001 From: Timon Date: Fri, 22 May 2026 15:42:07 +0000 Subject: [PATCH 1/2] Antialias checkered artboard background edges --- .../wgpu-executor/src/background/checker_rect.wgsl | 11 +++++++++-- .../libraries/wgpu-executor/src/background/mod.rs | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/node-graph/libraries/wgpu-executor/src/background/checker_rect.wgsl b/node-graph/libraries/wgpu-executor/src/background/checker_rect.wgsl index 79f7163c22..e4e63dbaa3 100644 --- a/node-graph/libraries/wgpu-executor/src/background/checker_rect.wgsl +++ b/node-graph/libraries/wgpu-executor/src/background/checker_rect.wgsl @@ -44,6 +44,13 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32) -> VertexOutput { fn fs_main(in: VertexOutput) -> @location(0) vec4 { let tile = floor((in.document_position - uniforms.pattern_origin) / uniforms.checker_size); let parity = i32(tile.x + tile.y) & 1; - let luminance = vec3(select(1.0, 0.8, parity == 1)); - return vec4(luminance, 1.0); + let luminance = select(1.0, 0.8, parity == 1); + + let fw = fwidthFine(in.document_position); + let coverage_max = smoothstep(uniforms.rect_max, uniforms.rect_max - fw, in.document_position); + let coverage_min = smoothstep(uniforms.rect_min, uniforms.rect_min + fw, in.document_position); + let coverage = coverage_max * coverage_min; + let alpha = coverage.x * coverage.y; + + return vec4(vec3(luminance), alpha); } diff --git a/node-graph/libraries/wgpu-executor/src/background/mod.rs b/node-graph/libraries/wgpu-executor/src/background/mod.rs index 9fbfb64151..dd4df445ad 100644 --- a/node-graph/libraries/wgpu-executor/src/background/mod.rs +++ b/node-graph/libraries/wgpu-executor/src/background/mod.rs @@ -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, })], }), From e8d631f4f7c6259a0e809ff2e6701aad38fe8108 Mon Sep 17 00:00:00 2001 From: Timon Date: Fri, 22 May 2026 16:21:14 +0000 Subject: [PATCH 2/2] Review --- .../libraries/wgpu-executor/src/background/checker_rect.wgsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-graph/libraries/wgpu-executor/src/background/checker_rect.wgsl b/node-graph/libraries/wgpu-executor/src/background/checker_rect.wgsl index e4e63dbaa3..7dce58c939 100644 --- a/node-graph/libraries/wgpu-executor/src/background/checker_rect.wgsl +++ b/node-graph/libraries/wgpu-executor/src/background/checker_rect.wgsl @@ -47,7 +47,7 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4 { let luminance = select(1.0, 0.8, parity == 1); let fw = fwidthFine(in.document_position); - let coverage_max = smoothstep(uniforms.rect_max, uniforms.rect_max - fw, 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); let coverage = coverage_max * coverage_min; let alpha = coverage.x * coverage.y;