3 #include <osg/FrameBufferObject>
4 #include <osg/TextureCubeMap>
25 virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
27 osgUtil::CullVisitor* cv =
dynamic_cast<osgUtil::CullVisitor*
>(nv);
28 osg::ref_ptr<osg::Geode> geometry =
dynamic_cast<osg::Geode*
> (node);
32 osg::Matrixd view(cv->getCurrentCamera()->getViewMatrix());
33 osg::Matrixd invViewMatrix = osg::Matrixd::inverse(view);
34 osg::Matrixd model(*cv->getModelViewMatrix());
35 model = model*invViewMatrix;
36 osg::Matrixd proj(cv->getCurrentCamera()->getProjectionMatrix());
38 geometry->getOrCreateStateSet()->getUniform(
"ModelMatrix")->set(model);
39 geometry->getOrCreateStateSet()->getUniform(
"ViewMatrix")->set(view);
40 geometry->getOrCreateStateSet()->getUniform(
"ProjectionMatrix")->set(proj);
42 geometry->getOrCreateStateSet()->addUniform(
new osg::Uniform(
"v3LightPos", osgCloudyDay::Scene::m_skydome->GetLightPosition()));
43 osgCloudyDay::Scene::m_skydome->SetupUniform(geometry.get()->getOrCreateStateSet());
44 geometry->getOrCreateStateSet()->addUniform(
new osg::Uniform(
"color_tex", 0));
79 void AddObject(osg::ref_ptr<osg::Geode> geo);
81 osg::ref_ptr<osg::TextureCubeMap> fbo_plane_cube;
82 osg::ref_ptr<osg::TextureCubeMap> fbo_plane_cube_depth;
91 osg::Camera** camera_plane_cubemap;