On 10/26/2012 01:19 PM, Glenn Waldron wrote:
For cases where the ST coordinates can't be computed in object or eye
coordinates then you'll need to rely upon the UV coords that you've
computed. The OSG supports as many texture units as the underlying
OpenGL implementation supports and will scale up to 8 without problem
on most hardware/drivers. Going this route would be the most straight
forward.
Another idea is to use a TextureArray (GL_EXT_texture_array). This
removes the limit on the number of textures, but adds the constraint
that they all must be the same size and that you need GL 2.0.
From what I can tell, the main issue isn't the number of textures, it's
the number of varying parameters between the vertex and fragment
shader. If there are too many textures being applied at once (each with
their own set of texture coordinates), it may be possible to run out of
these, depending on what else is being interpolated between shader stages.
On my machine (Geforce GTX 260):
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS=96
GL_MAX_VARYING_FLOATS=60
So, 96 textures, but only 60 floats for varying parameters. This seems
like a lot, but if there are 64 textures on the mesh, it's not even
close to enough. Of course, newer cards than mine probably have more...
--"J"
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org