Skip to content

Instantly share code, notes, and snippets.

@Teqqles
Last active September 24, 2018 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Teqqles/366add5ab39c7823d8e5935bd154f638 to your computer and use it in GitHub Desktop.
Save Teqqles/366add5ab39c7823d8e5935bd154f638 to your computer and use it in GitHub Desktop.
Glowing shader with a wave of coloured intensity scrolling through a primary texture (for use in a VR title)
Shader "SixfootSoftware/Unlit/Footprint" {
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
_GlowTex("Base (RGB)", 2D) = "white" {}
_Color("Colour", Color) = (1,1,1,1)
_ScrollSpeed("Scroll Speed", Range(-50,50)) = 0
}
SubShader{
Tags { "RenderType" = "Opaque" "Queue" = "Geometry+1" "ForceNoShadowCasting" = "True" }
LOD 200
Offset -1,-1
CGPROGRAM
#pragma surface surf Lambert decal:add
sampler2D _MainTex;
sampler2D _GlowTex;
uniform float4 _Color;
uniform fixed _ScrollSpeed;
struct Input {
float2 uv_MainTex: TEXCOORD0;
};
void surf(Input IN, inout SurfaceOutput o) {
float2 glow_uv = IN.uv_MainTex;
fixed scrolly = _ScrollSpeed * _Time;
glow_uv += float2(0, scrolly);
half4 m = tex2D(_MainTex, IN.uv_MainTex);
half4 c = tex2D(_GlowTex, glow_uv);
o.Albedo = (_Color * c.r)*m.a;
}
ENDCG
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment