texture3D integer indexing

Is it possible to index with a sampler3D using integer indices?

My 3D data represents a queue of cubes. If I want to grab the 50th element out of a queue of size 100 I actually need to grab the value at 0.5 (because it is shrunk to the interval of [0,1]) but this makes me worried because as the queue size increases, the chances of me indexing the correct element relies on the accuracy of floating point resolution.

Is there a way to index it with integers so that I can do something like this?

uvec3 v = texture3D( data, vec3( 50, 0, 0 ) );

Thanks

If you’re using GLSL 1.30 or above, you can use texelFetch.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.