Hi,

On Monday, September 12, 2011 00:18:47 Stuart Buchanan wrote:
> The problem definitely seems to be that any other objects in the scenery
> with an alpha layer are rendered after the clouds, so are rendered in
> front of them, irrespective of the viewpoint and their relative positions.
> By
> removing the alpha
> layer from the texture of the stratosphere-tower in Las Vegas, I was
> able to work
> around the problem.
> 
> Unfortunately, fixing this is going to require someone with more knowledge
> of OSG than I have. The problem is that the 3D clouds are in an earlier
> rendering bin
>  from the scenery models with transparent textures, which means that the
> clouds are rendered first in their entirety, and then the scenery models,
> with no consideration of the relative position (i.e. depth) compare with
> the clouds. This was done for perf reasons. Putting the clouds in the same
> rendering bin (i.e. TRANSPARENT_BIN) halves the framerate on my system.
> 
> I'm not sure there is a fix for this that doesn't massively impact
> performance, unless
> we add some of these objects to the CLOUDS_BIN and then depth-sort them
> within the cloud code itself which depth-sorts slowly across multiple
> frames to avoid exactly
> the performance hit from depth sorting the entire TRANSPARENT_BIN in
> each frame.
> 
> Tim/Matthias - care to comment?
I will try. Catching up on this longer discussion somehow. So, I may have 
overseen something now ...
Also catching up on what we have currently implemented.

Ok, having *everything* rendered connectly - where I really mean correctly - 
would require everything that is somehow translucent to be sorted.

But could it help to reorder the bins somehow? That is assign render bin 
numbers to some parts of the scene?
First draw the opaque scene, then the scenery objects that are translucent. 
Then the clouds and the ai aircraft. The last would be probably the own 
aircraft. There are already such games played with the runway lights I think.

>From that, what is the reason that the CLOUD_BIN number is 9. That means 
rendered *before* the translucent scenery objects?
Ok, digging myself:
Given the explanation in RenderConstants.hxx - that sounds somehow familiar to 
me - shows that this number is a compromise anyway.
To me the argument means that the good old cloud layers are just too huge to 
do some sensible depth sorting with them. So move them out of the way and sort 
them by hand. But at the same time these are translucent and should happen 
about the same time other translucent object are drawn. Problably, drawing 
before translucent scenetry objects because the sky happens to be mostly 
before scenery objects. Which might become false once you are above this layer 
...

So, thinking about that:
Merge the the huge cloud layers with the rest of the clouds. May be by 
splitting them into smaller chunks that interact more nicely with the other 
clouds. You will touch that for the curved layers anyway ...
Then try to put the clouds into a bin > 10.
Then we get probably problems with the own aircraft or may be ai aircraft 
models with translucent parts. But I am sure we find an apropriate renderbin 
number for these parts of the scene.
... did you know, these render bins could also be nested?

A closer look into the effect implementations regarding render bins might also 
be helpful. I am not sure if we break something else with effects with this 
kind of games ...

And yes render bins are powerful but complicated. :)

Hope this helps?

Mathias

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to