-
Notifications
You must be signed in to change notification settings - Fork 240
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
Shader uniforms #11
Shader uniforms #11
Conversation
@@ -182,3 +172,69 @@ GLuint ShaderProgram::makeCompiledShader(const std::string& _src, GLenum _type) | |||
return shader; | |||
|
|||
} | |||
|
|||
void ShaderProgram::setUniformi(const std::string& _name, int _value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where the dynamic JS methods are nice, with just one uniform
method with variable types:
https://github.com/tangram-map/tangram/blob/master/src/gl/gl_program.js#L282
That then get dispatched to the appropriate GL uniform setter variant:
https://github.com/tangram-map/tangram/blob/master/src/gl/gl_program.js#L309
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that made me jealous haha. No such luck for poor old statically compiled languages (or at least nothing faster than typing these up)
Adds functionality for setting shader uniforms by name and fixes some previous flaws in ShaderProgram; Further possible work: