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

Fixing rendering of primitives #242

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

avahe-kellenberger
Copy link

@avahe-kellenberger avahe-kellenberger commented Sep 3, 2022

Should resolve issues addressed in #220

  • GPU_Pixel now renders on the center of the pixel
  • GPU_Line renders from the center of pixels
  • GPU_Rectangle borders are now rendered inside the rectangle instead of being centered on the bounds

If any of these behavioral changes are unwanted, maybe we can introduce a way to allow the users to decide on the behavior. E.g. enums/booleans, new functions, etc.

Here's an illustration of the changes made to GPU_Rectangle:

image

  • The outer black rectangle represents the outer edges of the pixels
  • The inner red rectangle represents the inner edges of the pixels
  • The numbers are the indices of the vertexes of the triangles used to draw the rectangle sides

The function now uses an "inner-stroke" instead of trying to center the
lines of the rectangle onto its outer pixel coordinates.
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

Successfully merging this pull request may close these issues.

2 participants