Hello Spine!
I am using 4.1 and the Spine/Sprite/Vertex Lit and want to be able to toggle on/off the outline using code. I can't find any documentation on which specific shader property to modify. OutlineWidth doesn't seem to do anything on its own, and there is no boolean. How can I toggle the outline like I would a boolean?
Page 1 of 1
blackvoyagegames
2 months ago
- blackvoyagegames
- Posts: 3
Misaki
Welcome to the Spine forum!
You can switch the visibility of outlines by preparing a material with enabling outline and a material disabling outline and overriding the applied material of the skeleton. An example scene
You can switch the visibility of outlines by preparing a material with enabling outline and a material disabling outline and overriding the applied material of the skeleton. An example scene
Spine Examples/Other Examples/Outline Shaders
demonstrates it and would be helpful. 2 months ago
-
Misaki - Posts: 1164
Harald
The reason why changing a bool property does not work is due to the fact that the Spine shaders use a custom UI which essentially switches to a different shader. E.g. when enablingblackvoyagegames wrote: I can't find any documentation on which specific shader property to modify. OutlineWidth doesn't seem to do anything on its own, and there is no boolean. How can I toggle the outline like I would a boolean?
Outline
at a material using the shader Spine/Skeleton
will be changed to Spine/Outline/Skeleton
.If you are interested in why that is necessary: the outline shaders require an additional pass, while parameters cannot be used to enable or disable shader passes, they can only be used to enable or disable
#ifdef
code branches within a pass. 2 months ago
-
Harald - Posts: 4459
Mark topic unread
• Page 1 of 1
Return to Unity
- All times are UTC