From 514fe3f6240041c178ff9262d0b91e838fad1d3b Mon Sep 17 00:00:00 2001 From: jada Date: Tue, 25 Oct 2005 23:17:51 +0000 Subject: 1) GLSLShaderTest : Added new GLSL shader example program. No exit when exception is encountered. 2) PickTest : Update PickTest.java to use the new pickfast utility. --- src/GLSLShaderTest/dimple.frag | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/GLSLShaderTest/dimple.frag') diff --git a/src/GLSLShaderTest/dimple.frag b/src/GLSLShaderTest/dimple.frag index 70d2982..282add7 100644 --- a/src/GLSLShaderTest/dimple.frag +++ b/src/GLSLShaderTest/dimple.frag @@ -11,20 +11,23 @@ varying vec3 LightDir; varying vec3 EyeDir; varying vec3 Normal; -const vec3 color = vec3(0.7, 0.6, 0.18); +//const vec3 Color = vec3(0.7, 0.6, 0.18); //const float Density = 16.0; //const float Size = 0.25; -//uniform float Density; -//uniform float Size; -float Density = 27.6; -float Size = 0.13025; +uniform vec3 Color; +uniform float Density; +uniform float Size; +// uniform float SpecularFactor; + +//float Density = 27.6; +//float Size = 0.13025; //uniform float Scale; -const float SpecularFactor = 0.5; +const float SpecularFactor = 0.4; void main (void) { @@ -38,7 +41,7 @@ void main (void) vec3 normDelta = vec3(-p.x, -p.y, 1.0); - litColor = color * max(0.0, dot(normDelta, LightDir)); + litColor = Color * max(0.0, dot(normDelta, LightDir)); float t = 2.0 * dot(LightDir, normDelta); vec3 reflectDir = t * normDelta; @@ -52,6 +55,7 @@ void main (void) spec *= SpecularFactor; litColor = min(litColor + spec, vec3(1.0)); - gl_FragColor = vec4(litColor, 1.0); + gl_FragColor = vec4(litColor, gl_Color.a); +// gl_FragColor = vec4(litColor, 1.0); // gl_FragColor = vec4(Scale); } -- cgit v1.2.3