On 10/23/2012 02:35 AM, Christoph Heindl wrote:

After a bit of research I stumbled upon the following approaches to multi-texturing - using ARB_multitexture extension. Seems to be limited by available hardware units. - using GPU multitexturing using separate texture units. Also limited by available texture units on hardware

There's no difference between these two. ARB_multitexture is a 15-year old extension that simply provides the specification for how multitexturing is done. Multitexturing has been part of standard OpenGL since version 1.3.


- using multi-pass rendering. Probably slower but not limited by hardware.

I doubt you'll need to resort to this, but with the vague description of what you're doing, I can't be 100% sure.



Question 1: Is there a way to generically supply the textures and UV coordinate sets and let OSG choose the best rendering technique from the list above?

Again, I can't be sure what you're trying to do from your brief description, but it sounds like you already have a mesh generated from photos and you now just want to project those photos (which have a known location, orientation, etc) onto the mesh.

If this is true, you can generate the texture coordinates directly from the position/orientation of the photo and the positions of each vertex in the mesh. Read up on projective texturing to see how this is done. OSG can do this easily if you write a shader for it, or you can use the osg::TexGen state attribute to handle it for you (it works just like glTexGen in regular OpenGL).

The other thing you'll need to do is divide up the mesh so that only the faces that are covered by a given photo or photos are being drawn and textured by those photos. This will eliminate the need for you to have as many texture units as there are photos. There may be regions of the mesh where you want to blend two or more photos together, and this is the only time where you'd need multitexturing. You should be able to handle this mesh segmentation with a not-too-complicated preprocessing step.

Hope this helps,

--"J"
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to