From ec8140016b991d2729b51dd1746a29fafaea5b61 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 24 Jan 2019 10:58:03 -0800 Subject: SL-10282 Use clamping on dot product to determine halo TCs to fix abrupt cutoff at dot == 0. Ifdef around engaging advanced atmo which is not ready for primetime yet. --- indra/newview/app_settings/shaders/class2/deferred/skyF.glsl | 4 ++-- indra/newview/llviewershadermgr.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl index 3232f81cd9..520bfbeadc 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl @@ -70,6 +70,7 @@ uniform float ice_level; vec3 rainbow(float d) { + d = clamp(d, -1, 0); float rad = (droplet_radius - 5.0f) / 1024.0f; return pow(texture2D(rainbow_map, vec2(rad, d)).rgb, vec3(1.8)) * moisture_level; } @@ -182,8 +183,7 @@ void main() vec3 halo_22 = halo22(optic_d); - if (optic_d <= 0) - color.rgb += rainbow(optic_d); + color.rgb += rainbow(optic_d); color.rgb += halo_22; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 1686aeea4f..2293007641 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -490,7 +490,7 @@ void LLViewerShaderMgr::setShaders() S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail"); bool useRenderDeferred = canRenderDeferred && gSavedSettings.getBOOL("RenderDeferred") && gSavedSettings.getBOOL("RenderAvatarVP"); bool doingWindLight = hasWindLightShaders && gSavedSettings.getBOOL("WindLightUseAtmosShaders"); - bool useAdvancedAtmospherics = doingWindLight && gSavedSettings.getBOOL("RenderUseAdvancedAtmospherics"); + //using shaders, disable fixed function LLGLSLShader::sNoFixedFunction = true; @@ -510,11 +510,14 @@ void LLViewerShaderMgr::setShaders() transform_class = 0; } + #if USE_ADVANCED_ATMOSPHERICS + bool useAdvancedAtmospherics = doingWindLight && gSavedSettings.getBOOL("RenderUseAdvancedAtmospherics"); if (useAdvancedAtmospherics) { deferred_class = 3; wl_class = 3; } + #endif if (useRenderDeferred && doingWindLight) { -- cgit v1.2.3