Re: [Flightgear-devel] landmass geometry shader rewrite

2010-04-30 Thread Tim Moore
On Fri, Apr 23, 2010 at 11:14 AM, Erik Hofman e...@ehofman.com wrote:

 Tim Moore wrote:
  Looks like the same attribute problem. What hardware?

 NVidia 9600GT/512Mb on AMD X2 250 wn 2Gb memory.

 I've eliminated some varying parameters from the landmass vertex and
geometry shaders. Please give it a try and see if it works better.

Tim
--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] landmass geometry shader rewrite

2010-04-30 Thread Erik Hofman

Erik Hofman wrote:

Tim Moore wrote:
   I've eliminated some varying parameters from the landmass vertex and

geometry shaders. Please give it a try and see if it works better.


Yes this works for me, excellent!


If I do the same kind of thing to landmass.vert/frag using this patch I 
also get back the settings below quality level=3.5


It's just a matter of moving one (seemingly unused) 'varying float' to 
landmass.frag


Erik
Index: landmass.frag
===
RCS file: /var/cvs/FlightGear-0.9/data/Shaders/landmass.frag,v
retrieving revision 1.8
diff -p -u -r1.8 landmass.frag
--- landmass.frag	10 Apr 2010 15:09:18 -	1.8
+++ landmass.frag	30 Apr 2010 16:38:00 -
@@ -7,7 +7,6 @@ varying vec3  VTangent;
 varying vec3  VBinormal;
 varying vec3  Normal;
 varying vec4  constantColor;
-varying float bump;
 
 uniform sampler3D NoiseTex;
 uniform sampler2D BaseTex;
@@ -55,12 +54,14 @@ float ray_intersect(sampler2D reliefMap,
 
 void main (void)
 {
+float bump = 1.0;
+
 	if ( quality_level = 3.5 ) {
 		linear_search_steps = 20;
 	}
-	vec2 uv, dp, ds;
+	vec2 uv, dp = vec2(0, 0), ds = vec2(0, 0);
 	vec3 N;
-	float d;
+	float d = 0;
 	if ( bump  0.9  quality_level = 2.0 )
 	{
 		vec3 V = normalize(ecPosition.xyz);
Index: landmass.vert
===
RCS file: /var/cvs/FlightGear-0.9/data/Shaders/landmass.vert,v
retrieving revision 1.5
diff -p -u -r1.5 landmass.vert
--- landmass.vert	2 Apr 2010 07:06:40 -	1.5
+++ landmass.vert	30 Apr 2010 16:38:00 -
@@ -5,7 +5,6 @@ varying vec3  VTangent;
 varying vec3  VBinormal;
 varying vec3  Normal;
 varying vec4  constantColor;
-varying float bump;
 
 attribute vec3 tangent;
 attribute vec3 binormal;
@@ -18,7 +17,6 @@ void main(void)
 	VNormal = gl_NormalMatrix * gl_Normal;
 	VTangent = gl_NormalMatrix * tangent;
 	VBinormal = gl_NormalMatrix * binormal;
-	bump = 1.0;
 
 	gl_FrontColor = gl_Color;
 	constantColor = gl_FrontMaterial.emission
--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] landmass geometry shader rewrite

2010-04-23 Thread Erik Hofman
Tim Moore wrote:
 Hi,
 I hacked on the landmass geometry shader a bit. On my machine I got the 
 frame rate to improve from 14 fps to 52 fps using the ufo at ksfo. This 
 technique may be promising, although it could certainly stand some new 
 textures. Anyone playing with geometry shaders in the terrain (and also 
 models) should follow the example of landmass-g.vert and landmass.geom.
 
 Let me know if I broke anything in the graphical appearance, or if any 
 OpenGL problems are introduced.

After this change I get te following in all quality levels:

glLinkProgram  FAILED
Program  infolog:
Fragment info
-
(61) : warning C7050: ds might be used before being initialized
(61) : warning C7050: dp might be used before being initialized
(63) : warning C7050: d might be used before being initialized

Link info
-
Vertex attribute output count exceeds hardware limits.
Program's vertex attrib binding 7, binormal
Program's vertex attrib binding 15, normal
Program's vertex attrib binding 6, tangent

Before this change I did have proper landmass shaders with the quality 
level set above 3.5, now I don't get proper shader in any level (dark 
green untextured landmass).

Erik

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] landmass geometry shader rewrite

2010-04-23 Thread Tim Moore
On Fri, Apr 23, 2010 at 10:46 AM, Erik Hofman e...@ehofman.com wrote:

 Tim Moore wrote:
  Hi,
  I hacked on the landmass geometry shader a bit. On my machine I got the
  frame rate to improve from 14 fps to 52 fps using the ufo at ksfo. This
  technique may be promising, although it could certainly stand some new
  textures. Anyone playing with geometry shaders in the terrain (and also
  models) should follow the example of landmass-g.vert and landmass.geom.
 
  Let me know if I broke anything in the graphical appearance, or if any
  OpenGL problems are introduced.

 After this change I get te following in all quality levels:

 glLinkProgram  FAILED
 Program  infolog:
 Fragment info
 -
 (61) : warning C7050: ds might be used before being initialized
 (61) : warning C7050: dp might be used before being initialized
 (63) : warning C7050: d might be used before being initialized

 Link info
 -
 Vertex attribute output count exceeds hardware limits.
 Program's vertex attrib binding 7, binormal
 Program's vertex attrib binding 15, normal
 Program's vertex attrib binding 6, tangent

 Before this change I did have proper landmass shaders with the quality
 level set above 3.5, now I don't get proper shader in any level (dark
 green untextured landmass).

 Erik

 Looks like the same attribute problem. What hardware?

Tim


 --
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] landmass geometry shader rewrite

2010-04-23 Thread Erik Hofman
Tim Moore wrote:
 Looks like the same attribute problem. What hardware?

NVidia 9600GT/512Mb on AMD X2 250 wn 2Gb memory.

Erik

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] landmass geometry shader rewrite

2010-04-23 Thread Frederic Bouvier
- Tim Moore a écrit : 
 

 Looks like the same attribute problem. What hardware? 

for the record, I see an improvement from 8fps to 30fps on a NVIDIA geForce 
9700M GT 

Thank you Tim 

-Fred 

-- 
Frédéric Bouvier 
http://my.fotolia.com/frfoto/ Photo gallery - album photo 
http://www.youtube.com/user/fgfred64 Videos 

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel