linebender / linebender/vello

Display problem when two rectangles are close to each other

Open
#417 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
4.3k
Forks
300
Avg merge
2d 13h
Merged PRs (30d)
61

Description

for (var i = 0u; i < PIXELS_PER_THREAD; i += 1u) {
let i_f = f32(i);
let xmin = min(xmin0 - i_f, 1.0) - 1.0e-6;
let xmax = xmax0 - i_f;
let b = min(xmax, 1.0);
let c = max(b, 0.0);
let d = max(xmin, 0.0);
**_let a = (b + 0.5 * (d * d - c * c) - xmin) / (xmax - xmin);_**
area[i] += a * dy;
}
What is the purpose of x squared minus x squared in this code at the end of fine.wgsl? Suppose I have two rectangles, one is at position (0,0) with width and height of (100,100), and the other is at position (100,100) , the width and height are (200,200). Now we find that if we want to subtract c square from d square, there will be a gap between them. If we remove it, there will be no gap. Can it be removed please? Is there any other way to solve it?
![xxx](https://github.com/linebender/vello/assets/4046999/20f884e0-d8fe-4454-a1ab-38c1838a5919)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in fine.wgsl at the highlighted calculation and trace how a, b, c, and d contribute to area. Reproduce the adjacent-rectangle example from the issue, then compare the rendered result with and without the squared terms. Done means the gap is resolved without breaking area coverage for other rectangle layouts.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.