Hack hackity hack... I mean fixed water-fog sign-error when cam approaches 0 z when using shaders.
This commit is contained in:
@@ -32,7 +32,7 @@ vec4 applyWaterFog(vec4 color)
|
|||||||
float depth = length(getPositionEye() - int_v);
|
float depth = length(getPositionEye() - int_v);
|
||||||
|
|
||||||
//get "thickness" of water
|
//get "thickness" of water
|
||||||
float l = max(depth, 0.1);
|
float l = min(max(depth, 0.1),50.0);
|
||||||
|
|
||||||
float kd = waterFogDensity;
|
float kd = waterFogDensity;
|
||||||
float ks = waterFogKS;
|
float ks = waterFogKS;
|
||||||
|
|||||||
@@ -298,6 +298,11 @@ void LLWaterParamManager::update(LLViewerCamera * cam)
|
|||||||
|
|
||||||
mWaterPlane = LLVector4(enorm.v[0], enorm.v[1], enorm.v[2], -ep.dot(enorm));
|
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;
|
LLVector3 sunMoonDir;
|
||||||
if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS)
|
if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user