AnyPortrait > Getting Started > 2.3. Clipping Layer

2.3. Clipping Layer


1.6.2



Clipping is a feature that uses the shape of another mesh as a mask to render only a portion of it.
This feature can be used to express features like a character's eyes and mouth.
You can set a clipping layer on a mesh to use the other mesh on the layer below as a mask.




When you open the mesh group, you can see that there is an arrow-shaped icon that is folded before the "Teeth" and "Tongue" meshes.
If you select the "Teeth" or "Tongue" mesh, you can see that the mesh is only partially rendered.
This is because the "Teeth" and "Tongue" meshes have Clipping Layer properties.
The Mask of the two meshes is the "Mouth" mesh just below.




As a test, let's turn off the clipping layer properties applied to the two meshes.
You will see that the image is rendered without any hidden parts.


When creating a character from a PSD file, the PSD file's clipping layer settings are applied to AnyPortrait, so clipping was automatically enabled in this example.
Click the Clipping button to easily set the mesh's clipping rendering.








Performance and conditions


Clipping layers work by utilizing command buffers and Render Textures.
Therefore, overusing this feature can significantly increase draw calls, degrading your game's rendering performance.


Clipping layers work in conjunction with cameras.
This means that the "camera rendering the character" must be automatically detected and properly prepared for clipping rendering.
It is also significantly affected by the render pipeline.
If the project, character settings, or scene configuration are not appropriate, clipping rendering will not function properly.
If clipping rendering is not working properly, please refer to the related page.