- Home /
Why does changing a shader's Render Queue affect the pivot point of transform matrices?
I have been messing around with skewing vertex and uv map coordinates in a shader.
I acheived the effect that I wanted but when I change the render queue from Transparent to AlphaTest It's as if the pivot point moves or the transform' matrix behavior changes.
Basicly, the result of using my transform matrix changes and since im very new to unity I dont understand what is going on. I even read the manual.
What is going? What did I miss?
Thank you!
Answer by tanoshimi · Feb 19, 2017 at 06:03 PM
It shouldn't and it never has done for me. Most likely explanation I can suggest is that your changes are inadvertently enabling/disabling dynamic batching, which would cause the pivot point to become the "shared" pivot point of all meshes that were batched together using that material.
I have no clue if this is it yet, but thank you so much for giving something to investigate! I shall run tests and if you are right we shall make this an answer! Thank you!
Wow, that was it! I didn't exactly confirm it was dynamic batching as I dont know how (I'll just trust you on that one) but creating a unique material for one of the sprites fixed the issue for that one sprite.
Does this mean I will not be able to use batching on any of my sprites? or is there a way around that pivot issue while batching?
And while were at it does this mean that using the Transparent render queue disables dynamic batching?
BTW please create an answer so I can accept it!
Thank you so much!
If you want to do any kind of shader transformation in model-space coordinates, then yes you'll have to disable dynamic batching on that shader (add the "DisableBatching=true" tag, as explained at https://docs.unity3d.com/$$anonymous$$anual/SL-SubShaderTags.html)
Your answer
