- Home /
Dynamic Batching + VertexLit + PointLight = 1 Draw call?
Scenario: I have a script that adds and positions hundreds of prefabs, the prefabs are just geometry. The Prefabs are all less than 20 polygons and all have the same shader/materiel "the stock Transparent/Cutout/Vertexlit".
On daylight scenes that use only directional lights the scene is batched and I only have 2 or 3 draw calls for the geometry.
But on inside scenes like caves were I use a single point light to light each void in the cave system, the scene is not batched.
Question Why does using point lights stop batching? I assume it is because the shader is using multiple passes to render the lights. but I thought that VertexLit shaders only used one pass? Is there a shader that will use a single pass to render point lights?
Thank you.
I am now testing with the stock VertexLit shader "with no transparencies" and in both forward and VertexLit render modes.
I am still getting the same results.
I could combine the mesh but I have the parts going inactive when outside the camera's field of view.
Any ideas does not necessarily have to answer the question just solve the problem?
Answer by Julien-Lynge · Feb 02, 2013 at 02:11 AM
One possible reason, in the words of Aras:
Q: Does the transparent Queue have different rules for batching?
A: It doesn't have any effect on batching per se, but indirectly might affect it. Transparent render queues essentially mean "please draw these objects in furthest-to-closest order" (regular opaque queues mean "draw them in any order you like").
So the transparent objects will be sorted back-to-front and drawn in that order. If sequences of them within that order can be batched, they will be batched. If they can't, they won't.
Setting the shader to plain VertexLit "without transparency" has the same effect, I get loads of draw calls. So i don't think its the transparency issue as the daylight scene is fine!
Well, it was a good try :)
Not sure about point lights and vertex-lit - hopefully someone else will be able to help you.
Your answer
Follow this Question
Related Questions
Do Dynamic Batching before Light pass. 0 Answers
Spawn enemies in dark 2 Answers
Why isn't dynamic batching working? 3 Answers
How do i make night and day transitions 3 Answers