当前位置:网站首页>顶点动画-VetexAnimation
顶点动画-VetexAnimation
2022-08-09 00:08:00 【ThomasQxx】
Shader "QShader/VertexAnimation"{
Properties{
_MainTex("Main Texture",2D) = "white"{
}
_XSpeed("X Axis Speed",Float) = 1.0
_YSpeed("Y Axis Speed",Float) = 1.0
}
SubShader{
pass {
Tags{
"LightMode" = "Always"}
CGPROGRAM
#pragma vertex Vertex
#pragma fragment Fragment
#include "UnityCG.cginc"
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
sampler2D _MainTex;
float _XSpeed;
float _YSpeed;
v2f Vertex(appdata_base v) {
v2f o;
v.vertex.y += sin(_Time.y + v.vertex.x * _XSpeed + v.vertex.z * _YSpeed);
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord;
return o;
}
fixed4 Fragment(v2f i) :SV_TARGET{
return tex2D(_MainTex,i.uv);
}
ENDCG
}
}
}
边栏推荐
猜你喜欢
随机推荐
牛客多校8 补题
vspm虚拟串口调试
第七章 数据管理技术的发展
C# 如何关联键盘按钮 (KeyChar/KeyCode值 KeyPress/KeyDown事件 区别)
360“卸载不下去”引热议 周鸿祎重申是谣言:步骤繁琐出于安全考虑
第四章 SQL与关系数据库基本操作(上)
工作中经常遇到的232、485、TTL信号
自学FPGA:Verilog基本语法规则(一)
Why software development methodology make you feel bad?
在子组件中使用echart视图不刷新的问题
基于单片机测量空气粘滞系数方案
Jupyter代码补全、修改路径、增添解释器
MVC与MVP的区别
AutoX安途杯中山大学程序设计校赛(同步赛)
第七章 无线与移动网络
微信小程序 【控制台报错-汇总】
flutter Future的正确用法
C# this.Invoke()的作用与用法
第五章 数据库编程
2017年10月历史文章汇总









