- Home /
The question is answered, right answer was accepted
Serious Drawcall Issues
I have done a ton of research, and I thought I understood drawcalls. Obviously I don't ={
I have a wall setup this way.
It contains 4 small cubes with scale of .5,.5,.5 They have the same material and scale so they should batch!
When they are alone in the scene, they product one drawcall, perfect!
(This is 3 walls with 4 small cubes each)
Now, I copy two of those smaller cubes, unparent them, and make them a scale of 1,1,1
I have 6 drawcalls...?
Then, I move the 3 walls away from the 2 cubes I just created.
My drawcalls decrease????
What I should have in this scene are 3 drawcalls.
The GUITexture (vignette)
The 4 small cubes
The 2 large cubes
What am I missing?
Thanks!!!
EDIT: When I put the 3 walls underneath the 2 pink cubes, the drawcalls are what their suppose to be no matter their position. What is happening ={
hey bud, are your gameobjects set to receive shadows or any extra lighting at all? Cheers. Gruffy
Nope, I already turned off cast / receive shadow.
This is the shader I am using.
Shader "VertexColor" {
Properties {
_Color ("$$anonymous$$ain Color", Color) = (1,1,1,1)
}
SubShader {
Tags {Queue=Transparent}
Blend SrcAlpha One$$anonymous$$inusSrcAlpha
Pass
{
Color$$anonymous$$aterial Emission
}
}
Fallback "VertexLit", 1
}
This is really frustrating, and I appreciate your response! I just don't understand how it can increase in drawcalls as the 3 walls gets closer to those 2 pink cubes.
I see.... could you pack this up into a package, zip it up and upload it here. i will take a look. I think max package size is 512kb and I always seem to have to zip anything I upload here to get it accepted (seems odd tom e that u cant upload a .package, but then it may just be me)
Are you doing any level of detail stuff? It just seems odd that the vertex count went down in the last image you posted. Actually, it all seems odd. Is occlusion culling enabled? The last image looks orthographic on the top cubes. $$anonymous$$aybe the back cubes are being culled out.
@Gruffy Thanks for the help! I took out all the plugins (rotorz, 2D toolkit) and got it down to bare bones. It still is not working. Here is the unitypackage. Dropbox
Thanks again!
The last image is putting the walls on a lower z.
Also, I am not doing any level details.
Yes, occlusion culling is enabled.
All I am using is vertex color with the same material. In those images, the only two scales I have are .5,.5,.5 and 1,1,1
Thanks for your help!
Answer by MousePods · Mar 26, 2014 at 08:52 PM
Future Readers:
I got the answer from the helpful people over at Rotorz Tile System! (which, btw, you should check out! Their system is simply amazing!)
The Issue: Multiple scales will break the dynamic batching.
The Solution: Generate a mesh in unity and save it using AssetDatabase. Then you have a scale of 1,1,1 but its really at another size.
If you want this code, just pm me.