> Disable back face culling.
>
Thank you, Robert.
This works, though I had to search a while where to set this:
In the code of ShadowMap, the following is set:
osg::ref_ptr<osg::CullFace> cull_face = new osg::CullFace;
cull_face->setMode(osg::CullFace::FRONT);
stateset->setAttribute(cull_face.get(),
osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
stateset->setMode(GL_CULL_FACE, osg::StateAttribute::ON |
osg::StateAttribute::OVERRIDE);
I simiply disabled this, and got my shadows.
The polygon-offset is hardwired into ShadowMap, too:
float factor = 5.0f;
float units = 1.0f;
osg::ref_ptr<osg::PolygonOffset> polygon_offset = new
osg::PolygonOffset;
polygon_offset->setFactor(factor);
polygon_offset->setUnits(units);
stateset->setAttribute(polygon_offset.get(),
osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
I get good results with the values shown above for factor and units,
though now (as a drawback) there are small areas that shoud have a
shadow and haven“t.
The issue that objects without a texture do not render correctly is not
fully solved: Those objects now seem a bit transparent. Assigning a real
white texture solves that (though this is a waste of texture memory).
Regards,
Andreas
> Robert.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org