diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index fe685f97c..e479119ee 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -173,7 +173,7 @@ osg::ref_ptr 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 stateset = new osg::StateSet; diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index dcf4406bb..b0fe98565 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -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"); diff --git a/apps/openmw/mwrender/vismask.hpp b/apps/openmw/mwrender/vismask.hpp index fc63cddbb..7faae4602 100644 --- a/apps/openmw/mwrender/vismask.hpp +++ b/apps/openmw/mwrender/vismask.hpp @@ -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 }; diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index af9fae04a..c090dfbfe 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -301,7 +301,6 @@ osg::ref_ptr 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 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);