From f854e95116cf6d1be1ea1ba562def2e6017179bf Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 18 Jun 2020 10:39:49 -0700 Subject: SL-9632: Fix most HUD objects incorrectly being effected by the environment lighting --- .../shaders/class1/objects/simpleV.glsl | 28 +++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/objects') diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index a59bd9c0a6..575a641b7a 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -1,4 +1,4 @@ -/** +/** * @file simpleV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ @@ -28,6 +28,9 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; +// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass() +uniform int no_atmo; + ATTRIBUTE vec3 position; void passTextureIndex(); ATTRIBUTE vec2 texcoord0; @@ -46,19 +49,22 @@ void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - passTextureIndex(); - vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + + passTextureIndex(); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; - - - vec3 norm = normalize(normal_matrix * normal); + if (no_atmo == 1) + { + vertex_color = diffuse_color; + } + else + { + vec4 pos = (modelview_matrix * vert); + vec3 norm = normalize(normal_matrix * normal); - calcAtmospherics(pos.xyz); + calcAtmospherics(pos.xyz); - vec4 color = calcLighting(pos.xyz, norm, diffuse_color); - vertex_color = color; - - + vertex_color = calcLighting(pos.xyz, norm, diffuse_color); + } } -- cgit v1.2.3 From e7883022b252bfffe8f7d133c6dc626bb95dc442 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 18 Jun 2020 15:15:54 -0700 Subject: SL-9632 Fix HUD objects to not use environment lighting --- indra/newview/app_settings/shaders/class1/objects/simpleV.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class1/objects') diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index 575a641b7a..9ef7704b70 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -53,7 +53,8 @@ void main() passTextureIndex(); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; - + + // SL-9632 HUDs are affected by Atmosphere if (no_atmo == 1) { vertex_color = diffuse_color; -- cgit v1.2.3