您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

63 行
1.2 KiB

Shader "EasyHDRP/Simple Texture Fade"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_Fade("Fade", Range(0.0,1.0)) = 1.0
_Tile("Tile", Vector) = (1.0,1.0,1.0,1.0)
}
HLSLINCLUDE
#pragma target 4.5
#define MESH_HAS_UV
#define SHADER_CUSTOM_VERTEX customVert
#include "Assets/Shaders/EasyHDRP/EasyHDRP.hlsl"
sampler2D _MainTex;
float _Fade;
float4 _Tile;
v2f customVert(v2f i)
{
i.uv.xy *= _Tile.xy;
return i;
}
float4 frag(v2f i) : SV_Target
{
float4 col = tex2D(_MainTex, i.uv.xy);
col.a *= _Fade;
return col;
}
ENDHLSL
SubShader
{
Tags { "Queue" = "Transparent" }
Pass
{
Name ""
Tags{ "LightMode" = "ForwardOnly" }
Blend SrcAlpha One
ZWrite off
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
ENDHLSL
}
Pass
{
Name ""
Tags{ "LightMode" = "DepthForwardOnly" }
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
ENDHLSL
}
}
}