Shader "Custom/UVAnimation"
{
Properties
{
// 设置纹理1以及纹理2
_MainTex ("Texture", 2D) = "white" {}
_SubTex ("SubTexture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
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;
};
// 要在片元中使用,就必须要在这里定义,得和Properties里面同样的名字
sampler2D _SubTex;
sampler2D _MainTex;
flo
UnityShader—将两个纹理附加并将其中的一个纹理循环显示
最新推荐文章于 2022-06-06 19:48:33 发布
