CVS: data/Shaders landmass.frag, 1.5, 1.6 urban.frag, 1.5, 1.6

Frederic Bouvier <[email protected]>
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-serv4637

Modified Files:
	landmass.frag urban.frag 
Log Message:
Disable self shadowing for now to gain some fps on older GPU. Should be configurable in the future

Index: landmass.frag
===================================================================
RCS file: /var/cvs/FlightGear-0.9/data/Shaders/landmass.frag,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- landmass.frag	28 Mar 2010 17:00:21 -0000	1.5
+++ landmass.frag	1 Apr 2010 20:59:17 -0000	1.6
@@ -18,7 +18,7 @@
 
 float ray_intersect(sampler2D reliefMap, vec2 dp, vec2 ds)
 {
-	const int linear_search_steps = 20;
+	const int linear_search_steps = 10;
 
 	float size = 1.0 / float(linear_search_steps);
 	float depth = 0.0;
@@ -97,18 +97,18 @@
 	N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
 	vec3 l = gl_LightSource[0].position.xyz;
 	vec3 diffuse = gl_Color.rgb * max(0.0, dot(N, l));
-
+	float shadow_factor = 1.0;
+/*
 // Shadow
 	dp += ds * d;
 	vec3 sl = normalize( vec3( dot( l, VTangent ), dot( l, VBinormal ), dot( -l, VNormal ) ) );
 	ds = sl.xy * depth_factor / sl.z;
 	dp -= ds * d;
 	float dl = ray_intersect(NormalTex, dp, ds);
-	float shadow_factor = 1.0;
 	if ( dl < d - 0.05 )
 		shadow_factor = dot( constantColor.xyz, vec3( 1.0, 1.0, 1.0 ) ) * 0.25;
 // end shadow
-
+*/
 	vec4 ambient_light = constantColor + gl_LightSource[0].diffuse * shadow_factor * vec4(diffuse, 1.0);
 
 	c1 *= ambient_light;

Index: urban.frag
===================================================================
RCS file: /var/cvs/FlightGear-0.9/data/Shaders/urban.frag,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- urban.frag	28 Mar 2010 17:23:06 -0000	1.5
+++ urban.frag	1 Apr 2010 20:59:17 -0000	1.6
@@ -24,7 +24,7 @@
 
 float ray_intersect(sampler2D reliefMap, vec2 dp, vec2 ds)
 {
-	const int linear_search_steps = 20;
+	const int linear_search_steps = 10;
 
 	float size = 1.0 / float(linear_search_steps);
 	float depth = 0.0;
@@ -76,18 +76,18 @@
 
 	vec3 l = gl_LightSource[0].position.xyz;
 	vec3 diffuse = gl_Color.rgb * max(0.0, dot(N, l));
-
+	float shadow_factor = 1.0;
+/*
 // Shadow
 	dp += ds * d;
 	vec3 sl = normalize( vec3( dot( l, VTangent ), dot( l, VBinormal ), dot( -l, VNormal ) ) );
 	ds = sl.xy * depth_factor / sl.z;
 	dp -= ds * d;
 	float dl = ray_intersect(NormalTex, dp, ds);
-	float shadow_factor = 1.0;
 	if ( dl < d - 0.05 )
 		shadow_factor = dot( constantColor.xyz, vec3( 1.0, 1.0, 1.0 ) ) * 0.25;
 // end shadow
-
+*/
 	vec4 ambient_light = constantColor + gl_LightSource[0].diffuse * vec4(diffuse, 1.0);
 	float reflectance = ambient_light.r * 0.3 + ambient_light.g * 0.59 + ambient_light.b * 0.11;
 	if ( shadow_factor < 1.0 )


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.