Z order and Material priority – ShiVa Engine

Z order and Material priority

In certain scenarios, the ShiVa engine might have difficulties sorting your scene correctly. Especially when you are dealing with alpha-transparent 32 bit textures on mobiles, you should help the engine by setting material priorities and zorder values accordingly.

Material Priority

ShiVa Materials come with a standard material priority of 127. In the next picture, the green and the red ball both have a material priority of 127.
Higher priorities are rendered before lower ones. That means, Priority 126 renders in front of 127, because 127 is drawn first, 127 has a higher priority.
In the next picture, the green ball has a material priority of 126:

Priority and Auto Batching

Material Priorities play an important role in the Batching process. As you can see from our Batching Tutorial, each batch material group should each use another material priority, different from the default 127, and also different from one another, to help the engine.


ShiVa HUDs come with a standard ZOrder priority of 127. By Default, ShiVa arranges the HUD according to the stack order in the HUD editor, with components higher up on the stack being rendered in front of lower ones:
HUD ZOrder works seemingly opposite to Material Priorities. Higher Zorder numbers are rendered after lower ones. That means, Zorder 128 renders before 127, because 128 is drawn after 127.
In order to make the list component appear in front of the Label (127), you have to set its Zorder to 128.

Need more answers?

  • slackBanner