Skip to content
Snippets Groups Projects
Commit f854e951 authored by Ptolemy's avatar Ptolemy
Browse files

SL-9632: Fix most HUD objects incorrectly being effected by the environment lighting

parent 375f43ed
No related branches found
No related tags found
No related merge requests found
/**
/**
* @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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment