Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edges of shapes are not rendered well #19

Open
Long0x0 opened this issue May 5, 2024 · 2 comments
Open

Edges of shapes are not rendered well #19

Long0x0 opened this issue May 5, 2024 · 2 comments

Comments

@Long0x0
Copy link

Long0x0 commented May 5, 2024

Black rectangle expected to be invisible:

    let black = vger.color_paint(Color{r: 0.0, g: 0.0, b: 0.0, a: 1.0});
    vger.fill_rect(euclid::rect(100.0, 100.0, 100.0, 100.0), 10.0, black);

image
(5x)

Two rectangles expected to be seamless:

    let cyan = vger.color_paint(Color::CYAN);
    vger.fill_rect(euclid::rect(100.0, 100.0, 100.0, 100.0), 0.0, cyan);
    vger.fill_rect(euclid::rect(200.0, 100.0, 100.0, 100.0), 0.0, cyan);

image
(5x)

I guess these artifacts are caused by anti-aliasing.

@wtholliday
Copy link
Contributor

wtholliday commented May 5, 2024

Thanks for the report!

I'll take a closer look at the black rectangle example.

Edit: actually two smoothsteps in opposite directions do sum to one, so I'll have to look into that in more detail as well.

@songhuaixu
Copy link

Thanks for the report!

I'll take a closer look at the black rectangle example.

Edit: actually two smoothsteps in opposite directions do sum to one, so I'll have to look into that in more detail as well.

How to solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants