actorid
scrawl 12 years ago
parent 359ae06fcf
commit f1d35b73b8

@ -117,9 +117,6 @@ namespace MWRender
int mCellX, mCellY;
Ogre::AxisAlignedBox mBounds;
std::string mInteriorName;
// maps texture name to according camera settings
std::map<Ogre::RenderTarget*, Ogre::Vector3> mCameraSettings;
};
}

@ -33,7 +33,7 @@ namespace MWRender
vp->setShadowsEnabled(false);
vp->setVisibilityMask(RV_Actors + RV_Misc + RV_Statics + RV_StaticsSmall + RV_Terrain + RV_Sky);
vp->setMaterialScheme("water_refraction");
vp->setBackgroundColour (Ogre::ColourValue(0.180, 0.235, 0.22352));
vp->setBackgroundColour (Ogre::ColourValue(0.18039, 0.23137, 0.25490));
mRenderTarget->setAutoUpdated(true);
mRenderTarget->addListener(this);
}

@ -121,9 +121,6 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
//mRendering.getScene()->setCameraRelativeRendering(true);
// disable unsupported effects
//const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities();
if (!waterShaderSupported())
Settings::Manager::setBool("shader", "Water", false);
if (!Settings::Manager::getBool("shaders", "Objects"))
Settings::Manager::setBool("enabled", "Shadows", false);
@ -504,9 +501,6 @@ void RenderingManager::configureFog(MWWorld::Ptr::CellStore &mCell)
color.setAsABGR (mCell.mCell->mAmbi.mFog);
configureFog(mCell.mCell->mAmbi.mFogDensity, color);
//if (mWater)
// mWater->setViewportBackground (Ogre::ColourValue(0.8f, 0.9f, 1.0f));
}
void RenderingManager::configureFog(const float density, const Ogre::ColourValue& colour)
@ -854,14 +848,6 @@ void RenderingManager::windowClosed(Ogre::RenderWindow* rw)
Ogre::Root::getSingleton ().queueEndRendering ();
}
bool RenderingManager::waterShaderSupported()
{
//const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities();
//if (caps->getNumMultiRenderTargets() < 2 || !Settings::Manager::getBool("shaders", "Objects"))
//return false;
return true;
}
void RenderingManager::applyCompositors()
{
}

@ -184,8 +184,6 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList
Ogre::Viewport* getViewport() { return mRendering.getViewport(); }
static bool waterShaderSupported();
void getInteriorMapPosition (Ogre::Vector2 position, float& nX, float& nY, int &x, int& y);
///< see MWRender::LocalMap::getInteriorMapPosition

@ -119,10 +119,6 @@ namespace MWRender
shadowTex->setProperty ("content_type", sh::makeProperty<sh::StringValue> (new sh::StringValue("shadow")));
}
// caustics
sh::MaterialInstanceTextureUnit* caustics = p->createTextureUnit ("causticMap");
caustics->setProperty ("direct_texture", sh::makeProperty<sh::StringValue> (new sh::StringValue("water_nm.png")));
p->mShaderProperties.setProperty ("shadowtexture_offset", sh::makeProperty<sh::StringValue>(new sh::StringValue(
Ogre::StringConverter::toString(numBlendTextures + numLayers + 2))));
@ -156,8 +152,6 @@ namespace MWRender
// shadow
--freeTextureUnits;
--freeTextureUnits; // caustics
// each layer needs 1.25 units (1xdiffusespec, 0.25xblend)
return static_cast<Ogre::uint8>(freeTextureUnits / (1.25f));
}

@ -210,6 +210,7 @@ Water::Water (Ogre::Camera *camera, RenderingManager* rend) :
mWater = mSceneMgr->createEntity("water");
mWater->setVisibilityFlags(RV_Water);
mWater->setCastShadows(false);
mWater->setRenderQueueGroup(RQG_Alpha);
mWaterNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
@ -380,6 +381,8 @@ void Water::applyRTT()
{
delete mReflection;
mReflection = NULL;
delete mRefraction;
mRefraction = NULL;
// Create rendertarget for reflection
//int rttsize = Settings::Manager::getInt("rtt size", "Water");
@ -389,16 +392,12 @@ void Water::applyRTT()
mReflection = new PlaneReflection(mSceneMgr, mSky);
mReflection->setParentCamera (mCamera);
mReflection->setHeight(mTop);
}
mWater->setRenderQueueGroup(RQG_Alpha);
delete mRefraction;
mRefraction = NULL;
if (Settings::Manager::getBool("refraction", "Water"))
{
mRefraction = new Refraction(mCamera);
mRefraction->setHeight(mTop);
if (Settings::Manager::getBool("refraction", "Water"))
{
mRefraction = new Refraction(mCamera);
mRefraction->setHeight(mTop);
}
}
updateVisible();

@ -260,13 +260,6 @@
float3 lightDir;
float3 diffuse = float3(0,0,0);
float d;
#if HAS_VERTEXCOLOR
// ambient vertex colour tracking, FFP behaviour
//float3 ambient = colourPassthrough.xyz * lightAmbient.xyz;
#else
//float3 ambient = materialAmbient.xyz * lightAmbient.xyz;
#endif
// shadows only for the first (directional) light
#if SHADOWS
@ -288,8 +281,6 @@
float3 caustics = float3(1,1,1);
#if (UNDERWATER) || (FOG)
float3 worldPos = shMatrixMult(worldMatrix, float4(objSpacePositionPassthrough,1)).xyz;
#endif
@ -311,10 +302,10 @@
#if @shIterator == 0
#if (SHADOWS || SHADOWS_PSSM)
diffuse += materialDiffuse.xyz * lightDiffuse@shIterator.xyz * (1.0 / ((lightAttenuation@shIterator.y) + (lightAttenuation@shIterator.z * d) + (lightAttenuation@shIterator.w * d * d))) * max(dot(normal, lightDir), 0) * shadow * caustics;
diffuse += materialDiffuse.xyz * lightDiffuse@shIterator.xyz * (1.0 / ((lightAttenuation@shIterator.y) + (lightAttenuation@shIterator.z * d) + (lightAttenuation@shIterator.w * d * d))) * max(dot(normal, lightDir), 0) * shadow;
#else
diffuse += materialDiffuse.xyz * lightDiffuse@shIterator.xyz * (1.0 / ((lightAttenuation@shIterator.y) + (lightAttenuation@shIterator.z * d) + (lightAttenuation@shIterator.w * d * d))) * max(dot(normal, lightDir), 0) * caustics;
diffuse += materialDiffuse.xyz * lightDiffuse@shIterator.xyz * (1.0 / ((lightAttenuation@shIterator.y) + (lightAttenuation@shIterator.z * d) + (lightAttenuation@shIterator.w * d * d))) * max(dot(normal, lightDir), 0);
#endif

@ -230,9 +230,6 @@
#endif
float3 caustics = float3(1,1,1);
#if UNDERWATER
float3 waterEyePos = intercept(worldPos, cameraPos.xyz - worldPos, float3(0,0,1), waterLevel);
#endif
@ -312,10 +309,10 @@
#if @shIterator == 0
#if (SHADOWS || SHADOWS_PSSM)
diffuse += lightDiffuse@shIterator.xyz * (1.0 / ((lightAttenuation@shIterator.y) + (lightAttenuation@shIterator.z * d) + (lightAttenuation@shIterator.w * d * d))) * max(dot(normal, lightDir), 0) * shadow * caustics;
diffuse += lightDiffuse@shIterator.xyz * (1.0 / ((lightAttenuation@shIterator.y) + (lightAttenuation@shIterator.z * d) + (lightAttenuation@shIterator.w * d * d))) * max(dot(normal, lightDir), 0) * shadow;
#else
diffuse += lightDiffuse@shIterator.xyz * (1.0 / ((lightAttenuation@shIterator.y) + (lightAttenuation@shIterator.z * d) + (lightAttenuation@shIterator.w * d * d))) * max(dot(normal, lightDir), 0) * caustics;
diffuse += lightDiffuse@shIterator.xyz * (1.0 / ((lightAttenuation@shIterator.y) + (lightAttenuation@shIterator.z * d) + (lightAttenuation@shIterator.w * d * d))) * max(dot(normal, lightDir), 0);
#endif

@ -94,7 +94,7 @@ fps = 0
crosshair = true
[Objects]
shaders = false
shaders = true
# Max. number of lights that affect objects. Setting to 1 will only reflect sunlight
# Note: has no effect when shaders are turned off
@ -127,9 +127,9 @@ fog end factor = 1.0
num lights = 8
[Water]
shader = false
shader = true
refraction = false
refraction = true
rtt size = 512
reflect terrain = true

Loading…
Cancel
Save