x


Dynamic batching (yep, again)

Hi, I know there's a ton of threads on dynamic batching (let's call it DB here) but I can't find an answer to my problems. I expect to be regular behavior but I would like to know what to do about it.

I set up a scene with a camera (no skybox), no light, (no shadows), diffuse shaders everywhere and the behavior is the following:

forward rendering - DB works for objects with little vertices/polygons (e.g. cubes, 100 tris object), doesn't work for objects with more tris. I expected Unity to put these objects into several batches (according to the 287 tris limit) but instead Unity just doesn't batch these object at all. What am I missing? I thought that the if you go over the 287 limit, the DB will still work, just in multiple batches. This doesn't happen however.

deferred lighting - DB doesn't work, 0 batched draw calls. Why is that? If the object is below the 287 tris limit AND it uses the Particles/Additive shader then DB works with deferred lightning.

Can you help me out here?

I seriously lack proper in-depth documentation of this subsystem.

more ▼

asked May 14 '12 at 09:17 PM

makaka gravatar image

makaka
67 7 8 9

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

http://docs.unity3d.com/Documentation/Manual/iphone-DrawCall-Batching.html

Batching dynamic objects has certain overhead per vertex, so batching is applied only to meshes containing less than 900 vertex attributes in total.

If your shader is using Vertex Position, Normal and single UV, then you can batch up to 300 verts and if your shader is using Vertex Position, Normal, UV0, UV1 and Tangent, then only 180 verts.

more ▼

answered Jul 27 '12 at 11:23 AM

ScroodgeM gravatar image

ScroodgeM
7.6k 2 6

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x425
x115
x102
x23
x2

asked: May 14 '12 at 09:17 PM

Seen: 729 times

Last Updated: Jul 27 '12 at 11:23 AM