CarmenSandiego/Assets/Shaders/Light Strip.shader
Jamie Greunbaum 39e227f264 - Added ability for players without camera permissions to watch camera output.
- Added a tablet spawner to let players view said camera output.
- Added many more reflection probes to the alleyway to try to fill in gaps.
- Moved round 2 signage around to fit in the camera view better.
- Round 2 sign text changed to use SDF textures for better clarity.
- Created better gizmo icons for CameraAnchor and CameraSwitcher.
- Light strip on modem now uses an already-available SDF texture.
- Performance mode is now the default camera mode.
2026-04-23 03:50:44 -04:00

68 lines
1.9 KiB
Plaintext

Shader "Carmen/SDF/Light Strip"
{
Properties
{
_MainTex ("_MainTex", 2D) = "white" {}
_Color ("Color", Color) = (1,1,1,1)
_Glow ("Glow", Range(0.0, 100.0)) = 0.0
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent" }
LOD 200
Pass {
Cull Off
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert
#pragma fragment frag
UNITY_DECLARE_TEX2D(_MainTex);
float4 _MainTex_ST;
fixed4 _Color;
half _Glow;
struct Data
{
float4 vertex : POSITION;
float4 normal : NORMAL;
float2 uv : TEXCOORD0;
};
struct V2F
{
float4 position : SV_POSITION;
float2 uv : TEXCOORD0;
};
V2F vert(Data v)
{
V2F o;
o.position = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag(V2F i) : SV_TARGET
{
half _LineThickness = 0.05;
half sdf_sample = UNITY_SAMPLE_TEX2D(_MainTex, i.uv).r;
half sdf_halfchange = (abs(ddx(sdf_sample)) + abs(ddy(sdf_sample))) / 2.0;
half alphastep_loweredge = (1.0 - _LineThickness) - sdf_halfchange;
half alphastep_upperedge = (1.0 - _LineThickness) + sdf_halfchange;
half alphastep = saturate((sdf_sample - alphastep_loweredge) / (alphastep_upperedge - alphastep_loweredge));
//half3 Tex = UNITY_SAMPLE_TEX2D(_MainTex, i.uv).rrr;
//if (Tex.r < 0.9) discard;
return fixed4((_Color * (_Glow + 1.0)).rgb, alphastep.r);
}
ENDCG
}
}
FallBack "Diffuse"
}