Hi all,
I'm pretty new to OSG and I'm having difficulties multitexturing a
heightfield.
Basically what I'm trying to do is lay a caustic pattern using an RGBA
png over a seabed texture on a heightfield.
I believe i've followed the proceedure correctly and from what I've read
it should be pretty easy, but at present only the base texture gets
rendered.
If anybody could cast their eye over the following code and tell me what
I'm doing wrong I would be most grateful.
Kim.
------------------------------------------------------------------------
---
osg::StateSet* stateSet = new osg::StateSet();
osg::TexEnv* texenv1 = new osg::TexEnv;
texenv1->setMode(osg::TexEnv::MODULATE);
stateSet->setTextureAttributeAndModes(0,textureMap,osg::StateAttribute::
ON);
stateSet->setTextureAttributeAndModes(0,texenv1,osg::StateAttribute::ON)
;
osg::TexGen* texgen = new osg::TexGen;
texgen->setMode(osg::TexGen::EYE_LINEAR);
osg::TexEnv* texenv2 = new osg::TexEnv;
texenv2->setMode(osg::TexEnv::DECAL);
stateSet->setTextureAttributeAndModes(1,overlay,osg::StateAttribute::ON)
;
stateSet->setTextureAttributeAndModes(1,texgen,osg::StateAttribute::ON);
stateSet->setTextureAttributeAndModes(1,texenv2,osg::StateAttribute::ON)
;
terrainGeode->setStateSet(stateSet);
*****************************************************************************************
To view the terms under which this email is distributed, please go to
http://www.hull.ac.uk/legal/email_disclaimer.html
*****************************************************************************************
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/