Props vs. Geometry
BeigeAlert
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
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.
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!
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.
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.
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!
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
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.