The principle of implementation: in fact, the rendering queue is rendered first, and then the ztest is used to change the rendering occlusion relationship.
Ps:depth testing: Depth test, also called depth buffer. Only objects closest to the observer will be drawn. A depth of z, the smaller the value , indicates the closer to the observer , the greater the value represents the farther away from the Observer .
Specific procedures:
1, modify Ngui unlit-transparent colored Shader, change zwrite to ON.
2, create 3 panel, respectively, called Gameobject, Mask, cutout, respectively, create a Sprite,
3, the Panel's rendering mode to explicit, the render queue is changed to Gameobject, 3002 (Mask), 3001 (cutout), this step will be rendered according to Gameobject->cutout-> Mask in the order of rendering.
4, adjust their z-axis: Gameobject for 300,mask for 200,cutout for 100. This step causes the occlusion of the rendering to change, causing the cutout to block mask. Let's set the opacity of the sprite below mask to 1. The last magical thing came up!
Ngui using depth testing for novice boot masks