While looking at the scene graph I saw that the .btg files are
generating a lot of leafs.
This is not new, but perhaps it is becoming worse each time the source
data resolution used to build the
tile becomes finer.
I have added a few traces in simgear's sgBinObjLoad functions, an example :
sgBinObjLoad (F:/FlightGear/data/Scenery/Terrain/w130n30/w123n37/942058.btg)
get_wgs84_nodes.size=1543
get_tris_v.size=0
get_strips_v.size=0
get_fans_v.size=928
leafMap.size=12
local_terrain->getNumKids()=928
sgBinObjLoad (F:/FlightGear/data/Scenery/Terrain/w130n30/w123n37/942043.btg)
get_wgs84_nodes.size=1671
get_tris_v.size=0
get_strips_v.size=0
get_fans_v.size=1045
leafMap.size=14
local_terrain->getNumKids()=1045
sgBinObjLoad (F:/FlightGear/data/Scenery/Terrain/w130n30/w123n37/KNUQ.btg)
get_wgs84_nodes.size=3500
get_tris_v.size=43
get_strips_v.size=3
get_fans_v.size=0
leafMap.size=33
local_terrain->getNumKids()=46
sgBinObjLoad (F:/FlightGear/data/Scenery/Terrain/w130n30/w123n37/KPAO.btg)
get_wgs84_nodes.size=685
get_tris_v.size=11
get_strips_v.size=3
get_fans_v.size=0
leafMap.size=10
local_terrain->getNumKids()=14
We can see that :
- tile objects use only fans
- airport objects use strips and regular tris
- for an equal number of triangles a tile object uses 50 times more
leafs than an airport object ;
- the number of leafs from a tile has nothing to do with the number of
materials ( leafMap )
When the leafs are inserted in the scene graph they are sorted by
materials, so my concern is not about
OpenGl material switching but rather on the number of calls needed to
draw a few triangles.
The use of display list has divided the number of calls to opengl,
that's why there was a substancial gain.
If we do one call per material we can divide this number of calls by 50
for tile objects.
And yes I know strips or fans are supposed to be faster than triangles,
but no this is not true in
the current situation (1000 calls to draw a 10 triangle strips/fans
can't be faster than 10 call to draw 1000
regular triangles).
Is there a reason why we are using fans and not strips for tile objects ?
Harald.
_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d