jos_t_tarigan
09-26-2010, 07:08 PM
hi,
im trying to send an array to glsl through a texture. i send the texture as an integer 3D texture (GL_R32I). when I apply to a bigger value, it behaves weirdly. while the first half are rendered correctly, the other half is just a mess up.
for example when i try to run this code:
http://pastebin.com/XERH0NNx
notice this part:
int startPointValue = (int)startPointValuev4.r;
if(startPointValue*1.0 == (19049758.0+0.5) ) color = vec4(0.0, 0.0, 1.0, 1.0);
it render a little blue spot on my texture, which means there are time when startPointValue(integer casted to float) has a decimal value.
Im not sure what happened, does openGL has a limited capability on handling 3D Integer(32 bit) Texture? When using RGBA unsigned byte format, it works properly even for a bigger 3D Texture. Did I miss anything? Anyone ever send millions of integer to GLSL(by texture of whatever)?
thanks in advance
im trying to send an array to glsl through a texture. i send the texture as an integer 3D texture (GL_R32I). when I apply to a bigger value, it behaves weirdly. while the first half are rendered correctly, the other half is just a mess up.
for example when i try to run this code:
http://pastebin.com/XERH0NNx
notice this part:
int startPointValue = (int)startPointValuev4.r;
if(startPointValue*1.0 == (19049758.0+0.5) ) color = vec4(0.0, 0.0, 1.0, 1.0);
it render a little blue spot on my texture, which means there are time when startPointValue(integer casted to float) has a decimal value.
Im not sure what happened, does openGL has a limited capability on handling 3D Integer(32 bit) Texture? When using RGBA unsigned byte format, it works properly even for a bigger 3D Texture. Did I miss anything? Anyone ever send millions of integer to GLSL(by texture of whatever)?
thanks in advance