Use simple water for the local map

openmw-37
scrawl 9 years ago
parent 09631385c3
commit 6ba9f561ea

@ -173,7 +173,7 @@ osg::ref_ptr<osg::Camera> LocalMap::createOrthographicCamera(float x, float y, f
camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
camera->setRenderOrder(osg::Camera::PRE_RENDER);
camera->setCullMask(Mask_Scene|Mask_Water|Mask_Terrain);
camera->setCullMask(Mask_Scene|Mask_SimpleWater|Mask_Terrain);
camera->setNodeMask(Mask_RenderToTexture);
osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet;

@ -191,7 +191,7 @@ namespace MWRender
mViewer->getCamera()->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
mViewer->getCamera()->setCullingMode(cullingMode);
mViewer->getCamera()->setCullMask(~(Mask_UpdateVisitor));
mViewer->getCamera()->setCullMask(~(Mask_UpdateVisitor|Mask_SimpleWater));
mNearClip = Settings::Manager::getFloat("near clip", "Camera");
mViewDistance = Settings::Manager::getFloat("viewing distance", "Camera");

@ -16,18 +16,19 @@ namespace MWRender
Mask_Player = (1<<4),
Mask_Sky = (1<<5),
Mask_Water = (1<<6),
Mask_Terrain = (1<<7),
Mask_FirstPerson = (1<<8),
Mask_SimpleWater = (1<<7),
Mask_Terrain = (1<<8),
Mask_FirstPerson = (1<<9),
// top level masks
Mask_Scene = (1<<9),
Mask_GUI = (1<<10),
Mask_Scene = (1<<10),
Mask_GUI = (1<<11),
// Set on a Geode
Mask_ParticleSystem = (1<<11),
Mask_ParticleSystem = (1<<12),
// Set on cameras within the main scene graph
Mask_RenderToTexture = (1<<12)
Mask_RenderToTexture = (1<<13)
// reserved: (1<<16) for SceneUtil::Mask_Lit
};

@ -301,7 +301,6 @@ osg::ref_ptr<osg::Image> readPngImage (const std::string& file)
}
Water::Water(osg::Group *parent, osg::Group* sceneRoot, Resource::ResourceSystem *resourceSystem, osgUtil::IncrementalCompileOperation *ico,
const MWWorld::Fallback* fallback, const std::string& resourcePath)
: mParent(parent)
@ -319,16 +318,18 @@ Water::Water(osg::Group *parent, osg::Group* sceneRoot, Resource::ResourceSystem
geode->addDrawable(waterGeom);
geode->setNodeMask(Mask_Water);
// TODO: node mask to use simple water for local map
if (ico)
ico->add(geode);
//createSimpleWaterStateSet(mResourceSystem, geode);
mWaterNode = new osg::PositionAttitudeTransform;
mWaterNode->addChild(geode);
// simple water fallback for the local map
osg::ref_ptr<osg::Geode> geode2 (osg::clone(geode.get(), osg::CopyOp::DEEP_COPY_NODES));
createSimpleWaterStateSet(mResourceSystem, geode2);
geode2->setNodeMask(Mask_SimpleWater);
mWaterNode->addChild(geode2);
mSceneRoot->addChild(mWaterNode);
setHeight(mTop);

Loading…
Cancel
Save