On Wednesday 13 June 2012 12:05:42 Renk Thorsten wrote:
 
> Now, random vegetation seems to increase vertex count a lot, and this may
> well be not doable by just taking the code and applying it to the
> vegetation (it didn't work with clouds either).  So it probably needs a
> dedicated approximation scheme making use of the fact that vegetation is
> drawn relatively close to the position and not 100 km distant to run at
> all.
> 
> Given my framerate when switching on lightfields and random vegetation
> without lightfield shading, I'm not too optimistic :-( But worth a try.
> 
> * Thorsten

There is a simple solution to that. Move the work in the fragment shader. You 
won't be scene complexity bound, and you'll also have the correct depth 
available as:

float fragmentDepth = gl_ProjectionMatrix[3].z/(gl_FragCoord.z * -2.0 + 1.0 - 
gl_ProjectionMatrix[2].z);
 
(Currently, if taking depth info in the vertex shader for the trees, you need 
to do some ugly hacks to get the right depth, hacks that fail to work most of 
the times. )

As for performance concerns, yes, fragment operations might be slower than 
vertex ones for the same complex task, but they are generaly done on a limited 
amount of fragments that varies only with camera position/orientation and 
isn't adversely affected by high vertex count scenes. And the trend is for 
vertex count increase.

Regards,
Emilian

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to