![]() |
|
|
|||||||
| Register | Wiki | Downloads | FAQ | Members List | Social Groups | Calendar | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
LODs versus drawcall batching
Since MS introduced the concept of drawcall batching in SP2 of FSX there has been a lot of discussion going on about levels of details still working or not. In the end it comes down to a choice between either having LODs working for your object or having drawcall batching. The MDL files that the GMax gamepack makes will have working LODs by default (and thus no drawcall batching). Since I don't use 3DS Max I am not sure what the default situation is there. But by compiling with an empty xanim file and the /XANIM flag in XtoMDL you can ensure that your LODs will work.
So this brings us to the choice do we want LODs working or do we want the drawcall batching to work? Today I did some experimentation to try to answer this question. What I did is the following. I made a test object that has three levels of detail, a sphere, a cylinder and a cube. I then compared the performance of a grid of 486 of these objects placed in the situation with LODs working and in the situation with drawcall batching working (but always the most complex LOD showing). And to add another dimension to the test I then varied the amount of triangles in the spheres, cylinders and boxes to see which effect that has. Below you see a screenshot of the test situation. Sounds complex all this? Let's take a look at the results I got. There is a screenshot with the results attached to this post. Each row of two results is the situation with a different complexity of the object for the situation with the LODs working (486 drawcalls) and with the drawcall batching working (1 drawcall). So it seems that the conclusion from this is that if you have an object that will be used in many places (many instances) that you are better of without the levels of details, but with the drawcall batching working. Only for complex objects (when more than 600000 triangles are rendered in the scene) it seems that using the levels of detail gets the upper hand again. But I doubt there are many autogen or generic objects that are so complex and placed so often to reach such limits. I am not completely sure yet what this means for custom objects that are only placed in one or two locations. For those drawcall batching will not bring so many benefits, unless the same material is used on many of those custom objects. So I guess for them using levels of detail to reduce the triangle count is the best choice. But I will try to do some more testing to see if I can verify that. As I mentioned, these are my first results and I am not sure if the conclusions are correct (yet). So I would be happy to hear your thoughts or ideas about this subject.
__________________
Arno If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done. FSDeveloper Administator | Microsoft FS MVP
|
|
#2
|
|||
|
|||
|
Thanks for the test Arno. Looks to me that LOD is the way to go. The framerate loss only seems to come into play when framerates are high already anyway - if I understand this correctly.
|
|
#3
|
||||
|
||||
|
Hi,
I think, but I am also still thinking about it, that it means that for autogen and other objects you place many times it would be best to optimize for drawcall batching and forget the LOD. Only when the amount of triangles is very high the LOD wins again in performance sense. For custom objects it is not so likely that you can batch the drawcalls since they will mostly have unique textures, so then using the LOD seems to make most sense.
__________________
Arno If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done. FSDeveloper Administator | Microsoft FS MVP
|
|
#4
|
||||
|
||||
|
I was recently asked to make lots of similar objects for an FSX bombing range
- various shapes and colours of barrels on posts plus a few other objects. I managed to keep them all with the same material sheet and material properties. The 3D canvas exporter meant that these would all be batched for the drawcall. No LODs (they were generally only around 100 polys) and performance was very good However... We did hit a wall when too many were places in a small area - I suspect there is a 16bit index limit to batched draw calls. Some of the placed objects just did not appear when restarting FSX after using the OPT. Newly added objects in the OPT are not batched so they were visible when being placed. I'm surprised you didn't see it with your tests too - how did you set up the test scene? In the end I had to change a few material properties on some of the objects so we ended up with 2 draw calls in any particular area.
__________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Paul 3D trains and planes - http://decapod-3d.spaces.live.com |
|
#5
|
||||
|
||||
|
Hi Paul,
I made a XML file to place the objects, but I "only" used 486 objects. Maybe you had many more? Glad to hear that your experiences for the rest (performance wise) match my test results.
__________________
Arno If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done. FSDeveloper Administator | Microsoft FS MVP
|
|
#6
|
||||
|
||||
|
Arno ... if I am to interpret your screenshot properly ... the different colour denotes a different material (and hence drawcall) for each LOD.
Ok ... I know we're assuming that they're not batched anyway ... but should it not be the same material (for the sake of scientific merit, keeping to a single variable) Or have I misinterpreted the colours? Also ... does a texture or the size (say 2048 x 2048) applied to the image have any effect on the results - rather than just a bland material? Thankyou very much for doing this .... I have been wondering about this for some time now.
__________________
http://www.aussiex.org/forum |
|
#7
|
||||
|
||||
|
Another query (if I may)
Is the /xanim flag ONLY used by the Gmax export when LODs are present? Or is it present in all Gmax exported mdls? The reason I ask is that that translation tables (allowing pitch/bank etc to work) seem to work for Gmax objects (with or without LODs), but not for FSDS objects. So in this case, does batching work at all for any Gmax created objects if they all have a dummy animation in them?
__________________
http://www.aussiex.org/forum |
|
#8
|
||||
|
||||
|
I can support decapod's assumption of a "wall".
One, two or no members here could remember the trouble I had with a custom modeled hangar. I got on a wasting spree on the first try and pumped this object up with 35000 polies each (I wanted a smooth grass cover ). My hopes for proper batching were shattered when FSX slowed to 10 FPS after having placed about fourteen of them on an airfield.I also tried adding LODs, but this didn't work properly so I couldn't get any numbers for comparison. However, after cutting the polycount down to 3500 for each model things are as smooth as always. ![]() So I have the same conclusion as you, Arno. Draw call batching for many low-poly objects, LODs for a few high-poly ones.
__________________
Regards, Björn |
|
#9
|
||||
|
||||
|
Hi,
Quote:
Quote:
Quote:
__________________
Arno If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done. FSDeveloper Administator | Microsoft FS MVP
|
|
#10
|
||||
|
||||
|
Thanks Arno ... this is what I assumed.
I may consider post-processing some of my Gmax models in Modelconverter to enable them to batch. Yet another design consideration ! It would be interesting to hunt down where the flag is set in the export script to see if it could be "unset" as an option.
__________________
http://www.aussiex.org/forum |
|
#11
|
||||
|
||||
|
Hi,
Since we don't have direct access to the flags used by GMax for XtoMDL I am not sure if we can access that level. It is a pity it is so restricted (but I understand why).
__________________
Arno If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done. FSDeveloper Administator | Microsoft FS MVP
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [FSX] Drawcall "batching" in FSX SP2 | hcornea | GMax and 3DS Max | 2 | 30-07-2009 19:55 |
| LODs & Gmax | gzealot | GMax and 3DS Max | 2 | 05-05-2009 08:36 |
| FSX and LOD's | Larry S | GMax and 3DS Max | 4 | 13-06-2007 04:20 |
| Texture problem & LOD's question | dal | GMax and 3DS Max | 4 | 06-02-2007 17:24 |
| LODs with Max and X2mdl | Darren | GMax and 3DS Max | 11 | 07-11-2006 04:57 |