- Home /
Mark object do not batch it dynamic
Hi, I have a problem. In my game I'm firing a bullets which are just planes rotated up on camera, and scaled with a distance. The problem is in scaling, i want to do it using a custom shader (it's easy to scale in vertex program, just multiplying object space coordinates) BUT! so as i use a prefab on my bullets (same mesh, same material) unity batched it! and so i have a completely different object space coordinates in vertex program
How can I mark object, something like "do not batch" or whatever, so that unity will not batch my bullets.
PLEASE! DO NOT OFFER Me using a transform.localScale, or something like, I want to scale from my shader!
Just tell me, if exist some way I can switch off dynamic batching on objects what i want.
AND DO NOT OFFER Me switch off dynamic batching in player settings.
Answer by GearKlik · Jan 22, 2016 at 01:15 PM
Sorry to resurrect this thread, but for future wanderers you can do this now per shader by adding "DisableBatching" = "True" to the tags
Reviving this. Was just trying this to fix a bug, I'm quite confident I have used this before but it might not be working anymore. Android build, DisableBatching = True for shadow caster pass, since I'm doing vertex animation from the pivot of the object. It doesn't work, shadows fly around as that pivot center is lost with Dynamic Batching.
Answer by Jessy · Jun 15, 2012 at 06:39 PM
No, there's nothing like what you're asking at present. You'll have to get creative, like redundantly storing your positions in another vertex attribute.
Answer by jamesk5 · Sep 12, 2016 at 11:38 PM
Why don't you adjust the material via script. I think dynamic batching requires the use of the property sharedMaterial, and so using the material property will create a copy or something. look it up, it may disable batching.
EDIT: oh wow didn't realize this thread was so old.
Old and, more importantly, solved :) The solution is to set "DisableBatching" = "True" in the shader (although this wasn't possible when the question was first asked).
Your answer
Follow this Question
Related Questions
RectTool scale in both direction,RectTool scale in both directions 0 Answers
Accidentally did 'something' and now positioning is all out of whack (canvas, camera, scaling?) 0 Answers
Outline Objects and show even if Obstructed. 1 Answer
Batching objects problem 1 Answer
Dynamic batching is not done. 1 Answer