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

ShaderProgram.SetUniform1 does not work for int uniforms #226

Open
VE3NEA opened this issue Oct 29, 2023 · 1 comment
Open

ShaderProgram.SetUniform1 does not work for int uniforms #226

VE3NEA opened this issue Oct 29, 2023 · 1 comment

Comments

@VE3NEA
Copy link

VE3NEA commented Oct 29, 2023

This statement does not change the integer uniform:

shaderProgram.SetUniform1(gl, "my_texture", 1);

This one works orrectly:

 gl.Uniform1(shaderProgram.GetUniformLocation(gl, "my_texture"), 1);

The problem with the first statement is that the third parameter of SetUniform1 is declared as float, so if an int value is passed,
it is typecasted to float before the call to gl.Uniform1.

@brisingre
Copy link

This got me as well! Took us a week to figure it out before my friend found this ticket...

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