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

Sanitize CUS_GL4 clip planes shader code #2703

Open
lhog opened this issue Mar 8, 2024 · 0 comments
Open

Sanitize CUS_GL4 clip planes shader code #2703

lhog opened this issue Mar 8, 2024 · 0 comments
Assignees
Labels
Bug Something isn't working

Comments

@lhog
Copy link
Collaborator

lhog commented Mar 8, 2024

Description

There're a few issues with CUS shader:

This code uses gl_ClipDistance array, but it's not declared in the vertex shader like (as it should):
out float gl_ClipDistance[3];

https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/modelmaterials_gl4/templates/defaultMaterialTemplate.lua#L512 and https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/modelmaterials_gl4/templates/defaultMaterialTemplate.lua#L516 deal with gl_ClipDistance[2] and gl_ClipDistance[0] respectively, gl_ClipDistance[1] is dangling.

https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/modelmaterials_gl4/templates/defaultMaterialTemplate.lua#L115-L116 are unused, which is confusing.

I believe these issues combined make models look like this on Zink (OpenGL over Vulkan driver):
screen_2024-03-08_14-59-34-069

Expected Behaviour

See above

Actual Behaviour

See above

Reproduction steps

No response

Other

No response

@lhog lhog added the Bug Something isn't working label Mar 8, 2024
@Beherith Beherith self-assigned this Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants