Khronos public bugtracker – Bug 304
Add texture array sampler types
Last modified: 2014-01-07 10:23:10 PST
OpenGL supports texture arrays for some time now. It is a core feature in OpenGL 3.0. A texture array is a special type of texture that contains several 2D image slices. The whole texture array has only one vector of samplering states and is treated as one single texture object.
Currently this cannot be expressed by ColladaFX. Collada allows arrays of samplers but this is not the right tool here. The Collada sampler types consist of an image to be sampled and sampler states. So in an array of sampler2D there would be individual sampler states and images for each element. Instead a single set of sampler states and a single image to be sampled is required.
It might be possible to do ugly things like creating an array of sampler2D and setting every element to the same sampler states and image. But what about setparam? Should they also be forced to set the images of all elements? Furthermore for texture arrays the image should define the size of the array not the sampler newparam.
I propose two alternative solutions:
Add sampler types:sampler1Darray, sampler2Darray, samplerCUBEarray, samplerRECTarray.
Add an "is_array" attribute to existing sampler types that defaults to false.
Fortunately the image element that samplers reference already has everything needed to represent a texture array.