Hi,
i would like to apply 2 textures on the same quad, 
2nd texture is type format of ".inta" with alfa channel. 
Could you help me how o set these textures to correct mixing on the same quat?

First image is my solution of correct texturing on the quad.
[Image: http://www.imgshare.cz/images/multiplete.jpg ]

Second image is screenshot from viewer.
[Image: http://www.imgshare.cz/images/multipeie.jpg ]

osg code:
create - screenQuad;
init - sourceSceneTexture (osg::Camera::PRE_RENDER)
init - mirrormask1 (.inta file) 

osg::StateSet *quadState = quadGeode->getOrCreateStateSet();
quadState->setTextureAttributeAndModes(0, sourceSceneTexture, 
osg::StateAttribute::ON|osg::StateAttribute::PROTECTED);

osg::TexGen* texgen = new osg::TexGen;
texgen->setMode(osg::TexGen::SPHERE_MAP);

osg::TexEnv* texenv = new osg::TexEnv;
texenv->setMode(osg::TexEnv::BLEND);
texenv->setColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
quadState->setTextureAttributeAndModes(1, mirrormask1, osg::StateAttribute::ON);
quadState->setTextureAttributeAndModes(1, texgen, osg::StateAttribute::ON);
quadState->setTextureAttribute(1,texenv);

//prerender camera 
osg::ref_ptr<osg::Camera> textureCamera = new osg::Camera;
...
//ortho camera 
osg::ref_ptr<osg::Camera> orthoCamera = new osg::Camera;
orthoCamera->setProjectionMatrix(osg::Matrix::ortho2D(0, 
ms_setupview.vi[i].width, 0, ms_setupview.vi[i].height));
orthoCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
orthoCamera->setViewMatrix(osg::Matrix::identity());
orthoCamera->setViewport( ... );
orthoCamera->setRenderOrder(osg::Camera::POST_RENDER);

Thank you!

Cheers,
Petr

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=37197#37197





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to