mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
Merge remote branch 'scrawl/shadersystem'
This commit is contained in:
commit
a24e7c9de2
7 changed files with 22 additions and 12 deletions
|
@ -189,14 +189,10 @@ endif()
|
|||
set(BOOST_COMPONENTS system filesystem program_options thread)
|
||||
|
||||
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)
|
||||
else()
|
||||
set(SHINY_USE_WAVE_SYSTEM_INSTALL FALSE)
|
||||
endif()
|
||||
|
||||
MESSAGE(STATUS ${BOOST_COMPONENTS})
|
||||
|
||||
find_package(OGRE REQUIRED)
|
||||
find_package(MyGUI REQUIRED)
|
||||
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
|
|
|
@ -368,6 +368,9 @@ void RenderingManager::configureFog(MWWorld::Ptr::CellStore &mCell)
|
|||
color.setAsABGR (mCell.cell->ambi.fog);
|
||||
|
||||
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)
|
||||
|
@ -382,6 +385,9 @@ void RenderingManager::configureFog(const float density, const Ogre::ColourValue
|
|||
mRendering.getCamera()->setFarClipDistance ( max / density );
|
||||
mRendering.getViewport()->setBackgroundColour (colour);
|
||||
|
||||
if (mWater)
|
||||
mWater->setViewportBackground (colour);
|
||||
|
||||
sh::Factory::getInstance ().setSharedParameter ("viewportBackground",
|
||||
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);
|
||||
|
||||
/*
|
||||
Ogre::Entity* underwaterDome = mSceneManager->createEntity ("underwater_dome.mesh");
|
||||
underwaterDome->setRenderQueueGroup (RQG_UnderWater);
|
||||
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->setVisible(false);
|
||||
underwaterDome->setMaterialName("Underwater_Dome");
|
||||
*/
|
||||
|
||||
mSceneManager->addRenderQueueListener(this);
|
||||
|
||||
|
@ -309,9 +311,11 @@ void Water::renderQueueEnded (Ogre::uint8 queueGroupId, const Ogre::String &invo
|
|||
|
||||
void Water::update(float dt)
|
||||
{
|
||||
/*
|
||||
Ogre::Vector3 pos = mCamera->getDerivedPosition ();
|
||||
pos.y = -mWaterPlane.d;
|
||||
mUnderwaterDome->setPosition (pos);
|
||||
*/
|
||||
|
||||
mWaterTimer += dt / 30.0 * MWBase::Environment::get().getWorld()->getTimeScaleFactor();
|
||||
sh::Factory::getInstance ().setSharedParameter ("waterTimer", sh::makeProperty<sh::FloatValue>(new sh::FloatValue(mWaterTimer)));
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace MWRender {
|
|||
Ogre::SceneNode *mWaterNode;
|
||||
Ogre::Entity *mWater;
|
||||
|
||||
Ogre::SceneNode* mUnderwaterDome;
|
||||
//Ogre::SceneNode* mUnderwaterDome;
|
||||
|
||||
bool mIsUnderwater;
|
||||
bool mActive;
|
||||
|
|
2
extern/shiny
vendored
2
extern/shiny
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 41245d1361bc0242e5d2c2313caffb711207e5fc
|
||||
Subproject commit 73ddc737ce6334b264649fd4b0a16109fd8b8a99
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
SH_BEGIN_PROGRAM
|
||||
shSampler2D(diffuseMap)
|
||||
shSampler2D(alphaMap)
|
||||
shInput(float2, UV)
|
||||
#if MRT
|
||||
shDeclareMrtOutput(1)
|
||||
|
@ -36,17 +37,15 @@
|
|||
|
||||
shOutputColour(0) = float4(materialEmissive.xyz, 1) * tex;
|
||||
|
||||
// use a circle for the alpha (compute UV distance to center)
|
||||
// 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).a = shSample(alphaMap, UV).a * materialDiffuse.a;
|
||||
|
||||
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
|
||||
|
||||
#if MRT
|
||||
shOutputColour(1) = float4(1,1,1,1);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,6 +15,11 @@ material openmw_moon
|
|||
{
|
||||
texture_alias $texture
|
||||
}
|
||||
|
||||
texture_unit alphaMap
|
||||
{
|
||||
direct_texture textures\tx_secunda_full.dds
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue