-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
510 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
83 changes: 83 additions & 0 deletions
83
Packages/src/Samples~/Spine Support/Spine-SkeletonGraphic-Fill-SoftMaskable.shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// This is a premultiply-alpha adaptation of the built-in Unity shader "UI/Default" in Unity 5.6.2 to allow Unity UI stencil masking. | ||
|
||
Shader "Hidden/Spine/SkeletonGraphic Fill (SoftMaskable)" | ||
{ | ||
Properties | ||
{ | ||
_FillColor("FillColor", Color) = (1,1,1,1) | ||
_FillPhase("FillPhase", Range(0, 1)) = 0 | ||
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | ||
[Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 | ||
[Toggle(_CANVAS_GROUP_COMPATIBLE)] _CanvasGroupCompatible("CanvasGroup Compatible", Int) = 1 | ||
_Color ("Tint", Color) = (1,1,1,1) | ||
|
||
[HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Float) = 8 | ||
[HideInInspector] _Stencil ("Stencil ID", Float) = 0 | ||
[HideInInspector][Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Float) = 0 | ||
[HideInInspector] _StencilWriteMask ("Stencil Write Mask", Float) = 255 | ||
[HideInInspector] _StencilReadMask ("Stencil Read Mask", Float) = 255 | ||
|
||
[HideInInspector] _ColorMask ("Color Mask", Float) = 15 | ||
|
||
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 | ||
|
||
// Outline properties are drawn via custom editor. | ||
[HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 | ||
[HideInInspector][MaterialToggle(_USE_SCREENSPACE_OUTLINE_WIDTH)] _UseScreenSpaceOutlineWidth("Width in Screen Space", Float) = 0 | ||
[HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) | ||
[HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 | ||
[HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 | ||
[HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 | ||
[HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 | ||
[HideInInspector] _OutlineOpaqueAlpha("Opaque Alpha", Range(0,1)) = 1.0 | ||
[HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 | ||
} | ||
|
||
SubShader | ||
{ | ||
Tags | ||
{ | ||
"Queue"="Transparent" | ||
"IgnoreProjector"="True" | ||
"RenderType"="Transparent" | ||
"PreviewType"="Plane" | ||
"CanUseSpriteAtlas"="True" | ||
} | ||
|
||
Stencil | ||
{ | ||
Ref [_Stencil] | ||
Comp [_StencilComp] | ||
Pass [_StencilOp] | ||
ReadMask [_StencilReadMask] | ||
WriteMask [_StencilWriteMask] | ||
} | ||
|
||
Cull Off | ||
Lighting Off | ||
ZWrite Off | ||
ZTest LEqual | ||
Fog { Mode Off } | ||
Blend One OneMinusSrcAlpha | ||
ColorMask [_ColorMask] | ||
|
||
Pass | ||
{ | ||
Name "Normal" | ||
|
||
CGPROGRAM | ||
#pragma shader_feature _ _STRAIGHT_ALPHA_INPUT | ||
#pragma shader_feature _ _CANVAS_GROUP_COMPATIBLE | ||
#pragma vertex vert | ||
#pragma fragment frag_softmask | ||
#pragma target 2.0 | ||
|
||
#define ENABLE_FILL | ||
#include "Spine-SoftMask.cginc" // Add for soft mask (Spine) | ||
#pragma shader_feature_local _ SOFTMASK_EDITOR // Add for soft mask | ||
#pragma shader_feature_local _ SOFTMASKABLE // Add for soft mask | ||
ENDCG | ||
} | ||
} | ||
CustomEditor "SpineShaderWithOutlineGUI" | ||
} |
10 changes: 10 additions & 0 deletions
10
Packages/src/Samples~/Spine Support/Spine-SkeletonGraphic-Fill-SoftMaskable.shader.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
Packages/src/Samples~/Spine Support/Spine-SkeletonGraphic-Grayscale-SoftMaskable.shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// This is a premultiply-alpha adaptation of the built-in Unity shader "UI/Default" in Unity 5.6.2 to allow Unity UI stencil masking. | ||
|
||
Shader "Hidden/Spine/SkeletonGraphic Grayscale (SoftMaskable)" | ||
{ | ||
Properties | ||
{ | ||
_GrayPhase("Phase", Range(0, 1)) = 1 | ||
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | ||
[Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 | ||
[Toggle(_CANVAS_GROUP_COMPATIBLE)] _CanvasGroupCompatible("CanvasGroup Compatible", Int) = 1 | ||
_Color ("Tint", Color) = (1,1,1,1) | ||
|
||
[HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Float) = 8 | ||
[HideInInspector] _Stencil ("Stencil ID", Float) = 0 | ||
[HideInInspector][Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Float) = 0 | ||
[HideInInspector] _StencilWriteMask ("Stencil Write Mask", Float) = 255 | ||
[HideInInspector] _StencilReadMask ("Stencil Read Mask", Float) = 255 | ||
|
||
[HideInInspector] _ColorMask ("Color Mask", Float) = 15 | ||
|
||
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 | ||
|
||
// Outline properties are drawn via custom editor. | ||
[HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 | ||
[HideInInspector][MaterialToggle(_USE_SCREENSPACE_OUTLINE_WIDTH)] _UseScreenSpaceOutlineWidth("Width in Screen Space", Float) = 0 | ||
[HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) | ||
[HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 | ||
[HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 | ||
[HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 | ||
[HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 | ||
[HideInInspector] _OutlineOpaqueAlpha("Opaque Alpha", Range(0,1)) = 1.0 | ||
[HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 | ||
} | ||
|
||
SubShader | ||
{ | ||
Tags | ||
{ | ||
"Queue"="Transparent" | ||
"IgnoreProjector"="True" | ||
"RenderType"="Transparent" | ||
"PreviewType"="Plane" | ||
"CanUseSpriteAtlas"="True" | ||
} | ||
|
||
Stencil | ||
{ | ||
Ref [_Stencil] | ||
Comp [_StencilComp] | ||
Pass [_StencilOp] | ||
ReadMask [_StencilReadMask] | ||
WriteMask [_StencilWriteMask] | ||
} | ||
|
||
Cull Off | ||
Lighting Off | ||
ZWrite Off | ||
ZTest LEqual | ||
Fog { Mode Off } | ||
Blend One OneMinusSrcAlpha | ||
ColorMask [_ColorMask] | ||
|
||
Pass | ||
{ | ||
Name "Normal" | ||
|
||
CGPROGRAM | ||
#pragma shader_feature _ _STRAIGHT_ALPHA_INPUT | ||
#pragma shader_feature _ _CANVAS_GROUP_COMPATIBLE | ||
#pragma vertex vert | ||
#pragma fragment frag_softmask | ||
#pragma target 2.0 | ||
|
||
#define ENABLE_GRAYSCALE | ||
#include "Spine-SoftMask.cginc" // Add for soft mask (Spine) | ||
#pragma shader_feature_local _ SOFTMASK_EDITOR // Add for soft mask | ||
#pragma shader_feature_local _ SOFTMASKABLE // Add for soft mask | ||
ENDCG | ||
} | ||
} | ||
CustomEditor "SpineShaderWithOutlineGUI" | ||
} |
10 changes: 10 additions & 0 deletions
10
Packages/src/Samples~/Spine Support/Spine-SkeletonGraphic-Grayscale-SoftMaskable.shader.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
80 changes: 80 additions & 0 deletions
80
Packages/src/Samples~/Spine Support/Spine-SkeletonGraphic-Multiply-SoftMaskable.shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// This is a premultiply-alpha adaptation of the built-in Unity shader "UI/Default" in Unity 5.6.2 to allow Unity UI stencil masking. | ||
|
||
Shader "Hidden/Spine/SkeletonGraphic Multiply (SoftMaskable)" | ||
{ | ||
Properties | ||
{ | ||
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | ||
[Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 | ||
[Toggle(_CANVAS_GROUP_COMPATIBLE)] _CanvasGroupCompatible("CanvasGroup Compatible", Int) = 1 | ||
_Color ("Tint", Color) = (1,1,1,1) | ||
|
||
[HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Float) = 8 | ||
[HideInInspector] _Stencil ("Stencil ID", Float) = 0 | ||
[HideInInspector][Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Float) = 0 | ||
[HideInInspector] _StencilWriteMask ("Stencil Write Mask", Float) = 255 | ||
[HideInInspector] _StencilReadMask ("Stencil Read Mask", Float) = 255 | ||
|
||
[HideInInspector] _ColorMask ("Color Mask", Float) = 15 | ||
|
||
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 | ||
|
||
// Outline properties are drawn via custom editor. | ||
[HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 | ||
[HideInInspector][MaterialToggle(_USE_SCREENSPACE_OUTLINE_WIDTH)] _UseScreenSpaceOutlineWidth("Width in Screen Space", Float) = 0 | ||
[HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) | ||
[HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 | ||
[HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 | ||
[HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 | ||
[HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 | ||
[HideInInspector] _OutlineOpaqueAlpha("Opaque Alpha", Range(0,1)) = 1.0 | ||
[HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 | ||
} | ||
|
||
SubShader | ||
{ | ||
Tags | ||
{ | ||
"Queue"="Transparent" | ||
"IgnoreProjector"="True" | ||
"RenderType"="Transparent" | ||
"PreviewType"="Plane" | ||
"CanUseSpriteAtlas"="True" | ||
} | ||
|
||
Stencil | ||
{ | ||
Ref [_Stencil] | ||
Comp [_StencilComp] | ||
Pass [_StencilOp] | ||
ReadMask [_StencilReadMask] | ||
WriteMask [_StencilWriteMask] | ||
} | ||
|
||
Cull Off | ||
Lighting Off | ||
ZWrite Off | ||
ZTest LEqual | ||
Fog { Mode Off } | ||
Blend DstColor OneMinusSrcAlpha | ||
ColorMask [_ColorMask] | ||
|
||
Pass | ||
{ | ||
Name "Normal" | ||
|
||
CGPROGRAM | ||
#pragma shader_feature _ _STRAIGHT_ALPHA_INPUT | ||
#pragma shader_feature _ _CANVAS_GROUP_COMPATIBLE | ||
#pragma vertex vert | ||
#pragma fragment frag_softmask | ||
#pragma target 2.0 | ||
|
||
#include "Spine-SoftMask.cginc" // Add for soft mask (Spine) | ||
#pragma shader_feature_local _ SOFTMASK_EDITOR // Add for soft mask | ||
#pragma shader_feature_local _ SOFTMASKABLE // Add for soft mask | ||
ENDCG | ||
} | ||
} | ||
CustomEditor "SpineShaderWithOutlineGUI" | ||
} |
10 changes: 10 additions & 0 deletions
10
Packages/src/Samples~/Spine Support/Spine-SkeletonGraphic-Multiply-SoftMaskable.shader.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
80 changes: 80 additions & 0 deletions
80
Packages/src/Samples~/Spine Support/Spine-SkeletonGraphic-Screen-SoftMaskable.shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// This is a premultiply-alpha adaptation of the built-in Unity shader "UI/Default" in Unity 5.6.2 to allow Unity UI stencil masking. | ||
|
||
Shader "Hidden/Spine/SkeletonGraphic Screen (SoftMaskable)" | ||
{ | ||
Properties | ||
{ | ||
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | ||
[Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 | ||
[Toggle(_CANVAS_GROUP_COMPATIBLE)] _CanvasGroupCompatible("CanvasGroup Compatible", Int) = 1 | ||
_Color ("Tint", Color) = (1,1,1,1) | ||
|
||
[HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Float) = 8 | ||
[HideInInspector] _Stencil ("Stencil ID", Float) = 0 | ||
[HideInInspector][Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Float) = 0 | ||
[HideInInspector] _StencilWriteMask ("Stencil Write Mask", Float) = 255 | ||
[HideInInspector] _StencilReadMask ("Stencil Read Mask", Float) = 255 | ||
|
||
[HideInInspector] _ColorMask ("Color Mask", Float) = 15 | ||
|
||
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 | ||
|
||
// Outline properties are drawn via custom editor. | ||
[HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 | ||
[HideInInspector][MaterialToggle(_USE_SCREENSPACE_OUTLINE_WIDTH)] _UseScreenSpaceOutlineWidth("Width in Screen Space", Float) = 0 | ||
[HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) | ||
[HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 | ||
[HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 | ||
[HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 | ||
[HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 | ||
[HideInInspector] _OutlineOpaqueAlpha("Opaque Alpha", Range(0,1)) = 1.0 | ||
[HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 | ||
} | ||
|
||
SubShader | ||
{ | ||
Tags | ||
{ | ||
"Queue"="Transparent" | ||
"IgnoreProjector"="True" | ||
"RenderType"="Transparent" | ||
"PreviewType"="Plane" | ||
"CanUseSpriteAtlas"="True" | ||
} | ||
|
||
Stencil | ||
{ | ||
Ref [_Stencil] | ||
Comp [_StencilComp] | ||
Pass [_StencilOp] | ||
ReadMask [_StencilReadMask] | ||
WriteMask [_StencilWriteMask] | ||
} | ||
|
||
Cull Off | ||
Lighting Off | ||
ZWrite Off | ||
ZTest LEqual | ||
Fog { Mode Off } | ||
Blend One OneMinusSrcColor | ||
ColorMask [_ColorMask] | ||
|
||
Pass | ||
{ | ||
Name "Normal" | ||
|
||
CGPROGRAM | ||
#pragma shader_feature _ _STRAIGHT_ALPHA_INPUT | ||
#pragma shader_feature _ _CANVAS_GROUP_COMPATIBLE | ||
#pragma vertex vert | ||
#pragma fragment frag_softmask | ||
#pragma target 2.0 | ||
|
||
#include "Spine-SoftMask.cginc" // Add for soft mask (Spine) | ||
#pragma shader_feature_local _ SOFTMASK_EDITOR // Add for soft mask | ||
#pragma shader_feature_local _ SOFTMASKABLE // Add for soft mask | ||
ENDCG | ||
} | ||
} | ||
CustomEditor "SpineShaderWithOutlineGUI" | ||
} |
10 changes: 10 additions & 0 deletions
10
Packages/src/Samples~/Spine Support/Spine-SkeletonGraphic-Screen-SoftMaskable.shader.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.