-
Notifications
You must be signed in to change notification settings - Fork 21
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
1 parent
ca6f51c
commit 925ef2d
Showing
3 changed files
with
156 additions
and
4 deletions.
There are no files selected for viewing
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
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,62 @@ | ||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' | ||
|
||
Shader "OpenTS2/BakedDecal" | ||
{ | ||
Properties | ||
{ | ||
_MainTex ("Texture", 2D) = "white" {} | ||
} | ||
SubShader | ||
{ | ||
Tags { "RenderType" = "Transparent" "Queue" = "Transparent-2" } | ||
LOD 100 | ||
|
||
Pass | ||
{ | ||
ZWrite Off | ||
Offset -1, -1 | ||
Blend SrcAlpha OneMinusSrcAlpha | ||
CGPROGRAM | ||
#pragma vertex vert | ||
#pragma fragment frag | ||
// make fog work | ||
#pragma multi_compile_fog | ||
|
||
#include "UnityCG.cginc" | ||
|
||
struct appdata | ||
{ | ||
float4 vertex : POSITION; | ||
float2 uv : TEXCOORD0; | ||
}; | ||
|
||
struct v2f | ||
{ | ||
float4 vertex : SV_POSITION; | ||
float2 uv : TEXCOORD0; | ||
}; | ||
|
||
sampler2D _MainTex; | ||
float4 _MainTex_ST; | ||
|
||
v2f vert (appdata v) | ||
{ | ||
v2f o; | ||
o.uv = v.uv; | ||
o.vertex = UnityObjectToClipPos(v.vertex); | ||
return o; | ||
} | ||
|
||
fixed4 frag(v2f i) : SV_Target | ||
{ | ||
|
||
if (i.uv.x < 0 || i.uv.y < 0 || i.uv.x > 1 || i.uv.y > 1) | ||
clip(-1); | ||
// sample the texture | ||
fixed4 col = tex2D(_MainTex, i.uv); | ||
return col; | ||
} | ||
ENDCG | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.