- Shader "MyShaders/Image Effects/Aura Shader"{
- Properties{
- _MainTex("Texture", 2D) = "white"{}
- _Color("Color",Color) = (1,1,1,1)
- _NoiseTex("Noise Texture", 2D) = "white"{}
- _Intensity("Intensity",Range(0,1)) = 0
- _AuraColor("Aura Color",Color) = (1,1,1,1)
- }
- SubShader{
- Pass{
- HLSLPROGRAM
-
-
-
- struct VertexData {
- float4 position : POSITION;
- float2 uv : TEXCOORD0;
- float2 uvNoise : TEXCOORD1;
- };
- struct VertexToFragment {
- float4 position : SV_POSITION;
- float2 uv : TEXCOORD0;
- float2 uvNoise : TEXCOORD1;
- };
- sampler2D _MainTex;
- sampler2D _NoiseTex;
- float4 _MainTex_ST;
- float4 _Color;
- float4 _NoiseTex_ST;
- float _Intensity;
- float4 _AuraColor;
- VertexToFragment MyVertexProgram(VertexData vertex)
- {
- VertexToFragment v2f;
- v2f.position = UnityObjectToClipPos(vertex.position);
- v2f.uv = vertex.uv * _MainTex_ST.xy + _MainTex_ST.zw;
- v2f.uvNoise = vertex.uvNoise * _NoiseTex_ST.xy + _NoiseTex_ST.zw;
- return v2f;
- }
- float4 MyFragmentProgram(VertexToFragment v2f) : SV_TARGET
- {
- float4 nsTex = tex2D(_NoiseTex, v2f.uvNoise + (_Time.x * 2));
- float4 bckTex = tex2D(_MainTex, v2f.uv);
- bckTex = bckTex * _Color;
- float4 inverseColor = abs(float4(1,1,1,1) - nsTex);
- float4 colorClamped = clamp(inverseColor,float4(0.7,0.7,0.7,0.7),float4(1,1,1,1)) * _AuraColor;
- float4 lerpdColor = lerp(bckTex, colorClamped, _Intensity);
- return lerpdColor;
- }
- ENDHLSL
- }
- }
- }