[osg-users] 'loosing' textures? = How to create a proper .osg file with multi-texturing?

Raymond de Vries reedev at xs4all.nl
Fri Sep 21 00:08:54 PDT 2007

Hi Robert, good morning,

I fully understand your point of view about the osgViewer, and I support 
that. Actually, I've set up a test project to give it a try.

It seems that my problem has to do with my (hand-made) multi-textured 
models! So it seems that I am not handling the statesets properly... I 
created a multi-textured .osg file by hand, and I suspect that I forgot 
to set/change something. It looks ok when I load it in osgviewer and I 
don't see any errors reported by osgviewer (env var set to DEBUG_FP). 
Other models then this multi-textured plane loose their texture in this 
- 2 windows, each has its own sceneview
- sceneview's frustums are set so that the multi-textured plane is only 
visible in 1 sceneview
- it doesn't matter if the other models are in the viewing frustum of 
each window

This is how I created the multi-textured plane in .osg file format:
1) export a textured plane from 3dsmax
2) added the "textureUnit 1" section by copying from the "textureUnit 0" 
3) added the "TexCoordArray 1" section by copying from the 
"TexCoordArray 0" section
3) added "TexEnv" section
I tried to change the renderbin but it does not change anything.

Can someone please take a look at the attached model? Or point me to a 
properly multi-textured model in .osg format?

pfew, it's driving me nuts.

Thanks a lot for your time!

Btw I'm now using osg 2.1.11 on WindowsXP, Visual Studio 2005 SP1

Robert Osfield wrote:
> On 9/20/07, Raymond de Vries <reedev at xs4all.nl> wrote:
>> I know, it sounds that I'm doing strange things. But the opposite is
>> true. Well, I am stripping everything and see where it is. Eventually it
>> will be something small & stupid, as always ;-)
> I'm afraid your set up is novel enough that others will only be clutch
> at straws at what the issue.  One of the reasons for the new osgViewer
> library is to pull a whole range of disparate usage models together
> under one family of classes to avoid the issues of users rolling a lot
> of functionality on their own as its almost impossible to remotely
> support such bespoke configurations.
> The OSG does support multiple graphics context just fine, but your
> have to be careful about management of threads, contextIDs.  In the
> case of 2.x it is more robust than ever in multi-threaded
> multi-context role, and with osgViewer the vast majority of the
> complexity of supporting these configurations is wrapped for you.
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: checkerboard.png
Type: image/png
Size: 659 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070921/2ce0568b/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Type: image/jpeg
Size: 7795 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070921/2ce0568b/attachment-0003.jpeg>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: MultiTexturedOSG.osg
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070921/2ce0568b/attachment-0002.asc>

More information about the osg-users mailing list