Props vs. Geometry

BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
edited August 2014 in Mapping
Had an interesting discovery today... I had known for a long time that the giant cliff in the outside of ns2_temple was probably the biggest cause of the ~2200 draw calls in certain areas. It seems the engine tessellates large faces so they can be rendered easier. Partly inspired by this discussion here I decided to run a little experiment: What runs faster: all that geo sitting in the level, or converting all that geo to ONE prop (no instancing... just ONE prop). The results are... shocking to say the least.

In the first screenshot here, this is with the geo as it is now in the published version. Standing on top of the ship and looking towards South West West, you'll get about 2200-2300 draw calls. Looking at the scene in wireframe mode, I can see that the large faces of the cliff in the distance are being tesselated quite a bit, drastically increasing the polycount.
1735519076f3d1126e79ed777117c7.jpg

In the second screenshot here, the geometry is completely gone, and in its place is a perfect, 1:1 conversion (not including texture coordinates :P) of the cliffs, as a single prop. Take a look at those draw calls. I'm standing in almost the exact same spot (though it doesn't make too much of a difference... 4-5 feet away and the draw calls are roughly the same for this position), and the draw calls have dropped by almost eight HUNDRED. That's a roughly 35% drop in draw calls, and all I had to do was turn it into a prop!
1d0c03d94fef329dad3a1cd6bf8599.jpg

All I did was copy+paste the cliffs into a separate instance of Spark, save as an OBJ, import that into Blender, UV unwrap it, export that as an OBJ again and import into Max (I don't know how to unwrap in max :(, otherwise I'd just go straight to Max and skip Blender), and export as a DAE from Max, change the texture paths, and drop that into my mod project.

That being said, my actual framerate didn't change by much at all (~2 frame difference), but again my map is far from the level of detail of the stock maps, and many other customs. Perhaps this would have a more profound effect if lots of duplicated geo was replaced with props? (Hmm... a one-click tool solution might be in order here... hmmm).

Though it's also worth noting that the cliffs have no collision geometry whatsoever, so this process of converting geo to props would be much more involved with parts of the level where you actually need to be able to collide with them.

Comments

  • JoseppeJoseppe Join Date: 2012-01-21 Member: 141497Members
    BeigeAlert wrote: »
    All I did was copy+paste the cliffs into a separate instance of Spark, save as an OBJ, import that into Blender, UV unwrap it, export that as an OBJ again and import into Max (I don't know how to unwrap in max :(, otherwise I'd just go straight to Max and skip Blender), and export as a DAE from Max, change the texture paths, and drop that into my mod project.

    Is there a step-by-step tutorial ? which version of 3ds max (probably 2009) ?

  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    Joseppe wrote: »
    BeigeAlert wrote: »
    All I did was copy+paste the cliffs into a separate instance of Spark, save as an OBJ, import that into Blender, UV unwrap it, export that as an OBJ again and import into Max (I don't know how to unwrap in max :(, otherwise I'd just go straight to Max and skip Blender), and export as a DAE from Max, change the texture paths, and drop that into my mod project.

    Is there a step-by-step tutorial ? which version of 3ds max (probably 2009) ?

    2009, yup.

    The only thing really stopping it from being a 100% automated process is the texture alignment being so different in the way props work vs. how spark uses textures.
  • LokiLoki Join Date: 2012-07-07 Member: 153973Members, Forum Moderators, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    if you had asked me I could have told you this long ago :D
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    There are advantages (fewer draw calls), and disadvantages (less control over occlusion) to this test-case. It comes down to right-tools for the right job. For something such as this, I would recomend breaking that massive prop into multiple ones.
  • deathshrouddeathshroud Join Date: 2010-04-10 Member: 71291Members
    thats why ns2 offical maps are very prop heavy
Sign In or Register to comment.