Created
November 5, 2015 08:28
-
-
Save s2kw/5c502d3654fc25053f6e to your computer and use it in GitHub Desktop.
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 "jigaX/ScreenSpace" { | |
Properties { | |
} | |
SubShader { | |
pass { | |
Tags { "LightMode" = "ForwardBase" } | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
float4 vert( float4 v:POSITION ) : SV_POSITION{ | |
return mul (UNITY_MATRIX_MVP, v); | |
} | |
fixed4 frag( float4 sp:VPOS ) : SV_Target { | |
float blue = 1-(sp.x/_ScreenParams.x + sp.y/_ScreenParams.y); | |
return fixed4( sp.xy/_ScreenParams.xy, blue, 1.0 ); | |
} | |
ENDCG | |
} | |
} | |
//FallBack "Diffuse" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment