CVS: data/Shaders terrain-default.frag, 1.1, 1.2
Frederic Bouvier <[email protected]> Sat, 24 Apr 2010 11:47:05 -0500
| Newsgroups | gmane.games.flightgear.cvc |
|---|---|
| Message-ID | <[email protected]> |
Update of /var/cvs/FlightGear-0.9/data/Shaders
In directory baron.flightgear.org:/tmp/cvs-serv9009
Modified Files:
terrain-default.frag
Log Message:
Fix line endings
Index: terrain-default.frag
===================================================================
RCS file: /var/cvs/FlightGear-0.9/data/Shaders/terrain-default.frag,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- terrain-default.frag 31 Jan 2010 10:40:59 -0000 1.1
+++ terrain-default.frag 24 Apr 2010 16:47:01 -0000 1.2
@@ -1,58 +1,57 @@
-// -*-C++-*-
-
-varying vec4 diffuse, constantColor;
-varying vec3 normal, lightDir, halfVector;
-varying float fogCoord, alpha;
-
-uniform sampler2D texture;
-uniform sampler3D noise;
-
-float luminance(vec3 color)
-{
- return dot(vec3(0.212671, 0.715160, 0.072169), color);
-}
-
-void main()
-{
- vec3 n, halfV;
- float NdotL, NdotHV, fogFactor;
- vec4 color = constantColor;
- vec4 texel;
- vec4 fragColor;
- vec4 specular = vec4(0.0);
-
- n = normalize(normal);
- if (!gl_FrontFacing)
- n = -n;
- NdotL = max(dot(n, lightDir), 0.0);
- if (NdotL > 0.0) {
- color += diffuse * NdotL;
- halfV = normalize(halfVector);
- NdotHV = max(dot(n, halfV), 0.0);
- if (gl_FrontMaterial.shininess > 0.0)
- specular.rgb = (gl_FrontMaterial.specular.rgb
- * gl_LightSource[0].specular.rgb
- * pow(NdotHV, gl_FrontMaterial.shininess));
- }
- color.a = alpha;
-
-
- // This shouldn't be necessary, but our lighting becomes very
- // saturated. Clamping the color before modulating by the texture
- // is closer to what the OpenGL fixed function pipeline does.
- color = clamp(color, 0.0, 1.0);
- texel = texture2D(texture, gl_TexCoord[0].st);
- fragColor = color * texel + specular;
-
- // Store pixel's luminance in the alpha value
- if(alpha > 0.95) {
- float lum = 1.0 - (luminance(fragColor.rgb) * 3.0);
- float tex_lum = luminance(texel.rgb);
- fragColor.a = tex_lum * clamp(lum, 0.01, 1.0);
- }
-
- fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
- gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
-
-}
-
+// -*-C++-*-
+
+varying vec4 diffuse, constantColor;
+varying vec3 normal, lightDir, halfVector;
+varying float fogCoord, alpha;
+
+uniform sampler2D texture;
+uniform sampler3D noise;
+
+float luminance(vec3 color)
+{
+ return dot(vec3(0.212671, 0.715160, 0.072169), color);
+}
+
+void main()
+{
+ vec3 n, halfV;
+ float NdotL, NdotHV, fogFactor;
+ vec4 color = constantColor;
+ vec4 texel;
+ vec4 fragColor;
+ vec4 specular = vec4(0.0);
+
+ n = normalize(normal);
+ if (!gl_FrontFacing)
+ n = -n;
+ NdotL = max(dot(n, lightDir), 0.0);
+ if (NdotL > 0.0) {
+ color += diffuse * NdotL;
+ halfV = normalize(halfVector);
+ NdotHV = max(dot(n, halfV), 0.0);
+ if (gl_FrontMaterial.shininess > 0.0)
+ specular.rgb = (gl_FrontMaterial.specular.rgb
+ * gl_LightSource[0].specular.rgb
+ * pow(NdotHV, gl_FrontMaterial.shininess));
+ }
+ color.a = alpha;
+
+
+ // This shouldn't be necessary, but our lighting becomes very
+ // saturated. Clamping the color before modulating by the texture
+ // is closer to what the OpenGL fixed function pipeline does.
+ color = clamp(color, 0.0, 1.0);
+ texel = texture2D(texture, gl_TexCoord[0].st);
+ fragColor = color * texel + specular;
+
+ // Store pixel's luminance in the alpha value
+ if(alpha > 0.95) {
+ float lum = 1.0 - (luminance(fragColor.rgb) * 3.0);
+ float tex_lum = luminance(texel.rgb);
+ fragColor.a = tex_lum * clamp(lum, 0.01, 1.0);
+ }
+
+ fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
+ gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
+
+}
------------------------------------------------------------------------------