Created
February 25, 2016 10:09
-
-
Save anonymous/d830610884108ceb9f9b to your computer and use it in GitHub Desktop.
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/Unlit/Beam" | |
{ | |
Properties | |
{ | |
_Colour("Colour", Color) = (1,1,1,1) | |
} | |
SubShader | |
{ | |
Tags { "RenderType"="Opaque" } | |
LOD 100 | |
Pass | |
{ | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
struct appdata | |
{ | |
float4 vertex : POSITION; | |
}; | |
struct v2f | |
{ | |
float4 vertex : SV_POSITION; | |
}; | |
float4 _Colour; | |
v2f vert (appdata v) | |
{ | |
float4 vert = v.vertex; | |
vert.y += sin( (vert.x + _Time.y) * 30.0f ) / 8.0f; | |
v2f o; | |
o.vertex = mul(UNITY_MATRIX_MVP, vert); | |
return o; | |
} | |
fixed4 frag (v2f i) : SV_Target | |
{ | |
return _Colour; | |
} | |
ENDCG | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment