mirror of
https://github.com/scrtwpns/mixbox.git
synced 2026-03-19 22:49:41 +01:00
46 lines
1.3 KiB
Plaintext
46 lines
1.3 KiB
Plaintext
Shader "Mixbox/Mixbox Sample Shader"
|
|
{
|
|
Properties
|
|
{
|
|
[NoScaleOffset] _MixboxLUT ("Mixbox LUT", 2D) = "white" {} // assign "Packages/Mixbox/Textures/MixboxLUT.png"
|
|
|
|
_Color1 ("Color 1", Color) = (0, 0.129, 0.522, 1) // blue
|
|
_Color2 ("Color 2", Color) = (0.988, 0.827, 0, 1) // yellow
|
|
}
|
|
SubShader
|
|
{
|
|
Pass
|
|
{
|
|
CGPROGRAM
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#include "UnityCG.cginc"
|
|
|
|
sampler2D _MixboxLUT;
|
|
#include "Packages/com.scrtwpns.mixbox/ShaderLibrary/Mixbox.cginc"
|
|
|
|
fixed4 _Color1;
|
|
fixed4 _Color2;
|
|
|
|
struct appdata { float4 vertex : POSITION; float2 uv : TEXCOORD0; };
|
|
struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; };
|
|
|
|
v2f vert (appdata v)
|
|
{
|
|
v2f o;
|
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
|
o.uv = v.uv;
|
|
return o;
|
|
}
|
|
|
|
fixed4 frag (v2f i) : SV_Target
|
|
{
|
|
fixed4 mixedColor = MixboxLerp(_Color1, _Color2, i.uv.x);
|
|
return mixedColor;
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
}
|