GLSL - ARBShaderObjects - Uniforming

Started by HerrKhosse, April 01, 2011, 10:17:41

Previous topic - Next topic

HerrKhosse

Hi there,

I just wondered if the ARBShaderObjects.glUniform* Methods is all we have, actually, I currently want to pass a boolean array but there are no available methods for that, only single float/int and Float/Int-Buffer.
I can of course use int or float, but it seems rather inefficient.

And ideas?

spasi

Yes, according to the spec you have to use either integers or floats:

QuoteWhen loading values for a uniform declared as a boolean, a boolean vector, an array of booleans, or an array of boolean vectors, the Uniform*i{v}, Uniform*ui{v}, and Uniform*f{v} set of commands can be used to load boolean values. Type conversion is done by the GL. The uniform is set to FALSE if the input value is 0 or 0.0f, and set to TRUE otherwise. The Uniform* command used must match the size of the uniform, as declared in the shader. For example, to load a uniform declared as a bvec2, any of the Uniform2{if ui}* commands may be used.

HerrKhosse