Use colorModulateColorGen instead of disabling vertex color#1514
Merged
VReaperV merged 1 commit intoDaemonEngine:masterfrom Jan 29, 2025
Merged
Use colorModulateColorGen instead of disabling vertex color#1514VReaperV merged 1 commit intoDaemonEngine:masterfrom
VReaperV merged 1 commit intoDaemonEngine:masterfrom
Conversation
9f18b21 to
21ac5dc
Compare
Contributor
Author
|
I've added a fix for #1522 here, since this pr changes the relevant code anyway. |
21ac5dc to
b5ae49c
Compare
Originally, vertex color array was disabled if colorGen CGEN_VERTEX or CGEN_ONE_MINUS_VERTEX or alphaGen CGEN_VERTEX or CGEN_ONE_MINUS_VERTEX were used, resulting in the shader receiving the default OpenGL values for the disabled arrays (0.0, 0.0, 0.0, 1.0). Now it will instead be set via setting a bit in `u_ColorModulateColorGen`, which allows skipping the vertex format change. It will also be necessary for the geometry cache. Also fixes incorrect lighting with `tr.mapOverBrightBits = 3`.
b5ae49c to
944ddbd
Compare
Member
|
LGTM |
slipher
reviewed
Jan 29, 2025
| /* Originally, this controlled whether the vertex color array was used, | ||
| now it does the equivalent by setting the color in the shader in such way as if it was using | ||
| the default OpenGL values for the disabled arrays (0.0, 0.0, 0.0, 1.0) | ||
| This allows to skip the vertex format change */ |
Member
There was a problem hiding this comment.
Is that related to "Vertex shader in program 11 is being recompiled based on GL state." warnings?
Contributor
Author
There was a problem hiding this comment.
It might be. On my end I got this warn for the deformVertexes shader, which does use data taken from attr_Color. Perhaps the driver was optimising all attr_Color and derivative usages out when the attrib was disabled, then had to recompile when it got enabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Originally, vertex color array was disabled if colorGen CGEN_VERTEX or CGEN_ONE_MINUS_VERTEX or alphaGen CGEN_VERTEX or CGEN_ONE_MINUS_VERTEX were used, resulting in the shader receiving the default OpenGL values for the disabled arrays (0.0, 0.0, 0.0, 1.0).
Now it will instead be set via setting a bit in
u_ColorModulateColorGen, which allows skipping the vertex format change - changing the vertex format can require doing quite a lot in the driver i. e. being slower. It will also be necessary for the geometry cache.Also fixed the incorrect lighting with
tr.mapOverBrightBits = 3(#1522).