LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: HerrKhosse on April 01, 2011, 10:17:41

Title: GLSL - ARBShaderObjects - Uniforming
Post by: HerrKhosse on April 01, 2011, 10:17:41
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?
Title: Re: GLSL - ARBShaderObjects - Uniforming
Post by: spasi on April 01, 2011, 21:31:11
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.
Title: Re: GLSL - ARBShaderObjects - Uniforming
Post by: HerrKhosse on April 01, 2011, 22:32:56
Okay, thanks for the fast reply