View Full Version : Assign to uniform from shader
04-11-2011, 09:52 PM
It doesn't seem to be allowed to assign to uniform parameters from inside the shader program? It would be a great way to help debugging.
04-11-2011, 10:50 PM
It doesn't seem to be allowed to assign to uniform parameters from inside the shader program?
Of course not. Uniforms, by definition, are uniform. Constant. They do not change across multiple executions of a shader. If you could set them from within a shader, they wouldn't be uniform anymore.
You can initialize uniforms to a value, but they will only retain that value so long as you don't set that uniform on that program from OpenGL. If you do, then the initialized value is lost.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.