summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-03-02 21:25:50 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-03-02 21:25:50 +0000
commit4dabd9c0472deb49573fdafef2fa413e59703f19 (patch)
tree06c680d6a2047e03838d6548bccd26c7baf9d652 /indra/newview/app_settings/shaders/class1
parentd4462963c6ba5db2088723bbedc7b60f1184c594 (diff)
merge release@58699 beta-1-14-0@58707 -> release
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/shinyF.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/shinyV.glsl27
3 files changed, 41 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
index b2a6d67621..c169fceb88 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
@@ -5,7 +5,7 @@ uniform sampler2D diffuseMap;
void default_lighting()
{
vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
- applyScatter(color.rgb);
+ //applyScatter(color.rgb);
gl_FragColor = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl
new file mode 100644
index 0000000000..12c99a6567
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl
@@ -0,0 +1,13 @@
+void applyScatter(inout vec3 col);
+
+uniform samplerCube environmentMap;
+
+void main()
+{
+ vec3 ref = textureCube(environmentMap, gl_TexCoord[0].xyz).rgb;
+
+ applyScatter(ref);
+
+ gl_FragColor.rgb = ref;
+ gl_FragColor.a = gl_Color.a;
+}
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
new file mode 100644
index 0000000000..621ff6b5b7
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
@@ -0,0 +1,27 @@
+void default_scatter(vec3 viewVec, vec3 lightDir);
+
+uniform vec4 origin;
+
+void main()
+{
+ //transform vertex
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
+ vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+
+ gl_FrontColor = gl_Color;
+
+ vec3 ref = reflect(pos, norm);
+
+ vec3 d = pos - origin.xyz;
+ float dist = dot(normalize(d), ref);
+ vec3 e = d + (ref * max(origin.w-dist, 0.0));
+
+ ref = e - origin.xyz;
+
+ gl_TexCoord[0] = gl_TextureMatrix[0]*vec4(ref,1.0);
+
+ default_scatter(pos.xyz, gl_LightSource[0].position.xyz);
+}
+