Last active
September 24, 2018 22:09
-
-
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)
This file contains hidden or 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
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