-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
271 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
Shader "Custom/Transparency" | ||
{ | ||
Properties | ||
{ | ||
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | ||
_Color ("Tint", Color) = (1,1,1,1) | ||
_AlphaTex("Alpha Texture", 2D) = "white" {} | ||
_Amount("Amount", Range(0,1)) = 1.0 | ||
_Amount2("Amount2", Range(0,1)) = 1.0 | ||
} | ||
|
||
SubShader | ||
{ | ||
Tags | ||
{ | ||
"Queue"="Transparent" | ||
//"Queue" = "Transparent+1" | ||
"IgnoreProjector"="True" | ||
//"RenderType" = "Opaque" | ||
"RenderType"="Transparent" | ||
"PreviewType"="Plane" | ||
"CanUseSpriteAtlas"="True" | ||
} | ||
|
||
Cull Off | ||
Lighting Off | ||
ZWrite Off | ||
Blend One OneMinusSrcAlpha | ||
|
||
Pass | ||
{ | ||
CGPROGRAM | ||
#pragma vertex vert | ||
#pragma fragment frag | ||
#include "UnityCG.cginc" | ||
|
||
struct appdata_t | ||
{ | ||
float4 vertex : POSITION; | ||
float2 texcoord : TEXCOORD0; | ||
}; | ||
|
||
struct v2f | ||
{ | ||
float4 vertex : SV_POSITION; | ||
float2 texcoord : TEXCOORD0; | ||
}; | ||
|
||
v2f vert(appdata_t IN) | ||
{ | ||
v2f OUT; | ||
OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); | ||
OUT.texcoord = IN.texcoord; | ||
return OUT; | ||
} | ||
|
||
sampler2D _MainTex; | ||
sampler2D _AlphaTex; | ||
float _Amount; | ||
float _Amount2; | ||
|
||
fixed4 frag(v2f IN) : SV_Target | ||
{ | ||
fixed4 c = tex2D(_MainTex, IN.texcoord); | ||
c.rgb *= c.a; | ||
|
||
fixed4 t = tex2D(_AlphaTex, IN.texcoord); | ||
|
||
|
||
if (t.a < _Amount) | ||
return fixed4(0, 0, 0, 0); | ||
else | ||
return c; | ||
|
||
//return lerp(c, c*t.a, _Amount); | ||
|
||
//return lerp(c, c*pow(t.a, 1 / _Amount2), _Amount); | ||
} | ||
ENDCG | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
m_EditorVersion: 5.3.2f1 | ||
m_EditorVersion: 5.3.4f1 | ||
m_StandardAssetsVersion: 0 |