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

BUG: bad clipping on macOS arm64 #938

Closed
dsvensson opened this issue Sep 11, 2024 · 1 comment
Closed

BUG: bad clipping on macOS arm64 #938

dsvensson opened this issue Sep 11, 2024 · 1 comment

Comments

@dsvensson
Copy link
Collaborator

dsvensson commented Sep 11, 2024

The following clipping bug seems to happen on a number of Quake engines, QuakeSpasm, ezQuake, FTE (but not via WebGL):

sezero/quakespasm#80

The effect is that if a triangle is about 50% outside of view it has a risk of being clipped. This is mostly happening with an non-transformed view, directly at spawn at dm3 RL moving straight forward with arrow keys is a great place to reproduce. I haven't verified in ezQuake via debugger, but it's mentioned that when two vertices share the same position, with a negative w component this may happen on iPad, which is close enough to apply to MacBooks as well.

Potential clue:
https://gamedev.net/forums/topic/609483-ipadopengl-es-20-a-triangle-disappears-at-particlular-camera-view/
http://web.archive.org/web/20150908203347/http://fly.srk.fer.hr/~unreal/theredbook/appendixg.html

OpenGL might not handle homogeneous clip coordinates with w < 0 correctly. To be sure that your code is portable to all OpenGL systems, use only nonnegative w values.

@dsvensson
Copy link
Collaborator Author

dsvensson commented Sep 13, 2024

If tesselation produces a triangle of ~zero area (collinear triangle), this happens. Fix tesselation to avoid this.

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

1 participant