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

Render a simple triangle #4

Closed
3 tasks done
Tracked by #2
AlexandruIca opened this issue Oct 21, 2021 · 0 comments
Closed
3 tasks done
Tracked by #2

Render a simple triangle #4

AlexandruIca opened this issue Oct 21, 2021 · 0 comments
Assignees
Labels
feature New feature or request
Projects

Comments

@AlexandruIca
Copy link
Owner

AlexandruIca commented Oct 21, 2021

Follow the algorithm presented here and render a simple triangle for the start. Maybe add a post-processing ability to take into account color spaces. Ideally we should also take into account alpha compositing but it's ok if it's not fully correct for now.

@AlexandruIca AlexandruIca added the feature New feature or request label Oct 21, 2021
@AlexandruIca AlexandruIca self-assigned this Oct 21, 2021
@AlexandruIca AlexandruIca added this to ToDo in Backlog via automation Oct 27, 2021
@AlexandruIca AlexandruIca added this to the First Triangle! milestone Oct 27, 2021
AlexandruIca added a commit that referenced this issue Dec 18, 2021
A simple function that fits a point to a grid of `WIDTH * HEIGHT *
NUM_CHANNELS`, with `pixel_size * pixel_size` subpixels
AlexandruIca added a commit that referenced this issue Dec 18, 2021
For easier access to the buffer's colors.
AlexandruIca added a commit that referenced this issue Dec 18, 2021
Failed, but will come back after working on other issues first.
AlexandruIca added a commit that referenced this issue Feb 11, 2022
The code is now much more modular/reusable, more to come!
AlexandruIca added a commit that referenced this issue Feb 13, 2022
So that it's much easier to see if rendering is done correctly or not.
AlexandruIca added a commit that referenced this issue Apr 3, 2022
This function clamps each color's RGB channel to the range [0.0, 1.0]
AlexandruIca added a commit that referenced this issue Apr 3, 2022
`geometry.rs` (#4)

We'll have to see what we do with this file, currently we don't need
it, but it would be nice to transfer some stuff from `canvas.rs` into
here.
AlexandruIca added a commit that referenced this issue Apr 3, 2022
Unfortunately we have a bug where we can't specify the limits to be
`WIDTH` and `HEIGHT` because we get an out-of-bounds error.
AlexandruIca added a commit that referenced this issue Apr 3, 2022
The old algorithm was a bit too complex to implement correctly. I was
stuck with the coverage computation, I just couldn't find a way to
compute the trapezoidal area correctly and robustly.

Being tired, I decided to follow `font-rs`'s choice of line rendering
algorithm with Levien-style anti-aliasing. It gives excellent results
and (at least at first) seems kind of easy to understand. I'll have to
see how I can implement the even-odd fill rule with this one. Right now
I'm thinking about checking when the coverage changes its sign, but I
don't know if that's the correct way, we'll see.
AlexandruIca added a commit that referenced this issue Apr 3, 2022
This tests the non-zero fill rule with rects inside rects.
Backlog automation moved this from ToDo to Done Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Development

No branches or pull requests

1 participant