1.首先创建一个shader,代码如下:
// - Unlit
// - 熔岩瀑布 透明材质,两层贴图,另加一张控制Alpha透明的贴图
Shader "Game/Lava/Lava Fall No Lightmap Sine Transparent" {
Properties {
//基础贴图
_MainTex ("Base layer (RGB)", 2D) = "white" {}
//细节贴图
_DetailTex ("2nd layer (RGB)", 2D) = "white" {}
//控制Alpha透明的贴图
_AlphaTex ("Alpha (A)", 2D) = "white" {}
//基础贴图的X轴速度
_ScrollX ("Base layer Scroll speed X", Float) = 0.0
//基础贴图的Y轴速度
_ScrollY ("Base layer Scroll speed Y", Float) = 0.25
//细节贴图的X轴速度
_Scroll2X ("2nd layer Scroll speed X", Float) = 0.0
//细节贴图的Y轴速度
_Scroll2Y ("2nd layer Scroll speed Y", Float) = 0.35
//基础贴图的振幅和频率
_SineAmplX ("Base layer sine amplitude X",Float) = 0.0
_SineAmplY ("Base layer sine amplitude Y",Float) = 0.0
_SineFreqX ("Base layer sine freq X",Float) = 0
_SineFreqY (