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

Z fighting when applications render using GLSL #8

Open
kintel opened this issue Apr 11, 2023 · 2 comments
Open

Z fighting when applications render using GLSL #8

kintel opened this issue Apr 11, 2023 · 2 comments

Comments

@kintel
Copy link
Contributor

kintel commented Apr 11, 2023

OpenCSG transforms vertices (and hence produces depth values) using the legacy OpenGL fixed pipeline.
On common GPUs (Tested modern Intel iGPU and nVidia), the fixed function pipeline produces slightly different vertex positions than the programmable pipeline. Since OpenCSG relies on applications rendering final images using a GL_EQUAL depth test, this causes z buffer tearing for applications rendering using a programmable pipeline.

For more info, see openscad/openscad#4595

@floriankirsch
Copy link
Owner

A valid bug. But in OpenCSG, just switching to a different of pipeline will not help, since this would introduce the same problem for applications using the fixed pipeline.

Probably this means that there must be some kind of hook to control how OpenCSG transforms the vertices. That hook would optionally activate some programmable shader.

Question is whether one hook is sufficient, and if this must be fully controlable from the calling application.

@kintel
Copy link
Contributor Author

kintel commented Aug 27, 2023

Yeah, there are still, but hopefully very few, apps who still use legacy OpenGL. A compile-time flag might be the easiest option, but that will cause challenges for packaging, but will work for embedding.
An alternative to a hook could be to add an initialization function to OpenCSG. That could also help solve the GLEW issue (#10).

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