Last active
August 29, 2015 14:13
-
-
Save mmoczkowski/677456cc7605846fce9c to your computer and use it in GitHub Desktop.
Light rays shader
This file contains 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 "Custom/Light rays" { | |
Properties { | |
_MainTex ("Rays texture", 2D) = "white" {} | |
_speed ("Speed", Float) = 0.2 | |
} | |
Category { | |
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } | |
Blend SrcAlpha One | |
Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } | |
BindChannels { | |
Bind "Color", color | |
Bind "Vertex", vertex | |
Bind "TexCoord", texcoord | |
} | |
SubShader { | |
Pass { | |
CGPROGRAM | |
#pragma vertex vert_img | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
uniform sampler2D _MainTex; | |
float _speed; | |
float4 frag(v2f_img i) : COLOR { | |
i.uv.x += cos(_Time*_speed); | |
return tex2D(_MainTex, i.uv); | |
} | |
ENDCG | |
} | |
Pass { | |
CGPROGRAM | |
#pragma vertex vert_img | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
uniform sampler2D _MainTex; | |
float _speed; | |
float4 frag(v2f_img i) : COLOR { | |
i.uv.x += sin(_Time*_speed); | |
return tex2D(_MainTex, i.uv); | |
} | |
ENDCG | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment