hi again,
is there a possibility to get the nr of CulledNodes for statistics and
performance measurement in OpenSG 2.0?
in OpenSG 2.0 we did it like that:
SimpleStatisticsForegroundPtr sf = SimpleStatisticsForeground::create();
sf->addElement(DrawActionBase::statCulledNodes,
"%d Nodes culled");
And more important:
How does shadowing in OpenSG 2.0 works, or how can i adapt the old viewport
based behaviour to the new one?
this is how i create a shadowViewport in OpenSG 1.8
ShadowViewportPtr CAVESceneManager::CreateMonoShadowViewport(
PerspectiveCameraPtr camera, Pnt4f size, TextureBackgroundPtr bg,
NodePtr user, Pnt3f *vpproj)
{
// first create the decorator
ProjectionCameraDecoratorPtr camDec;
camDec=OSG::ProjectionCameraDecorator::create();
beginEditCP(camDec);
camDec->setLeftEye(true);
camDec->setEyeSeparation(0);
camDec->setDecoratee(camera);
camDec->setUser(user);
camDec->getSurface().push_back(vpproj[0] * _scaleFactor);
camDec->getSurface().push_back(vpproj[1] * _scaleFactor);
camDec->getSurface().push_back(vpproj[2] * _scaleFactor);
camDec->getSurface().push_back(vpproj[3] * _scaleFactor);
endEditCP(camDec);
// then the viewport
printf("\n\nViewport with Shadow support created!\n\n");
ShadowViewportPtr svp = ShadowViewport::create();
beginEditCP(svp);
svp->setSize(size[0],size[1],size[2],size[3]);
svp->setCamera(camDec);
svp->setBackground(bg);
svp->setRoot(_internalRoot);
svp->getForegrounds().push_back(_foreground);
// shadow
svp->setOffFactor(4.0);
svp->setOffBias(8.0);
svp->setGlobalShadowIntensity(0.9);
svp->setMapSize(1024);
svp->setShadowMode(ShadowViewport::STD_SHADOW_MAP);
//svp->setShadowColor(Color4f(0.1,0.1,0.1,1.0));
svp->setShadowSmoothness(0.0);
endEditCP (svp);
return svp;
}
later i add it like this:
_win->addPort(vp); //WindowPtr _win;
of course light sources are also set to the svp.
Is there a similar possibility in OpenSG 2.0? As stated in a mail before
there is no ShadowViewport any more.
thx in advance :)
cheers
Georg
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users