diff options
author | jada <jada@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2005-10-20 19:59:00 +0000 |
---|---|---|
committer | jada <jada@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2005-10-20 19:59:00 +0000 |
commit | e63928ebbdc63d6da0c6f0b8fae47a6e8a75e859 (patch) | |
tree | 89fd52b91a55459e843ebc9743fb995e633447a0 /src/GLSLShaderTest/dimple.frag | |
parent | 89e00ae88793b815256cf1ec371d4dd4000f020a (diff) |
1) No exit when exception is encountered.
2) Added new GLSL shader example program.
Diffstat (limited to 'src/GLSLShaderTest/dimple.frag')
-rw-r--r-- | src/GLSLShaderTest/dimple.frag | 20 |
1 files changed, 12 insertions, 8 deletions
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); } |