Draw Cells

DrakennzDrakennz Join Date: 2012-03-11 Member: 148620Members
<div class="IPBDescription">What are they, and why is having a lot bad?</div>So i recently jumped into my map and saw my draw cells at around 2000, i've heard that it bad to have more than 1000 so my question is what are they and how do i make them less if its needed?

Comments

  • Evil_bOb1Evil_bOb1 Join Date: 2002-07-13 Member: 938Members, Squad Five Blue
    In simple it is basically a set of information handled either by the cpu of given over to the gpu. Its a batch of calculations depending on what the game needs to draw in that scene for the client. More draw calls mean more information sent to the cup/gpu and so can reduce fps depending on how many draw calls the system can handle per second, the screen resolution and other factors.

    Top end rigs could handle 2000, surely way more, limiting the draw call to 1000 for example makes sure lower end computers can also run the map.

    I guess at this point you haven't included occlusion geometry and therefore the game is probably rendering the whole map in view, hence the high number of draw calls. I wouldn't worry too much about occlusion geometry until you have a version you want to release, and therefore according to your geometry you implement the occlusion geometry. You will definitely need occlusion geometry for a release though to ensure players have the proper experience.
  • DrakennzDrakennz Join Date: 2012-03-11 Member: 148620Members
    Cool thanks, bob - yeah no OCC yet, had a feeling it had something to do with that! thanks again.
  • Evil_bOb1Evil_bOb1 Join Date: 2002-07-13 Member: 938Members, Squad Five Blue
    Before detailing and once you have your basic layout, it can also be smart to put the OCC so you can analyze how much detail you want to put in a room before you reach the limit you have set yourself in draw calls. In start areas, even if they are big, it can be very smart to keep the draw calls relatively low because there will be many more calls from players and structures.
  • DrakennzDrakennz Join Date: 2012-03-11 Member: 148620Members
    hmmm ok, i may need to send you my map next time im on Steam so you can help me out with starting the OCC if you dont mind helping me out?
  • Evil_bOb1Evil_bOb1 Join Date: 2002-07-13 Member: 938Members, Squad Five Blue
    I don't mind but its not as difficult as it may sound. If you can make a map you can make OCC.

    I can show you how to start off for sure and do a mini tutorial like I did for grissi.
  • DrakennzDrakennz Join Date: 2012-03-11 Member: 148620Members
    <!--quoteo(post=1926044:date=Apr 17 2012, 10:48 AM:name=Evil_bOb1)--><div class='quotetop'>QUOTE (Evil_bOb1 @ Apr 17 2012, 10:48 AM) <a href="index.php?act=findpost&pid=1926044"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I don't mind but its not as difficult as it may sound. If you can make a map you can make OCC.

    I can show you how to start off for sure and do a mini tutorial like I did for grissi.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Yeah that would be great, what did you do for grissi?
  • Evil_bOb1Evil_bOb1 Join Date: 2002-07-13 Member: 938Members, Squad Five Blue
    <a href="http://dl.dropbox.com/u/42877240/g1.zip" target="_blank">A little line tool tutorial, using just the line too, create face, switch face.</a>
  • DrakennzDrakennz Join Date: 2012-03-11 Member: 148620Members
    wow yes please i'd love you to make one of those for me, BTW i learnt something new from what you did there for grissi.
  • zastelszastels Join Date: 2003-11-29 Member: 23731Members
    btw try turning off shadows for all the props that do not need them. By default all props cast shadows. I believe this could help.
  • Soylent_greenSoylent_green Join Date: 2002-12-20 Member: 11220Members, Reinforced - Shadow
    edited April 2012
    <!--quoteo(post=1926018:date=Apr 16 2012, 05:03 PM:name=Drakennz)--><div class='quotetop'>QUOTE (Drakennz @ Apr 16 2012, 05:03 PM) <a href="index.php?act=findpost&pid=1926018"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So i recently jumped into my map and saw my draw cells at around 2000, i've heard that it bad to have more than 1000 so my question is what are they and how do i make them less if its needed?<!--QuoteEnd--></div><!--QuoteEEnd-->

    A draw-call is when the CPU tells the GPU to draw something. The CPU doesn't send every triangle individually; it puts a bunch of triangles into one big batch and tells the GPU to store that in its memory. Then, whenever necessary it tells the GPU to draw that batch with these textures, these shaders etc.

    There are many reasons the map cannot be just one giant batch of triangles. There are a lot of things you don't want to draw because they cannot be seen by the player; they are occluded behind something. This means you have to split the level up into smaller chunks and draw(or not draw) each one individually.

    Each "chunk" of the level may contain different materials, different shaders etc. So those chunks get split up into a number of drawcalls as well. Depending on the chosen API and hardware capabilities, some drawcalls can be combined into a single one(e.g. geometry instancing can draw a model many times with various different location, orientations, scale and other properties in one call). Older hardware and older APIs(NS2 uses DX9) may have to draw things in multiple passes where as newer hardware on a newer API can combine it into a single draw call etc.

    You have to have fairly detailed knowledge of how NS2 renders things and what clever optimizations are possible to know the relative badness of different things. But just having lots of triangles in an area I do not believe will generate more draw calls just bigger batches. But having poorly occluded maps(being able to see much of the map from some point), lots of texture variety in an area, lots of prop variety in an area and many lights probably all generate lots of drawcalls.

    Shadow casting lights have to draw the level from the point of view of the light source. One would think this generates LOTS of draw calls. Any (unique if instanced)prop that casts shadows and is drawn by the light source should add another drawcall.
Sign In or Register to comment.