On Mon, Mar 21, 2011 at 9:52 AM, Heiko Schulz wrote:

> So this is the explanantion of decreasing fps with textures with
> transparency?
> Comparing with other games/sims I'm surprised that it is so much noticeable
> in FGFS.
>

No, this is another issue I believe.  When the opengl system draws a
triangle with a texture that has some transparency, it needs to read back in
the current color buffer and mix the pixels of the new surface with the
pixels that have already been drawn before.  This takes longer (sometimes
*much* longer) than just writing out solid pixels.

If you dig into how modern 3d hardware works, you'll fine a lot of
parallelization and multiple cores.  Your 3d card is really a whole computer
itself.  OpenGL is carefully designed so that the application can send a set
of commands to the hardware and the hardware figures out the best way to
render them.  The problem with alpha textures is that they can disrupt the
fastest pipeline operations, certain draw commands need to finish before the
next one can start.

I don't know if there are good ways to avoid this other than to try to
minimize the amount of transparency we use.  Clouds are especially bad
because we stack many many layers of partially transparent surfaces on top
of each other and we end up having to render the same pixels on the screen
many many times over ... and do that with a slower, harder-to-optimize
rendering path.

There are probably tricks that could be used.  I recently saw a demo engine
(used for benchmarking graphics cards and systems).  I forget the name now,
but it was amazing.  I need to start learning some of their tricks ...
blades of grass waving in the breeze with dynamic shadows being cast over
them from everything else in the scene ... beautiful clouds, amazing
lighting effects, really cool and realistic material surface effects (like
weathered/beaten metal fittings on a ship, etc.)  They didn't do any
reflection/glass effects though in that demo so we had them beat there. :-)

The only disadvantage I can see and that's why I never considered yet to use
> it is the fact that the size itself is increasing. As we have people here
> which consider space saving more important than qualitity I feared that it
> could lead to problems.
>

Most likely due to the fact that it is storing all the smaller versions of
the texture along with the original ... that makes sense though because if
it didn't store the mipmaps, then we'd be back to the same low quality
default box filter.  These days I tend to lean towards the "disk space is
cheap" camp.  (But anything taken to it's extreme is probably not good.)

Curt.
-- 
Curtis Olson:
http://www.atiak.com - http://aem.umn.edu/~uav/
http://www.flightgear.org -
http://www.flightgear.org/blogs/category/curt/<http://www.flightgear.org/blogs/category/personal/curt/>
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to