- Home /
Setting Sort order vs. Z value - which is better?
I'm setting up a 2D game with Unity's 4.3+ 2D system.
I'm setting all my characters, backgrounds etc up with different sorting layers and sorting orders to make sure they appear as they should.
I was wondering if that is less efficient than setting up their Z values instead. How much less/more efficient is it?
What about with 3D meshes? Does the same hold true for them in a 2D scene?
Please accept my answer. If you don't know how, watch the tutorial video on the right.
Answer by Benproductions1 · May 19, 2014 at 09:28 AM
Don't quote me on it, but Z-culling is basically free on all graphics cards. You'd almost always get better performance by using the z-buffer for object ordering, than rendering all your objects in a certain order. <- For 2D
In 3D, unless you have a perfectly set up scene, not using z-culling will really screw with your rendering.
Your answer
Follow this Question
Related Questions
Allow for sorting between different sorting layers 0 Answers
Is there a way to adjust canvas z-ordering while using Alphabetical Sort in the Hierarchy? 2 Answers
Is there a way to sort UI elements overriding the hierarchy? 0 Answers
How to sort a array of gameobjects same as hirearcy react 0 Answers
Separate particle systems rendered together with a single sorting mode? 0 Answers