diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl | 2 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 1 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/windlight/sunDiscV.glsl | 2 | ||||
-rw-r--r-- | indra/newview/lldrawpoolwater.cpp | 4 | ||||
-rw-r--r-- | indra/newview/lldrawpoolwater.h | 2 | ||||
-rw-r--r-- | indra/newview/lldrawpoolwlsky.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 1 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 6 | ||||
-rw-r--r-- | indra/newview/pipeline.h | 1 |
9 files changed, 19 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl index 5b4302e237..c67ed8e6d9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl @@ -37,7 +37,7 @@ void calcAtmospherics(vec3 eye_pos); void main() { //transform vertex - vec4 vert = vec4(position.xyz, 1.0); + vec4 vert = vec4(position.xyz - vec3(0, 0, 50), 1.0); vec4 pos = modelview_projection_matrix*vert; gl_Position = pos; diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 98c5030a04..aeec247514 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -167,6 +167,7 @@ void main() //mix with reflection // Note we actually want to use just df1, but multiplying by 0.999999 gets around an nvidia compiler bug + refcol.rgb = pow(refcol.rgb, vec3(0.45)); // boost the reflect color a little to get stars to show up SL-1475 color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); vec4 pos = vary_position; diff --git a/indra/newview/app_settings/shaders/class1/windlight/sunDiscV.glsl b/indra/newview/app_settings/shaders/class1/windlight/sunDiscV.glsl index 90acb5be9e..dd33a4be60 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/sunDiscV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/sunDiscV.glsl @@ -37,7 +37,7 @@ void calcAtmospherics(vec3 eye_pos); void main() { //transform vertex - vec4 vert = vec4(position.xyz, 1.0); + vec4 vert = vec4(position.xyz - vec3(0, 0, 50), 1.0); vec4 pos = modelview_projection_matrix*vert; gl_Position = pos; diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 7f1601e604..4dd0d3ec98 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -76,10 +76,10 @@ void LLDrawPoolWater::setTransparentTextures(const LLUUID& transparentTextureId, mWaterImagep[1]->addTextureStats(1024.f*1024.f); } -void LLDrawPoolWater::setOpaqueTexture() +void LLDrawPoolWater::setOpaqueTexture(const LLUUID& opaqueTextureId) { LLSettingsWater::ptr_t pwater = LLEnvironment::instance().getCurrentWater(); - mOpaqueWaterImagep = LLViewerTextureManager::getFetchedTexture(pwater->GetDefaultOpaqueTextureAssetId()); + mOpaqueWaterImagep = LLViewerTextureManager::getFetchedTexture(opaqueTextureId); mOpaqueWaterImagep->addTextureStats(1024.f*1024.f); } diff --git a/indra/newview/lldrawpoolwater.h b/indra/newview/lldrawpoolwater.h index 3c1587885e..f14ac1f6d2 100644 --- a/indra/newview/lldrawpoolwater.h +++ b/indra/newview/lldrawpoolwater.h @@ -83,7 +83,7 @@ public: void shade(); void setTransparentTextures(const LLUUID& transparentTextureId, const LLUUID& nextTransparentTextureId); - void setOpaqueTexture(); + void setOpaqueTexture(const LLUUID& opaqueTextureId); void setNormalMaps(const LLUUID& normalMapId, const LLUUID& nextNormalMapId); protected: diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 76c0bd5abf..455df837a9 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -329,6 +329,11 @@ void LLDrawPoolWLSky::renderStarsDeferred(void) const } gDeferredStarProgram.uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor); + + if (LLPipeline::sRenderingWaterReflection) + { + star_alpha = 1.0f; + } gDeferredStarProgram.uniform1f(sCustomAlpha, star_alpha); sStarTime = (F32)LLFrameTimer::getElapsedSeconds() * 0.5f; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index b16ba65c01..583adcb024 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -851,6 +851,7 @@ void LLSettingsVOWater::updateSettings() if (pwaterpool) { pwaterpool->setTransparentTextures(getTransparentTextureID(), getNextTransparentTextureID()); + pwaterpool->setOpaqueTexture(GetDefaultOpaqueTextureAssetId()); pwaterpool->setNormalMaps(getNormalMapID(), getNextNormalMapID()); } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1522403990..c722c442f1 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -339,6 +339,7 @@ bool LLPipeline::sRenderFrameTest = false; bool LLPipeline::sRenderAttachedLights = true; bool LLPipeline::sRenderAttachedParticles = true; bool LLPipeline::sRenderDeferred = false; +bool LLPipeline::sRenderingWaterReflection = false; bool LLPipeline::sMemAllocationThrottled = false; S32 LLPipeline::sVisibleLightCount = 0; F32 LLPipeline::sMinRenderSize = 0.f; @@ -9838,6 +9839,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (!LLViewerCamera::getInstance()->cameraUnderWater()) { //generate planar reflection map + LLPipeline::sRenderingWaterReflection = true; + //disable occlusion culling for reflection map for now S32 occlusion = LLPipeline::sUseOcclusion; LLPipeline::sUseOcclusion = 0; @@ -9972,6 +9975,9 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gPipeline.popRenderTypeMask(); } + + LLPipeline::sRenderingWaterReflection = false; + glCullFace(GL_BACK); gGL.popMatrix(); mWaterRef.flush(); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index d17bab775d..b292ac9358 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -582,6 +582,7 @@ public: static bool sRenderAttachedLights; static bool sRenderAttachedParticles; static bool sRenderDeferred; + static bool sRenderingWaterReflection; static bool sMemAllocationThrottled; static S32 sVisibleLightCount; static F32 sMinRenderSize; |