Shader "Shader Forge/Fx_water_VX" {
Properties {
_NQ_Tex ("NQ_Tex", 2D) = "white" {}
_NQ_pw ("NQ_pw", Float ) = 0.4
_N_V ("N_V", Float ) = 1
_N_U ("N_U", Float ) = 1
_Diffuse ("Diffuse", 2D) = "white" {}
_D_V ("D_V", Float ) = 1
_D_U ("D_U", Float ) = 1
_BS ("BS", Float ) = 5
_BSa ("BSa", Float ) = 0.2
_TEX ("TEX", 2D) = "white" {}
_Alpha ("Alpha", Float ) = 0
[HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags {
"Queue"="Transparent"
"RenderType"="Transparent"
}
Pass {
Name "ForwardBase"
Tags {
"LightMode"="ForwardBase"
}
Blend SrcAlpha OneMinusSrcAlpha
Fog {Mode Off}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#define UNITY_PASS_FORWARDBASE
#include "UnityCG.cginc"
#pragma multi_compile_fwdbase_fullshadows
#pragma exclude_renderers d3d11 xbox360 ps3 flash d3d11_9x
#pragma target 3.0
uniform float4 _TimeEditor;
uniform sampler2D _NQ_Tex; uniform float4 _NQ_Tex_ST;
uniform float _NQ_pw;
uniform sampler2D _Diffuse; uniform float4 _Diffuse_ST;
uniform float _N_V;
uniform float _N_U;
uniform float _D_V;
uniform float _D_U;
uniform float _BS;
uniform float _BSa;
uniform sampler2D _TEX; uniform float4 _TEX_ST;
uniform float _Alpha;
struct VertexInput {
float4 vertex : POSITION;
float2 texcoord0 : TEXCOORD0;
};
struct VertexOutput {
float4 pos : SV_POSITION;
float2 uv0 : TEXCOORD0;
};
VertexOutput vert (VertexInput v) {
VertexOutput o = (VertexOutput)0;
o.uv0 = v.texcoord0;
float4 node_3242 = _Time + _TimeEditor;
float4 _TEX_var = tex2Dlod(_TEX,float4(TRANSFORM_TEX(o.uv0, _TEX),0.0,0));
float node_3328 = ((abs((frac(((o.uv0+node_3242.g*float2(1,1)).r*_TEX_var.r))-0.5))*2.0)*_BS*_BSa);
v.vertex.xyz += float3(node_3328,node_3328,node_3328);
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
return o;
}
fixed4 frag(VertexOutput i) : COLOR {
/// Vectors:
// Lighting:
// Emissive:
float4 node_3242 = _Time + _TimeEditor;
float4 node_4049 = _Time + _TimeEditor;
float2 node_1856 = ((i.uv0+node_3242.g*float2(0,0))+(node_4049.g*float2(_N_U,_N_V)));
float4 _NQ_Tex_var = tex2D(_NQ_Tex,TRANSFORM_TEX(node_1856, _NQ_Tex));
float2 node_5338 = ((_NQ_pw*_NQ_Tex_var.r*_NQ_Tex_var.g)+(i.uv0+node_3242.g*float2(0,0))+(node_4049.g*float2(_D_U,_D_V)));
float4 _Diffuse_var = tex2D(_Diffuse,TRANSFORM_TEX(node_5338, _Diffuse));
float3 emissive = _Diffuse_var.rgb;
float3 finalColor = emissive;
float4 _TEX_var = tex2D(_TEX,TRANSFORM_TEX(i.uv0, _TEX));
return fixed4(finalColor,(_Diffuse_var.a*_TEX_var.g*_Alpha));
}
ENDCG
}
}
FallBack "Diffuse"
CustomEditor "ShaderForgeMaterialInspector"
}
unity shader 水效果
最新推荐文章于 2024-06-23 13:25:54 发布