94 lines
4.8 KiB
GLSL
94 lines
4.8 KiB
GLSL
Shader "BOXOPHOBIC/The Vegetation Engine/Elements/Default/Motion Interaction" {
|
|
Properties {
|
|
[StyledBanner(Motion Interaction Element)] _Banner ("Banner", Float) = 0
|
|
[StyledMessage(Info, Use the Motion Interaction elements to add touch bending to the vegetation objects. Element Texture RG is used a World XZ bending and Texture A is used as interaction mask. Particle Color A is used as Element Intensity multiplier. The Noise direction is controled by the Element Texture RG direction and it is updated with particles or in play mode only., 0,0)] _Message ("Message", Float) = 0
|
|
[StyledCategory(Render Settings)] _RenderCat ("[ Render Cat ]", Float) = 0
|
|
_ElementIntensity ("Render Intensity", Range(0, 1)) = 1
|
|
[StyledMessage(Warning, When using all layers the Global Volume will create one render texture for each layer to render the elements. Try using fewer layers when possible., _ElementLayerWarning, 1, 10, 10)] _ElementLayerWarning ("Render Layer Warning", Float) = 0
|
|
[StyledMessage(Info, When using a higher Layer number the Global Volume will create more render textures to render the elements. Try using fewer layers when possible., _ElementLayerMessage, 1, 10, 10)] _ElementLayerMessage ("Render Layer Message", Float) = 0
|
|
[StyledMask(TVELayers, Default 0 Layer_1 1 Layer_2 2 Layer_3 3 Layer_4 4 Layer_5 5 Layer_6 6 Layer_7 7 Layer_8 8, 0, 0)] _ElementLayerMask ("Render Layer", Float) = 1
|
|
[Enum(Affect Material Bending,12,Affect Material Interaction,13,Affect Bending and Wind Power,14,Affect Interaction and Wind Power,15)] _ElementInteractionMode ("Render Effect", Float) = 15
|
|
[StyledCategory(Element Settings)] _ElementCat ("[ Element Cat ]", Float) = 0
|
|
[StyledTextureSingleLine] [NoScaleOffset] _MainTex ("Element Texture", 2D) = "white" {}
|
|
[Space(10)] [StyledRemapSlider(_MainTexMinValue, _MainTexMaxValue, 0, 1)] _MainTexRemap ("Element Remap", Vector) = (0,0,0,0)
|
|
[HideInInspector] _MainTexMinValue ("Element Min", Range(0, 1)) = 0
|
|
[HideInInspector] _MainTexMaxValue ("Element Max", Range(0, 1)) = 1
|
|
[StyledVector(9)] _MainUVs ("Element UVs", Vector) = (1,1,0,0)
|
|
[StyledTextureSingleLine] _NoiseTex ("Noise Texture", 2D) = "gray" {}
|
|
[StyledRemapSlider(_NoiseMinValue, _NoiseMaxValue, 0, 1, 10, 0)] _NoiseRemap ("Noise Remap", Vector) = (0,0,0,0)
|
|
[HideInInspector] _NoiseMinValue ("Noise Min", Range(0, 1)) = 0
|
|
[HideInInspector] _NoiseMaxValue ("Noise Max", Range(0, 1)) = 1
|
|
_NoiseIntensityValue ("Noise Intensity", Range(0, 1)) = 0
|
|
_NoiseScaleValue ("Noise Scale", Range(0, 20)) = 1
|
|
_NoiseSpeedValue ("Noise Speed", Range(0, 2)) = 1
|
|
[Space(10)] _MotionPower ("Motion Wind Power", Range(0, 1)) = 0
|
|
[Space(10)] [StyledToggle] _ElementDirectionMode ("Use Particle Movement Direction", Float) = 0
|
|
[StyledToggle] _ElementInvertMode ("Use Inverted Element Direction", Float) = 0
|
|
[StyledCategory(Fading Settings)] _FadeCat ("[ Fade Cat ]", Float) = 0
|
|
[StyledToggle] [HDR] _ElementRaycastMode ("Enable Raycast Fading", Float) = 0
|
|
[StyledToggle] _ElementVolumeFadeMode ("Enable Volume Edge Fading", Float) = 0
|
|
[HideInInspector] _RaycastFadeValue ("Raycast Fade Mask", Float) = 1
|
|
[Space(10)] [StyledLayers()] _RaycastLayerMask ("Raycast Layer", Float) = 1
|
|
_RaycastDistanceEndValue ("Raycast Distance", Float) = 2
|
|
[ASEEnd] [StyledCategory(Advanced Settings)] _AdvancedCat ("[ Advanced Cat ]", Float) = 0
|
|
[HideInInspector] _ElementLayerValue ("Legacy Layer Value", Float) = -1
|
|
[HideInInspector] _InvertX ("Legacy Invert Mode", Float) = 0
|
|
[HideInInspector] _ElementFadeSupport ("Legacy Edge Fading", Float) = 0
|
|
[HideInInspector] _IsVersion ("_IsVersion", Float) = 710
|
|
[HideInInspector] _IsElementShader ("_IsElementShader", Float) = 1
|
|
[HideInInspector] _IsMotionElement ("_IsMotionElement", Float) = 1
|
|
[HideInInspector] _render_colormask ("_render_colormask", Float) = 15
|
|
}
|
|
//DummyShaderTextExporter
|
|
SubShader{
|
|
Tags { "RenderType"="Opaque" }
|
|
LOD 200
|
|
|
|
Pass
|
|
{
|
|
HLSLPROGRAM
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
float4x4 unity_ObjectToWorld;
|
|
float4x4 unity_MatrixVP;
|
|
float4 _MainTex_ST;
|
|
|
|
struct Vertex_Stage_Input
|
|
{
|
|
float4 pos : POSITION;
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
struct Vertex_Stage_Output
|
|
{
|
|
float2 uv : TEXCOORD0;
|
|
float4 pos : SV_POSITION;
|
|
};
|
|
|
|
Vertex_Stage_Output vert(Vertex_Stage_Input input)
|
|
{
|
|
Vertex_Stage_Output output;
|
|
output.uv = (input.uv.xy * _MainTex_ST.xy) + _MainTex_ST.zw;
|
|
output.pos = mul(unity_MatrixVP, mul(unity_ObjectToWorld, input.pos));
|
|
return output;
|
|
}
|
|
|
|
Texture2D<float4> _MainTex;
|
|
SamplerState sampler_MainTex;
|
|
|
|
struct Fragment_Stage_Input
|
|
{
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
float4 frag(Fragment_Stage_Input input) : SV_TARGET
|
|
{
|
|
return _MainTex.Sample(sampler_MainTex, input.uv.xy);
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
//CustomEditor "TVEShaderElementGUI"
|
|
} |