Skip to content

Commit

Permalink
Reorganize UI shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
drewcassidy committed Jul 24, 2024
1 parent f1115ef commit 321b2a4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Shader "ConformalDecals/UI/Color Slider"
{
_Color("Color", Color) = (0,0,0,0)
_Radius("Radius", Float) = 4

_OutlineGradient("Outline Gradient Step", Range (0, 1)) = 0.6
_OutlineOpacity("Outline Opacity", Range (0, 0.5)) = 0.1
_OutlineWidth("Outline Width", Float) = 3

_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
Expand All @@ -18,13 +18,11 @@ Shader "ConformalDecals/UI/Color Slider"
_ColorMask ("Color Mask", Float) = 15

[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0

[Toggle(HUE)] _Hue ("Hue", int) = 0
[Toggle(RED)] _Red ("Red", int) = 0
[Toggle(GREEN)] _Green ("Green", int) = 0
[Toggle(BLUE)] _Blue ("Blue", int) = 0


}
SubShader
{
Expand All @@ -44,14 +42,14 @@ Shader "ConformalDecals/UI/Color Slider"
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}

Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]

Pass
{
CGPROGRAM
Expand All @@ -63,7 +61,7 @@ Shader "ConformalDecals/UI/Color Slider"
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "HSL.cginc"
#include "SDF.cginc"
#include "../SDF.cginc"

#pragma multi_compile_local _ UNITY_UI_CLIP_RECT
#pragma multi_compile_local _ UNITY_UI_ALPHACLIP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Shader "ConformalDecals/UI/HSV Square"
_OutlineGradient("Outline Gradient Step", Range (0, 1)) = 0.6
_OutlineOpacity("Outline Opacity", Range (0, 0.5)) = 0.1
_OutlineWidth("Outline Width", Float) = 3

_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
Expand Down Expand Up @@ -37,14 +37,14 @@ Shader "ConformalDecals/UI/HSV Square"
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}

Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]

Pass
{
CGPROGRAM
Expand All @@ -56,7 +56,7 @@ Shader "ConformalDecals/UI/HSV Square"
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "HSL.cginc"
#include "SDF.cginc"
#include "../SDF.cginc"

#pragma multi_compile_local _ UNITY_UI_CLIP_RECT
#pragma multi_compile_local _ UNITY_UI_ALPHACLIP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Shader "ConformalDecals/UI/Color Swatch"
{
_Color("Color", Color) = (0,0,0,0)
_Radius("Radius", Float) = 4

_OutlineGradient("Outline Gradient Step", Range (0, 1)) = 0.6
_OutlineOpacity("Outline Opacity", Range (0, 0.5)) = 0.1
_OutlineWidth("Outline Width", Float) = 3

_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
Expand Down Expand Up @@ -37,14 +37,14 @@ Shader "ConformalDecals/UI/Color Swatch"
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}

Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]

Pass
{
CGPROGRAM
Expand All @@ -56,7 +56,7 @@ Shader "ConformalDecals/UI/Color Swatch"
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "HSL.cginc"
#include "SDF.cginc"
#include "../SDF.cginc"

#pragma multi_compile_local _ UNITY_UI_CLIP_RECT
#pragma multi_compile_local _ UNITY_UI_ALPHACLIP
Expand Down
File renamed without changes.

0 comments on commit 321b2a4

Please sign in to comment.