Skip to content

ShaderProgram.SetUniform1 does not work for int uniforms #226

@VE3NEA

Description

@VE3NEA

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions