Hi Cory,
I can't spot any errors in your code. Multi-texturing is normally as
easy as doing single texturing - all your do is increment the texture
unit number when you set up the StateSet. As to what might be wrong
with your set up I have clue.
As a general note for doing terrain work I recommend use a TexGenNode
set up with eye linear. See the src/osgSim/OverlayNodea as an example
-its more complex than you need as it renders a subgaph to a texture
then drapes this over the terrain, but the final texturing set up will
be similar to your needs.
Robert.
On 1/23/07, Weber, Cory C. <[EMAIL PROTECTED]> wrote:
To the Users:
I have looked at the osgmultitexture example and the osg shadow texture
example and Im still unsure how to successfully take a second texture and
drape/ overlay it onto an existing texture. Here is my code: but it I'm only
getting the existing texture viewable and not the decal.... can someone
point me in a direction that doesn't lead me to writing a shader .
Thanks,
CW
Cory C Weber
Visual Spatial Technician
Environmental Science Division
Argonne National Laboratory
9700 South Cass Avenue
Argonne, IL 60439
[EMAIL PROTECTED]
630-252-7498
osg::ref_ptr<osg::StateSet>regroundss =
terrain.get()->getOrCreateStateSet();
osg::ref_ptr<osg::Texture2D>tex = new osg::Texture2D;
tex->setImage(osgDB::readImageFile
("T:\\Visualization\\GraphicsData\\OtherData\\testmark.rgba"));
tex->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);
tex->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);
tex->setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_BORDER);
tex->setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_BORDER);
regroundss->setTextureAttributeAndModes(1,tex.get(),
osg::StateAttribute::ON);
osg::TexGen* texgen = new osg::TexGen;
texgen->setMode(osg::TexGen::EYE_LINEAR);
osg::TexEnv* texenv = new osg::TexEnv;
texenv->setMode(osg::TexEnv::BLEND);
texenv->setColor(osg::Vec4(1.0,1.0,1.0,1.0));
regroundss->setTextureAttributeAndModes(1,texgen,osg::StateAttribute::ON);
regroundss->setTextureAttribute(1,texenv);
terrain.get()->setStateSet(regroundss.get());
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/