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

[rshapes] Pixel perfect issue #4670

Closed
Bigfoot71 opened this issue Jan 9, 2025 · 1 comment
Closed

[rshapes] Pixel perfect issue #4670

Bigfoot71 opened this issue Jan 9, 2025 · 1 comment

Comments

@Bigfoot71
Copy link
Contributor

This issue is about the discussions regarding the offset problems when rendering lines, see:

I noticed that the line rlTranslatef(0.375, 0.375, 0) is commented out in BeginDrawing().

AFAIK, this 0.375 offset was used to align coordinates with the centers of pixels, as NVIDIA and ATI had different rounding conventions, this offset worked for both manufacturers.

However, I have doubts about the explanation in the comment stating that this line is no longer needed with OpenGL 3.3+:

//rlTranslatef(0.375, 0.375, 0); // HACK for 2D pixel-perfect drawing on OpenGL 1.1
// NOTE: Not required with OpenGL 3.3+

I suspect that rounding conventions might have been standardized between manufacturers, making the 0.375 offset unnecessary, but I haven't found confirmation on this.

Based on my knowledge, with OpenGL, and here in the case of orthographic 2D projection, integer coordinates still correspond to the corners of the pixels, not their centers, so the offset for pixel-perfect rendering might still be needed.

Do I lack any additional information on this?

@raysan5
Copy link
Owner

raysan5 commented Jan 10, 2025

@asdqwe Thanks for the reference! Very interesting!

@Bigfoot71 I think we can keep as it is for now, let's see if it pops up again in the future dramatically afffecting some real application...

@raysan5 raysan5 closed this as completed Jan 10, 2025
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

2 participants