summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-04-03 02:52:34 -0500
committerDave Parks <davep@lindenlab.com>2012-04-03 02:52:34 -0500
commit817f1629bdafd6c28efa2a868a7aad75eb8a9514 (patch)
tree6203c888bcffe00ee09adb4c300073cb4189b199 /indra/newview/app_settings/shaders/class1
parent0cce43aefefa2546b83f373ed81f8dbc7a6241d2 (diff)
Pathfinding visualization WIP -- add many controls for x-ray render, add lighting, and better combat z-fighting and noise from wireframes and overlays
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl18
1 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl
index dc9fefd156..31e878ebc6 100644
--- a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl
@@ -27,14 +27,28 @@ uniform mat4 modelview_projection_matrix;
ATTRIBUTE vec3 position;
ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
VARYING vec4 vertex_color;
uniform float tint;
-
+uniform float ambiance;
+uniform float alpha_scale;
+
void main()
{
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- vertex_color = diffuse_color * tint;
+
+ vec3 l1 = vec3(-0.75, 1, 1.0);
+ vec3 l2 = vec3(0.5, -0.6, 0.4)*0.25;
+ vec3 l3 = vec3(0.5, -0.8, 0.3)*0.5;
+
+ float lit = max(dot(normal, l1), 0.0);
+ lit += max(dot(normal, l2), 0.0);
+ lit += max(dot(normal, l3), 0.0);
+
+ lit = clamp(lit, ambiance, 1.0);
+
+ vertex_color = vec4(diffuse_color.rgb * tint * lit, diffuse_color.a*alpha_scale);
}