3 #include "LightShaftGeometry.h"
24 virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
26 osgUtil::CullVisitor* cv =
dynamic_cast<osgUtil::CullVisitor*
>(nv);
27 osg::ref_ptr<osg::Geode> geometry =
dynamic_cast<osg::Geode*
> (node);
31 osg::Matrixd view(cv->getCurrentCamera()->getViewMatrix());
32 osg::Matrixd invViewMatrix = osg::Matrixd::inverse(view);
33 osg::Matrixd model(*cv->getModelViewMatrix());
34 model = model*invViewMatrix;
35 osg::Matrixd proj(cv->getCurrentCamera()->getProjectionMatrix());
37 geometry->getOrCreateStateSet()->getUniform(
"ModelMatrix")->set(model);
41 geometry->getOrCreateStateSet()->addUniform(
new osg::Uniform(
"v3LightPos", Scene::m_skydome->GetLightPosition()));
42 Scene::m_skydome->SetupUniform(geometry.get()->getOrCreateStateSet());
43 geometry->getOrCreateStateSet()->addUniform(
new osg::Uniform(
"color_tex", 0));
45 std::cout << std::endl << std::endl <<
"ath callback" << std::endl << std::endl ;
49 geometry->getOrCreateStateSet()->getUniform(
"light_mv_matrix")->set(
Scene::GetLightCamera()->getViewMatrix());
93 osg::ref_ptr<osg::Texture2D> fbo_lightshaft1;
94 osg::ref_ptr<osg::Texture2D> fbo_lightshaft2;
96 osg::ref_ptr<osg::Texture2D> fbo_lightshaft_d;
97 osg::Camera* camera_lightshaft;