summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl20
1 files changed, 10 insertions, 10 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index 18616a9bb3..f07ef92b26 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -1,5 +1,5 @@
/**
- * @file pointLightF.glsl
+ * @file class1\deferred\pointLightF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -33,13 +33,12 @@ out vec4 frag_color;
#define frag_color gl_FragColor
#endif
-uniform sampler2DRect diffuseRect;
-uniform sampler2DRect specularRect;
-uniform sampler2DRect normalMap;
-uniform samplerCube environmentMap;
+uniform sampler2D diffuseRect;
+uniform sampler2D specularRect;
+uniform sampler2D normalMap;
uniform sampler2D noiseMap;
uniform sampler2D lightFunc;
-uniform sampler2DRect depthMap;
+uniform sampler2D depthMap;
uniform vec3 env_mat[3];
uniform float sun_wash;
@@ -58,6 +57,7 @@ uniform vec4 viewport;
vec3 getNorm(vec2 pos_screen);
vec4 getPosition(vec2 pos_screen);
+float getDepth(vec2 pos);
vec3 srgb_to_linear(vec3 c);
void main()
@@ -65,7 +65,6 @@ void main()
vec4 frag = vary_fragcoord;
frag.xyz /= frag.w;
frag.xyz = frag.xyz*0.5+0.5;
- frag.xy *= screen_res;
vec3 pos = getPosition(frag.xy).xyz;
vec3 lv = trans_center.xyz-pos;
@@ -87,9 +86,9 @@ void main()
lv = normalize(lv);
da = dot(norm, lv);
- float noise = texture2D(noiseMap, frag.xy/128.0).b;
+ float noise = texture2D(noiseMap, frag.xy).b;
- vec3 col = texture2DRect(diffuseRect, frag.xy).rgb;
+ vec3 col = texture2D(diffuseRect, frag.xy).rgb;
float fa = falloff+1.0;
float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
@@ -100,7 +99,7 @@ void main()
col = color.rgb*lit*col;
- vec4 spec = texture2DRect(specularRect, frag.xy);
+ vec4 spec = texture2D(specularRect, frag.xy);
if (spec.a > 0.0)
{
lit = min(da*6.0, 1.0) * dist_atten;
@@ -126,6 +125,7 @@ void main()
{
discard;
}
+ final_color.rgb = vec3(getDepth(frag.xy));
frag_color.rgb = col;
frag_color.a = 0.0;