add games
This commit is contained in:
20
assignment10final/Assets/Shaders/MaskedTexture.shader
Normal file
20
assignment10final/Assets/Shaders/MaskedTexture.shader
Normal file
@@ -0,0 +1,20 @@
|
||||
Shader "MaskedTexture"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB)", 2D) = "white" {}
|
||||
_Mask ("Culling Mask", 2D) = "white" {}
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue"="Transparent"}
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass
|
||||
{
|
||||
SetTexture [_Mask] {combine texture}
|
||||
SetTexture [_MainTex] {combine texture, previous}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fd990a13007c4feab36c1c78b6158af
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
69
assignment10final/Assets/Shaders/ScreenCutoutShader.shader
Executable file
69
assignment10final/Assets/Shaders/ScreenCutoutShader.shader
Executable file
@@ -0,0 +1,69 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "Unlit/ScreenCutoutShader"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_Mask ("Culling Mask", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
|
||||
Lighting Off
|
||||
Cull Back
|
||||
ZWrite On
|
||||
ZTest Less
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Fog{ Mode Off }
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
//float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
float4 screenPos : TEXCOORD1;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.screenPos = ComputeScreenPos(o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
i.screenPos /= i.screenPos.w;
|
||||
fixed4 col = tex2D(_MainTex, float2(i.screenPos.x, i.screenPos.y));
|
||||
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Subshader {
|
||||
Pass {
|
||||
SetTexture[_Mask] {combine texture alpha}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8367850ef7f5c4a48806fe7facfe87a1
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
assignment10final/Assets/Shaders/ScreenCutoutShader.zip
Normal file
BIN
assignment10final/Assets/Shaders/ScreenCutoutShader.zip
Normal file
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e100ceb2ebfe4ddea0e52d81f06f01b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user