![esoteric software spine masks esoteric software spine masks](https://plintensive620.weebly.com/uploads/1/2/6/4/126454742/835067572.png)
#Esoteric software spine masks code
spine-as3 and spine-starling development with Visual Studio Code.We hope that these additions to our spine-unity runtime let you create even more visually impressive games and apps.
![esoteric software spine masks esoteric software spine masks](https://i.ytimg.com/vi/NJ4AIxdW4Ts/maxresdefault.jpg)
RectMask2D is more limited than the standard mask control, but gives better performance. In the example above, each of the three SkeletonGraphic objects has a parent with a RectMask2D component to constrain it to a rectangular area. A rect mask can be used to restrict SkeletonGraphic child elements to the rectangle of the parent element. The shaders used by SkeletonGraphic now support Unity's RectMask2D component. Unity UI - Rect masks and SkeletonGraphic CompareFunction.Greater for Mask Interaction - Visible Outside Mask.CompareFunction.LessEqual for Mask Interaction - Visible Inside Mask.CompareFunction.Disabled for Mask Interaction - None.The available Stencil Compare values are: This gives maximum flexibility to customize material management at runtime and lets you create more material variations than the three variations the runtime itself supports. Prefer to use the pregenerated masking materials when possible! Stencil Compare shader parametersĮvery shader shipped with our spine-unity runtime now exposes the Stencil Compare parameter for further customization. These materials are not shared between Skeleton Animation components and can incur overhead when generated frequently on-the-fly at runtime. When these pregenerated materials can not be found, for example because they were deleted via the Advanced section, copies of the default materials are created on-the-fly. When changing the Mask Interaction mode at runtime, the component will use the pregenerated materials if available. If the material is not present or has been deleted, it is generated again based on the default material. The Set button lets you reassign a link to the respective material to prepare them for runtime use.Note that other SkeletonAnimation components on other game objects might still reference the materials. The Delete button lets you clear the reference to the material and delete the underlying asset.The Clear button lets you clear references to unneeded materials.You can manage and optimize the generated materials via the Advanced section of the SkeletonAnimation component:
![esoteric software spine masks esoteric software spine masks](https://i.ytimg.com/vi/MEcXKh9A98g/maxresdefault.jpg)
This allows sharing the materials between many component instances and reduces overhead from generating materials on-the-fly at runtime. These additional material assets use the file suffixes _InsideMask and _OutsideMask, and are placed in the same folder as the original materials.īy default, a Skeleton Animation component keeps references to all generated materials. When switching mask interaction modes in the inspector outside of Play mode, additional material assets are generated for the respective Stencil Compare parameters. Visible Outside Mask: The sprite will be visible only in areas where a mask is not present.Visible Inside Mask: The sprite will be visible only in areas where a mask is present.None: The sprite will not interact with the masking system.The following mask interaction modes are supported: The SkeletonAnimation and SkeletonMecanim components now provide an additional Mask Interaction field in the inspector, mirroring the same mask interaction modes available in Unity's built-in SpriteRenderer component: It can be used to restrict Unity UI SkeletonGraphic objects to a rectangular area with better performance versus using a masking image. It supports all shaders shipped with the spine-unity runtime out of the box.Ī rect mask is a masking control similar to the sprite mask control. This feature is implemented for both the SkeletonAnimation and SkeletonMecanim components. We are happy to announce support for Unity sprite masks and Unity UI rect masks in our spine-unity runtime!Ī sprite mask can be used to either hide or reveal parts of a skeleton or group of skeletons based on a masking image.