mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
Merge branch 'master' into nif-cleanup
This commit is contained in:
commit
cfa0519721
6 changed files with 21 additions and 11 deletions
|
@ -189,14 +189,10 @@ endif()
|
||||||
set(BOOST_COMPONENTS system filesystem program_options thread)
|
set(BOOST_COMPONENTS system filesystem program_options thread)
|
||||||
|
|
||||||
if (Boost_VERSION LESS 104900)
|
if (Boost_VERSION LESS 104900)
|
||||||
set(SHINY_USE_WAVE_SYSTEM_INSTALL TRUE)
|
set(SHINY_USE_WAVE_SYSTEM_INSTALL "TRUE")
|
||||||
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} wave)
|
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} wave)
|
||||||
else()
|
|
||||||
set(SHINY_USE_WAVE_SYSTEM_INSTALL FALSE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
MESSAGE(STATUS ${BOOST_COMPONENTS})
|
|
||||||
|
|
||||||
find_package(OGRE REQUIRED)
|
find_package(OGRE REQUIRED)
|
||||||
find_package(MyGUI REQUIRED)
|
find_package(MyGUI REQUIRED)
|
||||||
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||||
|
|
|
@ -368,6 +368,9 @@ void RenderingManager::configureFog(MWWorld::Ptr::CellStore &mCell)
|
||||||
color.setAsABGR (mCell.cell->ambi.fog);
|
color.setAsABGR (mCell.cell->ambi.fog);
|
||||||
|
|
||||||
configureFog(mCell.cell->ambi.fogDensity, color);
|
configureFog(mCell.cell->ambi.fogDensity, color);
|
||||||
|
|
||||||
|
if (mWater)
|
||||||
|
mWater->setViewportBackground (Ogre::ColourValue(0.8f, 0.9f, 1.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderingManager::configureFog(const float density, const Ogre::ColourValue& colour)
|
void RenderingManager::configureFog(const float density, const Ogre::ColourValue& colour)
|
||||||
|
@ -382,6 +385,9 @@ void RenderingManager::configureFog(const float density, const Ogre::ColourValue
|
||||||
mRendering.getCamera()->setFarClipDistance ( max / density );
|
mRendering.getCamera()->setFarClipDistance ( max / density );
|
||||||
mRendering.getViewport()->setBackgroundColour (colour);
|
mRendering.getViewport()->setBackgroundColour (colour);
|
||||||
|
|
||||||
|
if (mWater)
|
||||||
|
mWater->setViewportBackground (colour);
|
||||||
|
|
||||||
sh::Factory::getInstance ().setSharedParameter ("viewportBackground",
|
sh::Factory::getInstance ().setSharedParameter ("viewportBackground",
|
||||||
sh::makeProperty<sh::Vector3> (new sh::Vector3(colour.r, colour.g, colour.b)));
|
sh::makeProperty<sh::Vector3> (new sh::Vector3(colour.r, colour.g, colour.b)));
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ Water::Water (Ogre::Camera *camera, RenderingManager* rend, const ESM::Cell* cel
|
||||||
|
|
||||||
mWater->setMaterial(mMaterial);
|
mWater->setMaterial(mMaterial);
|
||||||
|
|
||||||
|
/*
|
||||||
Ogre::Entity* underwaterDome = mSceneManager->createEntity ("underwater_dome.mesh");
|
Ogre::Entity* underwaterDome = mSceneManager->createEntity ("underwater_dome.mesh");
|
||||||
underwaterDome->setRenderQueueGroup (RQG_UnderWater);
|
underwaterDome->setRenderQueueGroup (RQG_UnderWater);
|
||||||
mUnderwaterDome = mSceneManager->getRootSceneNode ()->createChildSceneNode ();
|
mUnderwaterDome = mSceneManager->getRootSceneNode ()->createChildSceneNode ();
|
||||||
|
@ -78,6 +79,7 @@ Water::Water (Ogre::Camera *camera, RenderingManager* rend, const ESM::Cell* cel
|
||||||
mUnderwaterDome->setScale(10000,10000,10000);
|
mUnderwaterDome->setScale(10000,10000,10000);
|
||||||
mUnderwaterDome->setVisible(false);
|
mUnderwaterDome->setVisible(false);
|
||||||
underwaterDome->setMaterialName("Underwater_Dome");
|
underwaterDome->setMaterialName("Underwater_Dome");
|
||||||
|
*/
|
||||||
|
|
||||||
mSceneManager->addRenderQueueListener(this);
|
mSceneManager->addRenderQueueListener(this);
|
||||||
|
|
||||||
|
@ -309,9 +311,11 @@ void Water::renderQueueEnded (Ogre::uint8 queueGroupId, const Ogre::String &invo
|
||||||
|
|
||||||
void Water::update(float dt)
|
void Water::update(float dt)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
Ogre::Vector3 pos = mCamera->getDerivedPosition ();
|
Ogre::Vector3 pos = mCamera->getDerivedPosition ();
|
||||||
pos.y = -mWaterPlane.d;
|
pos.y = -mWaterPlane.d;
|
||||||
mUnderwaterDome->setPosition (pos);
|
mUnderwaterDome->setPosition (pos);
|
||||||
|
*/
|
||||||
|
|
||||||
mWaterTimer += dt / 30.0 * MWBase::Environment::get().getWorld()->getTimeScaleFactor();
|
mWaterTimer += dt / 30.0 * MWBase::Environment::get().getWorld()->getTimeScaleFactor();
|
||||||
sh::Factory::getInstance ().setSharedParameter ("waterTimer", sh::makeProperty<sh::FloatValue>(new sh::FloatValue(mWaterTimer)));
|
sh::Factory::getInstance ().setSharedParameter ("waterTimer", sh::makeProperty<sh::FloatValue>(new sh::FloatValue(mWaterTimer)));
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace MWRender {
|
||||||
Ogre::SceneNode *mWaterNode;
|
Ogre::SceneNode *mWaterNode;
|
||||||
Ogre::Entity *mWater;
|
Ogre::Entity *mWater;
|
||||||
|
|
||||||
Ogre::SceneNode* mUnderwaterDome;
|
//Ogre::SceneNode* mUnderwaterDome;
|
||||||
|
|
||||||
bool mIsUnderwater;
|
bool mIsUnderwater;
|
||||||
bool mActive;
|
bool mActive;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
shSampler2D(diffuseMap)
|
shSampler2D(diffuseMap)
|
||||||
|
shSampler2D(alphaMap)
|
||||||
shInput(float2, UV)
|
shInput(float2, UV)
|
||||||
#if MRT
|
#if MRT
|
||||||
shDeclareMrtOutput(1)
|
shDeclareMrtOutput(1)
|
||||||
|
@ -36,17 +37,15 @@
|
||||||
|
|
||||||
shOutputColour(0) = float4(materialEmissive.xyz, 1) * tex;
|
shOutputColour(0) = float4(materialEmissive.xyz, 1) * tex;
|
||||||
|
|
||||||
// use a circle for the alpha (compute UV distance to center)
|
shOutputColour(0).a = shSample(alphaMap, UV).a * materialDiffuse.a;
|
||||||
// looks a bit bad because it's not filtered on the edges,
|
|
||||||
// but cheaper than a seperate alpha texture.
|
|
||||||
float sqrUVdist = pow(UV.x-0.5,2) + pow(UV.y-0.5, 2);
|
|
||||||
shOutputColour(0).a = materialDiffuse.a * (sqrUVdist >= 0.24 ? 0 : 1);
|
|
||||||
shOutputColour(0).rgb += (1-tex.a) * shOutputColour(0).a * atmosphereColour.rgb; //fill dark side of moon with atmosphereColour
|
shOutputColour(0).rgb += (1-tex.a) * shOutputColour(0).a * atmosphereColour.rgb; //fill dark side of moon with atmosphereColour
|
||||||
shOutputColour(0).rgb += (1-materialDiffuse.a) * atmosphereColour.rgb; //fade bump
|
shOutputColour(0).rgb += (1-materialDiffuse.a) * atmosphereColour.rgb; //fade bump
|
||||||
|
|
||||||
#if MRT
|
#if MRT
|
||||||
shOutputColour(1) = float4(1,1,1,1);
|
shOutputColour(1) = float4(1,1,1,1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,6 +15,11 @@ material openmw_moon
|
||||||
{
|
{
|
||||||
texture_alias $texture
|
texture_alias $texture
|
||||||
}
|
}
|
||||||
|
|
||||||
|
texture_unit alphaMap
|
||||||
|
{
|
||||||
|
direct_texture textures\tx_secunda_full.dds
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue