Created
September 13, 2015 07:00
-
-
Save EsProgram/e34c1e96475bae47a069 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 "Custom/EmissionVF" { | |
Properties{ | |
_MainTex("Albedo (RGB)", 2D) = "white" {} | |
_Emission("Emission", Range(-1,1)) = 0 | |
_Diff("Diff", Range(0, 1)) = 0 | |
} | |
SubShader{ | |
Pass{ | |
CGPROGRAM | |
#pragma vertex vert_img | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
sampler2D _MainTex; | |
float _Diff; | |
float _Emission; | |
float4 frag(v2f_img i) :COLOR{ | |
//ブラーかける | |
float4 col = (tex2D(_MainTex, i.uv - _Diff) + tex2D(_MainTex, i.uv + _Diff)) / 2; | |
//白を加算 | |
col += _Emission; | |
return col; | |
} | |
ENDCG | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment