Hi,
Im trying to get shadows and SPHERE_MAP effect working together without 
success. Infact if i even just  apply a texture to a osg node i just get pure 
black. 

What do I have to do to get textures working with osg nodes with shadows and 
will this work with SPHERE_MAP effect?


heres the code im using to apply a texture to a osg node
... 


Code:
// set up the texture of the base.
        osg::StateSet* stateset = new osg::StateSet();
        osg::Image* image = osgDB::readImageFile("Images/panelForeground.png");
        if (image)
        {
            osg::Texture2D* texture = new osg::Texture2D;
            texture->setImage(image);
            
stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON);
        }

        node->setStateSet( stateset );



all i get is black and can not see the model.

heres what im using to add a SPHERE_MAP effect, again i just get black.


Code:
osg::StateSet* stateset = new osg::StateSet();
        osg::Image* image = osgDB::readImageFile("Images/panelForeground.png");
        if (image)
        {
            osg::Texture2D* texture = new osg::Texture2D;
            texture->setImage(image);
            
stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON);
        }

        borderNode->setStateSet( stateset );






Thank you!

Cheers,
Paul

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





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

Reply via email to