Reduce size of water plane and increase subdivisions (Fixes #969)

openmw-35
scrawl 10 years ago
parent e712b0353b
commit dac1290597

@ -409,6 +409,7 @@ void RenderingManager::update (float duration, bool paused)
mSkyManager->setGlare(mOcclusionQuery->getSunVisibility());
mWater->changeCell(player.getCell()->getCell());
mWater->updateUnderwater(world->isUnderwater(player.getCell(), cam));

@ -210,10 +210,10 @@ Water::Water (Ogre::Camera *camera, RenderingManager* rend) :
mWaterPlane = Plane(Vector3::UNIT_Z, 0);
int waterScale = 300;
int waterScale = 30;
MeshManager::getSingleton().createPlane("water", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, mWaterPlane,
CELL_SIZE*5*waterScale, CELL_SIZE*5*waterScale, 10, 10, true, 1, 3*waterScale,3*waterScale, Vector3::UNIT_Y);
CELL_SIZE*5*waterScale, CELL_SIZE*5*waterScale, 40, 40, true, 1, 3*waterScale,3*waterScale, Vector3::UNIT_Y);
mWater = mSceneMgr->createEntity("water");
mWater->setVisibilityFlags(RV_Water);
@ -305,11 +305,7 @@ Water::~Water()
void Water::changeCell(const ESM::Cell* cell)
{
mTop = cell->mWater;
setHeight(mTop);
if(!(cell->mData.mFlags & cell->Interior))
if(cell->isExterior())
mWaterNode->setPosition(getSceneNodeCoordinates(cell->mData.mX, cell->mData.mY));
}

@ -71,8 +71,6 @@
SH_BEGIN_PROGRAM
shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix)
shVertexInput(float2, uv0)
shOutput(float2, UV)
shOutput(float3, screenCoordsPassthrough)
shOutput(float4, position)
@ -98,7 +96,6 @@
SH_START_PROGRAM
{
shOutputPosition = shMatrixMult(wvp, shInputPosition);
UV = uv0;
#if !SH_GLSL
@ -187,7 +184,6 @@
}
SH_BEGIN_PROGRAM
shInput(float2, UV)
shInput(float3, screenCoordsPassthrough)
shInput(float4, position)
shInput(float, depthPassthrough)
@ -206,9 +202,10 @@
shSampler2D(depthMap)
shSampler2D(normalMap)
shUniform(float4x4, wMat) @shAutoConstant(wMat, world_matrix)
#if RIPPLES
shSampler2D(rippleNormalMap)
shUniform(float4x4, wMat) @shAutoConstant(wMat, world_matrix)
#endif
shUniform(float3, windDir_windSpeed) @shSharedParameter(windDir_windSpeed)
@ -251,6 +248,10 @@
SH_START_PROGRAM
{
float3 worldPos = shMatrixMult (wMat, position).xyz;
float2 UV = worldPos.xy / (8192.0*5.0) * 3.0;
UV.y *= -1.0;
#if SHADOWS
float shadow = depthShadowPCF (shadowMap0, lightSpacePos0, invShadowmapSize0);
#endif

Loading…
Cancel
Save