diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 117830c09..ec5398309 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1272,8 +1272,7 @@ void Animation::addEffect(const std::string &model, int effectId, bool loop, con else params.mObjects = NifOgre::Loader::createObjects(mSkelBase, bonename, "", mInsert, model); - // TODO: turn off shadow casting - setRenderProperties(params.mObjects, RV_Misc, + setRenderProperties(params.mObjects, RV_Effects, RQG_Main, RQG_Alpha, 0.f, false, NULL); params.mLoop = loop; diff --git a/apps/openmw/mwrender/effectmanager.cpp b/apps/openmw/mwrender/effectmanager.cpp index a48dea8d5..503a0223e 100644 --- a/apps/openmw/mwrender/effectmanager.cpp +++ b/apps/openmw/mwrender/effectmanager.cpp @@ -25,8 +25,7 @@ void EffectManager::addEffect(const std::string &model, std::string textureOverr NifOgre::ObjectScenePtr scene = NifOgre::Loader::createObjects(sceneNode, model); - // TODO: turn off shadow casting - MWRender::Animation::setRenderProperties(scene, RV_Misc, + MWRender::Animation::setRenderProperties(scene, RV_Effects, RQG_Main, RQG_Alpha, 0.f, false, NULL); for(size_t i = 0;i < scene->mControllers.size();i++) diff --git a/apps/openmw/mwrender/refraction.cpp b/apps/openmw/mwrender/refraction.cpp index 164380866..6cc49089a 100644 --- a/apps/openmw/mwrender/refraction.cpp +++ b/apps/openmw/mwrender/refraction.cpp @@ -33,7 +33,7 @@ namespace MWRender Ogre::Viewport* vp = mRenderTarget->addViewport(mCamera); vp->setOverlaysEnabled(false); vp->setShadowsEnabled(false); - vp->setVisibilityMask(RV_Actors + RV_Misc + RV_Statics + RV_StaticsSmall + RV_Terrain + RV_Sky + RV_FirstPerson); + vp->setVisibilityMask(RV_Refraction); vp->setMaterialScheme("water_refraction"); vp->setBackgroundColour (Ogre::ColourValue(0.090195, 0.115685, 0.12745)); mRenderTarget->setAutoUpdated(true); diff --git a/apps/openmw/mwrender/renderconst.hpp b/apps/openmw/mwrender/renderconst.hpp index 44599ebee..4ac21ad51 100644 --- a/apps/openmw/mwrender/renderconst.hpp +++ b/apps/openmw/mwrender/renderconst.hpp @@ -30,39 +30,44 @@ enum RenderQueueGroups enum VisibilityFlags { // Terrain - RV_Terrain = 1, + RV_Terrain = (1<<0), // Statics (e.g. trees, houses) - RV_Statics = 2, + RV_Statics = (1<<1), // Small statics - RV_StaticsSmall = 4, + RV_StaticsSmall = (1<<2), // Water - RV_Water = 8, + RV_Water = (1<<3), // Actors (npcs, creatures) - RV_Actors = 16, + RV_Actors = (1<<4), // Misc objects (containers, dynamic objects) - RV_Misc = 32, + RV_Misc = (1<<5), - RV_Sky = 64, + // VFX, don't appear on map and don't cast shadows + RV_Effects = (1<<6), + + RV_Sky = (1<<7), // not visible in reflection - RV_NoReflection = 128, + RV_NoReflection = (1<<8), - RV_OcclusionQuery = 256, + RV_OcclusionQuery = (1<<9), - RV_Debug = 512, + RV_Debug = (1<<10), // overlays, we only want these on the main render target - RV_Overlay = 1024, + RV_Overlay = (1<<11), // First person meshes do not cast shadows - RV_FirstPerson = 2048, + RV_FirstPerson = (1<<12), + + RV_Map = RV_Terrain + RV_Statics + RV_StaticsSmall + RV_Misc + RV_Water, - RV_Map = RV_Terrain + RV_Statics + RV_StaticsSmall + RV_Misc + RV_Water + RV_Refraction = RV_Actors + RV_Misc + RV_Statics + RV_StaticsSmall + RV_Terrain + RV_Effects + RV_Sky + RV_FirstPerson }; } diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 9960b7b21..44e184269 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -420,6 +420,7 @@ void Water::applyVisibilityMask() mVisibilityFlags = RV_Terrain * Settings::Manager::getBool("reflect terrain", "Water") + (RV_Statics + RV_StaticsSmall + RV_Misc) * Settings::Manager::getBool("reflect statics", "Water") + RV_Actors * Settings::Manager::getBool("reflect actors", "Water") + + RV_Effects + RV_Sky; if (mReflection) diff --git a/apps/openmw/mwworld/projectilemanager.cpp b/apps/openmw/mwworld/projectilemanager.cpp index 41fbfea9f..7af51fd28 100644 --- a/apps/openmw/mwworld/projectilemanager.cpp +++ b/apps/openmw/mwworld/projectilemanager.cpp @@ -44,7 +44,7 @@ namespace MWWorld state.mObject->mControllers[i].setSource(Ogre::SharedPtr (new MWRender::EffectAnimationTime())); } - MWRender::Animation::setRenderProperties(state.mObject, MWRender::RV_Misc, + MWRender::Animation::setRenderProperties(state.mObject, MWRender::RV_Effects, MWRender::RQG_Main, MWRender::RQG_Alpha, 0.f, false, NULL); }