mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 21:09:45 +00:00
Reduce size of water plane and increase subdivisions (Fixes #969)
This commit is contained in:
parent
e712b0353b
commit
dac1290597
3 changed files with 10 additions and 12 deletions
|
@ -409,6 +409,7 @@ void RenderingManager::update (float duration, bool paused)
|
||||||
|
|
||||||
mSkyManager->setGlare(mOcclusionQuery->getSunVisibility());
|
mSkyManager->setGlare(mOcclusionQuery->getSunVisibility());
|
||||||
|
|
||||||
|
mWater->changeCell(player.getCell()->getCell());
|
||||||
|
|
||||||
mWater->updateUnderwater(world->isUnderwater(player.getCell(), cam));
|
mWater->updateUnderwater(world->isUnderwater(player.getCell(), cam));
|
||||||
|
|
||||||
|
|
|
@ -210,10 +210,10 @@ Water::Water (Ogre::Camera *camera, RenderingManager* rend) :
|
||||||
|
|
||||||
mWaterPlane = Plane(Vector3::UNIT_Z, 0);
|
mWaterPlane = Plane(Vector3::UNIT_Z, 0);
|
||||||
|
|
||||||
int waterScale = 300;
|
int waterScale = 30;
|
||||||
|
|
||||||
MeshManager::getSingleton().createPlane("water", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, mWaterPlane,
|
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 = mSceneMgr->createEntity("water");
|
||||||
mWater->setVisibilityFlags(RV_Water);
|
mWater->setVisibilityFlags(RV_Water);
|
||||||
|
@ -305,11 +305,7 @@ Water::~Water()
|
||||||
|
|
||||||
void Water::changeCell(const ESM::Cell* cell)
|
void Water::changeCell(const ESM::Cell* cell)
|
||||||
{
|
{
|
||||||
mTop = cell->mWater;
|
if(cell->isExterior())
|
||||||
|
|
||||||
setHeight(mTop);
|
|
||||||
|
|
||||||
if(!(cell->mData.mFlags & cell->Interior))
|
|
||||||
mWaterNode->setPosition(getSceneNodeCoordinates(cell->mData.mX, cell->mData.mY));
|
mWaterNode->setPosition(getSceneNodeCoordinates(cell->mData.mX, cell->mData.mY));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,8 +71,6 @@
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix)
|
shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix)
|
||||||
shVertexInput(float2, uv0)
|
|
||||||
shOutput(float2, UV)
|
|
||||||
|
|
||||||
shOutput(float3, screenCoordsPassthrough)
|
shOutput(float3, screenCoordsPassthrough)
|
||||||
shOutput(float4, position)
|
shOutput(float4, position)
|
||||||
|
@ -98,7 +96,6 @@
|
||||||
SH_START_PROGRAM
|
SH_START_PROGRAM
|
||||||
{
|
{
|
||||||
shOutputPosition = shMatrixMult(wvp, shInputPosition);
|
shOutputPosition = shMatrixMult(wvp, shInputPosition);
|
||||||
UV = uv0;
|
|
||||||
|
|
||||||
|
|
||||||
#if !SH_GLSL
|
#if !SH_GLSL
|
||||||
|
@ -187,7 +184,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
shInput(float2, UV)
|
|
||||||
shInput(float3, screenCoordsPassthrough)
|
shInput(float3, screenCoordsPassthrough)
|
||||||
shInput(float4, position)
|
shInput(float4, position)
|
||||||
shInput(float, depthPassthrough)
|
shInput(float, depthPassthrough)
|
||||||
|
@ -206,9 +202,10 @@
|
||||||
shSampler2D(depthMap)
|
shSampler2D(depthMap)
|
||||||
shSampler2D(normalMap)
|
shSampler2D(normalMap)
|
||||||
|
|
||||||
|
shUniform(float4x4, wMat) @shAutoConstant(wMat, world_matrix)
|
||||||
|
|
||||||
#if RIPPLES
|
#if RIPPLES
|
||||||
shSampler2D(rippleNormalMap)
|
shSampler2D(rippleNormalMap)
|
||||||
shUniform(float4x4, wMat) @shAutoConstant(wMat, world_matrix)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
shUniform(float3, windDir_windSpeed) @shSharedParameter(windDir_windSpeed)
|
shUniform(float3, windDir_windSpeed) @shSharedParameter(windDir_windSpeed)
|
||||||
|
@ -251,6 +248,10 @@
|
||||||
|
|
||||||
SH_START_PROGRAM
|
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
|
#if SHADOWS
|
||||||
float shadow = depthShadowPCF (shadowMap0, lightSpacePos0, invShadowmapSize0);
|
float shadow = depthShadowPCF (shadowMap0, lightSpacePos0, invShadowmapSize0);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue