aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/app_settings/shaders/class3/environment/scatterV.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/app_settings/shaders/class3/environment/scatterV.glsl')
-rw-r--r--linden/indra/newview/app_settings/shaders/class3/environment/scatterV.glsl16
1 files changed, 16 insertions, 0 deletions
diff --git a/linden/indra/newview/app_settings/shaders/class3/environment/scatterV.glsl b/linden/indra/newview/app_settings/shaders/class3/environment/scatterV.glsl
new file mode 100644
index 0000000..c9ebd9e
--- /dev/null
+++ b/linden/indra/newview/app_settings/shaders/class3/environment/scatterV.glsl
@@ -0,0 +1,16 @@
1
2vec2 getScatterCoord(vec3 viewVec, vec3 lightDir)
3{
4 vec2 scatterCoord;
5 scatterCoord.x = length(viewVec);
6 vec3 normVec = normalize(viewVec);
7 scatterCoord.y = dot(normVec, lightDir)*0.5 + 0.5;
8 scatterCoord.x = scatterCoord.x / gl_Fog.end;
9 scatterCoord.x *= scatterCoord.x; // HACK!! Remove this when we can push the view distance farther out
10 return scatterCoord;
11}
12
13void default_scatter(vec3 viewVec, vec3 lightDir)
14{
15 gl_TexCoord[5].xy = getScatterCoord(viewVec, lightDir);
16}