|
|
|
| View previous topic :: View next topic |
DavidT
Joined: 12 Oct 2009 Posts: 14 Location: Adelaide, SA
|
Posted: Thu Nov 05, 2009 10:55 pm Post subject: Draw calls & prefabs |
|
|
|
My paranoia tells me to keep draw calls down wherever possible. I noticed that as I instantiate multiple copies of the same prefab in code, my draw calls go up (typically by 2 for each new object due to the shader I'm using).
So, if I have a Gauntlet or Robotron style game where I'm spawining lots of objects from the same prefab, how do I keep my draw calls down to a reasonable number? |
|
| Back to top |
|
|
tonyd

Joined: 02 Jun 2009 Posts: 308 Location: USA
|
Posted: Fri Nov 06, 2009 12:38 pm Post subject: |
|
|
|
If your objects share the same material, dynamic batching should reduce their draw calls down to 1 (or 2, in your case). _________________ Froggy Math
http://www.mindspring.com/~torajima/meganesoft |
|
| Back to top |
|
|
steddyman
Joined: 10 Apr 2009 Posts: 144 Location: UK
|
Posted: Sat Nov 07, 2009 11:53 am Post subject: |
|
|
|
This is only true if your meshes contain less than 300 verts That is the maximum number of verts that dynamic batching operates on. _________________ Ascii Studios
Blog: www.asciistudios.com
Twitter Web: http://twitter.com/asciistudios
Twitter ID: @asciistudios |
|
| Back to top |
|
|
Eric5h5
Joined: 19 Jul 2006 Posts: 6930
|
Posted: Sat Nov 07, 2009 12:14 pm Post subject: |
|
|
|
Since this isn't posted in the iPhone section, I'd assume the question is about Unity, which has no dynamic batching.
--Eric |
|
| Back to top |
|
|
DavidT
Joined: 12 Oct 2009 Posts: 14 Location: Adelaide, SA
|
Posted: Sun Nov 08, 2009 11:12 pm Post subject: |
|
|
|
Eric you're correct. Although I'll eventually be targeting iPhone, I'm getting up to speed with regular Unity first. So this question is for regular Unity.
I'm still unsure what to do if I want to instantiate lots of low poly (think cubes) objects from within code and keep my draw calls down to something sensible. |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|
|
|