FSDeveloper Community

Go Back   FSDeveloper Community > Developers coffee house > General chat

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2010, 13:34
arno's Avatar
arno arno is offline
  Users Flag!
Location: Amsterdam
Join Date: May 2004
Posts: 12,588
Send a message via ICQ to arno Send a message via AIM to arno Send a message via MSN to arno Send a message via Yahoo to arno Send a message via Skype™ to arno
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.
Attached Thumbnails
Click image for larger version

Name:	Image2010-01-03 1909.09.787.jpg
Views:	154
Size:	53.9 KB
ID:	6586   Click image for larger version

Name:	Image2010-01-03 1933.32.483.jpg
Views:	134
Size:	28.4 KB
ID:	6587  
__________________
Arno
If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

Quick links: Wiki | Download center | Blog
Reply With Quote
  #2  
Old 03-01-2010, 22:47
fergusdog fergusdog is offline
  Users Flag!
Join Date: Apr 2007
Posts: 9
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.
Reply With Quote
  #3  
Old 04-01-2010, 03:47
arno's Avatar
arno arno is offline
  Users Flag!
Location: Amsterdam
Join Date: May 2004
Posts: 12,588
Send a message via ICQ to arno Send a message via AIM to arno Send a message via MSN to arno Send a message via Yahoo to arno Send a message via Skype™ to arno
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.

Quick links: Wiki | Download center | Blog
Reply With Quote
  #4  
Old 04-01-2010, 07:43
decapod's Avatar
decapod decapod is offline
  Users Flag!
Location: Carshalton
Join Date: Apr 2007
Posts: 116
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
Reply With Quote
  #5  
Old 04-01-2010, 08:48
arno's Avatar
arno arno is offline
  Users Flag!
Location: Amsterdam
Join Date: May 2004
Posts: 12,588
Send a message via ICQ to arno Send a message via AIM to arno Send a message via MSN to arno Send a message via Yahoo to arno Send a message via Skype™ to arno
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.

Quick links: Wiki | Download center | Blog
Reply With Quote
  #6  
Old 16-01-2010, 09:58
hcornea's Avatar
hcornea hcornea is offline
  Users Flag!
Location: Australia
Join Date: Apr 2007
Posts: 271
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
Reply With Quote
  #7  
Old 16-01-2010, 19:15
hcornea's Avatar
hcornea hcornea is offline
  Users Flag!
Location: Australia
Join Date: Apr 2007
Posts: 271
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
Reply With Quote
  #8  
Old 18-01-2010, 00:37
Heretic's Avatar
Heretic Heretic is offline
  Users Flag!
Location: Wismar
Join Date: Feb 2007
Posts: 249
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
Reply With Quote
  #9  
Old 22-01-2010, 15:30
arno's Avatar
arno arno is offline
  Users Flag!
Location: Amsterdam
Join Date: May 2004
Posts: 12,588
Send a message via ICQ to arno Send a message via AIM to arno Send a message via MSN to arno Send a message via Yahoo to arno Send a message via Skype™ to arno
Hi,

Quote:
Originally Posted by hcornea View Post
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?
For pure scientific results you are probably right, I should have used the same material for all LODs. But since we know that working LODs prevent drawcall batching it does not matter that much, each object will be one drawcall anyway.

Quote:
Originally Posted by hcornea View Post
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?
Good question, I think the amount of triangles where the preference between LODs and batching changes might depend on texture size and those parameters. But the general results should not depend too much on what kind of material you have.

Quote:
Originally Posted by hcornea View Post
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?
All MDL files as far as I know, but I would have to double check to be sure. So I think with GMax you never get batching.
__________________
Arno
If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

Quick links: Wiki | Download center | Blog
Reply With Quote
  #10  
Old 23-01-2010, 19:22
hcornea's Avatar
hcornea hcornea is offline
  Users Flag!
Location: Australia
Join Date: Apr 2007
Posts: 271
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
Reply With Quote
  #11  
Old 24-01-2010, 05:41
arno's Avatar
arno arno is offline
  Users Flag!
Location: Amsterdam
Join Date: May 2004
Posts: 12,588
Send a message via ICQ to arno Send a message via AIM to arno Send a message via MSN to arno Send a message via Yahoo to arno Send a message via Skype™ to arno
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.

Quick links: Wiki | Download center | Blog
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -4. The time now is 23:18.

Kirsch designed by Andrew & Austin


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.