Skip to content

OSX Problem with shaders Alpha #2389

Closed Answered by rh101
IcemarkUK asked this question in Q&A
Feb 12, 2025 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

If the shaders will have different uniform values, then they should have separate batch identifiers, otherwise all sprites using that shader will end up with the same uniform values, which, if I recall correctly, would be the values from the last calls made to the setUniform method for each uniform.

ProgramState::updateBatchId() would need to be called after setting the uniform values, to ensure the batch ID is updated based on those values. For example, see if the following fixes the issue:

void shadermanager::CreateTerrainTimeShader()
{
    terrainTimeShader = SimpleShader::createWithFragmentShader("custom/terrainTimeShader_fs");
    terrainTimeShader->setUniform("p_left", Vec4(0,0,(165…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@rh101
Comment options

rh101 Feb 13, 2025
Collaborator

@IcemarkUK
Comment options

@rh101
Comment options

rh101 Feb 13, 2025
Collaborator

@IcemarkUK
Comment options

@rh101
Comment options

rh101 Feb 13, 2025
Collaborator

Answer selected by IcemarkUK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants