Hack hackity hack... I mean fixed water-fog sign-error when cam approaches 0 z when using shaders.

This commit is contained in:
Shyotl
2011-07-10 19:38:43 -05:00
committed by Siana Gearz
parent 47b7fdb5e0
commit c320429f41
2 changed files with 6 additions and 1 deletions

View File

@@ -32,7 +32,7 @@ vec4 applyWaterFog(vec4 color)
float depth = length(getPositionEye() - int_v);
//get "thickness" of water
float l = max(depth, 0.1);
float l = min(max(depth, 0.1),50.0);
float kd = waterFogDensity;
float ks = waterFogKS;

View File

@@ -298,6 +298,11 @@ void LLWaterParamManager::update(LLViewerCamera * cam)
mWaterPlane = LLVector4(enorm.v[0], enorm.v[1], enorm.v[2], -ep.dot(enorm));
if((mWaterPlane.mV[3] >= 0.f) == LLViewerCamera::getInstance()->cameraUnderWater()) //Sign borkage..
{
mWaterPlane.scaleVec(LLVector4(-1.f,-1.f,-1.f,-1.f));
}
LLVector3 sunMoonDir;
if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS)
{