Home Technical Talk

Separate Assets vs Multiple draw calls

polycounter lvl 19
Offline / Send Message
TorQue[MoD] polycounter lvl 19
Ok, so I've got another technical question and decided to make a separate post in case there are others looking for similar info that's not related to my Overlapping vs Wasted space post.

I'm currently working on a Castle environment that I'm going to be putting together in UDK. I'm using modular pieces with some tiling and some non-tiling textures. What I'm trying to figure out is the optimal way to go about exporting these assets to the engine and putting them together. For example, I have the Castle Walls assets that are currently two separate meshes. The wall itself which uses two tiling textures and the Merlons which use 1 non-tiling texture:
castle_wall_breakdown.jpg

My quandary comes from not knowing if it will be more beneficial to leave the Merlons and Wall as separate meshes, or attach them together and export as one piece. They're never going to be used separately but I'm a little unclear about the technical reasoning behind leaving them as separate meshes.

Firstly, I know that its beneficial to have the mesh broken into several pieces if there's a chance that part of the mesh won't be seen and can be occluded or culled from the scene. For example, if I leave them as two separate meshes and someone stands at the base of the wall, then the Merlons should be far enough away for UDK to cull them based on camera distance. So this is a definite plus.

I've also heard that if a mesh uses multiple textures then it means a separate draw call for each texture. The wall, having two textures would need to be drawn twice per frame and the Merlons once per frame for a total of 3 draw calls. But if the Merlons are ALWAYS going to be used with the wall, is it really beneficial to leave them as a separate mesh since its going to require 3 draw calls anyway? I guess if they're culled when they're out of view then it would reduce the number down to 2 draw calls but only if occluded.

Finally, I've also heard that although instancing is great and what UDK excels at, its possible to go too far. For example, if I took the Merlons mesh and broke it down into 8 assets (1 mesh per "tooth") then it would actually negatively affect the scene because there are so many more assets to draw? I'm basing this off the Foliage tutorial by Damian Lazarski that I watched on 3D Motive. Damian suggests that you should make your grass clumps as big as possible - within reason - so that you're not bogging down the system by forcing it to render so many separate meshes. Is this true? Because I've also heard that instancing works by having one draw call for every instance regardless of how many of them are in the scene so these two statements seems to go against each other.


Thanks!

Replies

  • ZacD
    Options
    Online / Send Message
    ZacD ngon master
    Merge everything you can to reduce draw calls. What counts as a draw call varies between engines. I know a one point Unity (it actually still may be true) counted any floating geometry as a seperate draw call even if they were part of one model.

    It's typically best to work with as large of pieces as possible when trying to make a level, but don't allow that to cause you to make things less unique and more tiled.
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Interesting. But what about the fact that multiple textures used on one mesh will also count as a separate draw call? I guess this is going to happen regardless of whether or not the meshes are separate or one piece?
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    I'd just join them together - it's going to be a nuisance placing the two objects together like that every time you want to place a wall.

    Udk counts each section as a drawcall. A section is split by material ID then split again at the object level. So your wall is going to be two sections no matter what you do.
  • chriszuko
    Options
    Offline / Send Message
    chriszuko polycounter lvl 12
    Yep just combine the 2 together. It would be awesome to have them be all the same material, but if you are just going to place them together then its just better to have them combined. Unreal has draw call limits and asset limits. The more objects that it needs to cull out can end up being expensive even if they aren't even seen. That on top of draw call limits just makes it better off to have less objects placed even if a few of them have a couple mat ID's on them.
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Cool guys. Thanks for clearing that up for me :)
Sign In or Register to comment.