24250 lines
1.6 MiB
24250 lines
1.6 MiB
Shader "NatureManufacture/HDRP/Foliage/Cross Snow"
|
|
{
|
|
Properties
|
|
{
|
|
_AlphaCutoff("Alpha Cutoff", Float) = 0.5
|
|
_AlphaShadowThreshold("Alpha Shadow Threshold", Float) = 0.5
|
|
[NoScaleOffset]_BaseColorMap("Base Map", 2D) = "white" {}
|
|
_TilingOffset("Tiling and Offset", Vector) = (1, 1, 0, 0)
|
|
_HealthyColor("Healthy Color", Color) = (1, 1, 1, 0)
|
|
_DryColor("Dry Color", Color) = (0.8196079, 0.8196079, 0.8196079, 0)
|
|
_ColorNoiseSpread("Color Noise Spread", Float) = 2
|
|
[Normal][NoScaleOffset]_NormalMap("Normal Map", 2D) = "bump" {}
|
|
_NormalScale("Normal Scale", Range(0, 8)) = 1
|
|
_AORemapMax("AO Remap Max", Range(0, 1)) = 1
|
|
_SmoothnessRemapMax("Smoothness Remap Max", Range(0, 1)) = 1
|
|
[NoScaleOffset]_ThicknessMap("Thickness Map", 2D) = "white" {}
|
|
_Thickness("Thickness", Range(0, 1)) = 0.3
|
|
_Snow_Amount("Snow Amount", Range(0, 2)) = 0
|
|
_SnowBaseColor("Snow Base Color", Color) = (1, 1, 1, 0)
|
|
_SnowColorAdjustment("Snow Color Adjustment", Vector) = (1, 1, 1, 0)
|
|
[NoScaleOffset]_SnowMaskA("Snow Mask(A)", 2D) = "black" {}
|
|
_SnowMaskTreshold("Snow Mask Treshold", Range(0.1, 15)) = 4
|
|
[ToggleUI]_InvertSnowMask("Invert Snow Mask", Float) = 0
|
|
[NoScaleOffset]_SnowBaseColorMap("Snow Base Map", 2D) = "white" {}
|
|
_SnowTilingOffset("Snow Tiling Offset", Vector) = (1, 1, 0, 0)
|
|
_SnowBlendHardness("Snow Blend Hardness", Range(0, 8)) = 1
|
|
_SnowAORemapMax("Snow AO Remap Max", Range(0, 1)) = 1
|
|
_SnowSmoothnessRemapMax("Snow Smoothness Remap Max", Range(0, 1)) = 1
|
|
_SnowThickness("Snow Thickness", Range(0, 1)) = 0.3
|
|
_Stiffness("Wind Stiffness", Float) = 1
|
|
_InitialBend("Wind Initial Bend", Float) = 0
|
|
_Drag("Wind Drag", Float) = 1
|
|
_HeightDrag("Wind Drag Height Offset", Float) = 0
|
|
_NewNormal("Mesh Normal Multiply", Vector) = (0, 0, 0, 0)
|
|
[HideInInspector]_DiffusionProfileHash("Float", Float) = 0
|
|
[HideInInspector]_DiffusionProfileAsset("Vector4", Vector) = (0, 0, 0, 0)
|
|
[HideInInspector]_EmissionColor("Color", Color) = (1, 1, 1, 1)
|
|
[HideInInspector]_RenderQueueType("Float", Float) = 1
|
|
[HideInInspector][ToggleUI]_AddPrecomputedVelocity("Boolean", Float) = 0
|
|
[HideInInspector][ToggleUI]_DepthOffsetEnable("Boolean", Float) = 0
|
|
[HideInInspector][ToggleUI]_ConservativeDepthOffsetEnable("Boolean", Float) = 0
|
|
[HideInInspector][ToggleUI]_TransparentWritingMotionVec("Boolean", Float) = 0
|
|
[HideInInspector][ToggleUI]_AlphaCutoffEnable("Boolean", Float) = 1
|
|
[HideInInspector]_TransparentSortPriority("_TransparentSortPriority", Float) = 0
|
|
[HideInInspector][ToggleUI]_UseShadowThreshold("Boolean", Float) = 1
|
|
[HideInInspector][ToggleUI]_DoubleSidedEnable("Boolean", Float) = 1
|
|
[HideInInspector][Enum(Flip, 0, Mirror, 1, None, 2)]_DoubleSidedNormalMode("Float", Float) = 1
|
|
[HideInInspector]_DoubleSidedConstants("Vector4", Vector) = (1, 1, -1, 0)
|
|
[HideInInspector][Enum(Auto, 0, On, 1, Off, 2)]_DoubleSidedGIMode("Float", Float) = 0
|
|
[HideInInspector][ToggleUI]_TransparentDepthPrepassEnable("Boolean", Float) = 0
|
|
[HideInInspector][ToggleUI]_TransparentDepthPostpassEnable("Boolean", Float) = 0
|
|
[HideInInspector][ToggleUI]_PerPixelSorting("Boolean", Float) = 0
|
|
[HideInInspector]_SurfaceType("Float", Float) = 0
|
|
[HideInInspector]_BlendMode("Float", Float) = 0
|
|
[HideInInspector]_SrcBlend("Float", Float) = 1
|
|
[HideInInspector]_DstBlend("Float", Float) = 0
|
|
[HideInInspector]_DstBlend2("Float", Float) = 0
|
|
[HideInInspector]_AlphaSrcBlend("Float", Float) = 1
|
|
[HideInInspector]_AlphaDstBlend("Float", Float) = 0
|
|
[HideInInspector][ToggleUI]_ZWrite("Boolean", Float) = 1
|
|
[HideInInspector][ToggleUI]_TransparentZWrite("Boolean", Float) = 0
|
|
[HideInInspector]_CullMode("Float", Float) = 2
|
|
[HideInInspector][ToggleUI]_EnableFogOnTransparent("Boolean", Float) = 1
|
|
[HideInInspector]_CullModeForward("Float", Float) = 2
|
|
[HideInInspector][Enum(Front, 1, Back, 2)]_TransparentCullMode("Float", Float) = 2
|
|
[HideInInspector][Enum(UnityEngine.Rendering.HighDefinition.OpaqueCullMode)]_OpaqueCullMode("Float", Float) = 2
|
|
[HideInInspector]_ZTestDepthEqualForOpaque("Float", Int) = 3
|
|
[HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)]_ZTestTransparent("Float", Float) = 4
|
|
[HideInInspector][ToggleUI]_TransparentBackfaceEnable("Boolean", Float) = 0
|
|
[HideInInspector][ToggleUI]_RequireSplitLighting("Boolean", Float) = 0
|
|
[HideInInspector][ToggleUI]_ReceivesSSR("Boolean", Float) = 1
|
|
[HideInInspector][ToggleUI]_ReceivesSSRTransparent("Boolean", Float) = 0
|
|
[HideInInspector][ToggleUI]_EnableBlendModePreserveSpecularLighting("Boolean", Float) = 1
|
|
[HideInInspector][ToggleUI]_SupportDecals("Boolean", Float) = 1
|
|
[HideInInspector][ToggleUI]_ExcludeFromTUAndAA("Boolean", Float) = 0
|
|
[HideInInspector]_StencilRef("Float", Int) = 0
|
|
[HideInInspector]_StencilWriteMask("Float", Int) = 6
|
|
[HideInInspector]_StencilRefDepth("Float", Int) = 8
|
|
[HideInInspector]_StencilWriteMaskDepth("Float", Int) = 9
|
|
[HideInInspector]_StencilRefMV("Float", Int) = 40
|
|
[HideInInspector]_StencilWriteMaskMV("Float", Int) = 41
|
|
[HideInInspector]_StencilRefDistortionVec("Float", Int) = 4
|
|
[HideInInspector]_StencilWriteMaskDistortionVec("Float", Int) = 4
|
|
[HideInInspector]_StencilWriteMaskGBuffer("Float", Int) = 15
|
|
[HideInInspector]_StencilRefGBuffer("Float", Int) = 10
|
|
[HideInInspector]_ZTestGBuffer("Float", Int) = 4
|
|
[HideInInspector][ToggleUI]_RayTracing("Boolean", Float) = 0
|
|
[HideInInspector][Enum(None, 0, Planar, 1, Sphere, 2, Thin, 3)]_RefractionModel("Float", Float) = 0
|
|
[HideInInspector][Enum(Translucent, 5)]_MaterialID("_MaterialID", Float) = 5
|
|
[HideInInspector]_MaterialTypeMask("_MaterialTypeMask", Float) = 32
|
|
[HideInInspector][ToggleUI]_TransmissionEnable("Boolean", Float) = 1
|
|
[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
|
|
[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
|
|
[HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
|
|
}
|
|
SubShader
|
|
{
|
|
Tags
|
|
{
|
|
"RenderPipeline"="HDRenderPipeline"
|
|
"RenderType"="HDLitShader"
|
|
"Queue"="AlphaTest+25"
|
|
"DisableBatching"="LODFading"
|
|
"ShaderGraphShader"="true"
|
|
"ShaderGraphTargetId"="HDLitSubTarget"
|
|
}
|
|
Pass
|
|
{
|
|
Name "ShadowCaster"
|
|
Tags
|
|
{
|
|
"LightMode" = "ShadowCaster"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_CullMode]
|
|
ZWrite On
|
|
ColorMask 0
|
|
ZClip [_ZClip]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma instancing_options renderinglayer
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_SHADOWS
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
struct CustomInterpolators
|
|
{
|
|
};
|
|
#define USE_CUSTOMINTERP_SUBSTRUCT
|
|
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_COLOR
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
// GraphIncludes: <None>
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 color : COLOR;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 WorldSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
float4 VertexColor;
|
|
float3 TimeParameters;
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Add_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
void Unity_Distance_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = distance(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Less_float(float A, float B, out float Out)
|
|
{
|
|
Out = A < B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Comparison_Greater_float(float A, float B, out float Out)
|
|
{
|
|
Out = A > B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Subtract_float(float A, float B, out float Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_And_float(float A, float B, out float Out)
|
|
{
|
|
Out = A && B;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Length_float4(float4 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Subtract_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_Normalize_float3(float3 In, out float3 Out)
|
|
{
|
|
Out = normalize(In);
|
|
}
|
|
|
|
void Unity_Length_float3(float3 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
void Unity_Add_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(float4x4 Matrix4_cb72bb33b7a84dfda97778a514f9b60f, float3 Vector3_90379ebf40aa468b8362f8d265f4f234, float4 Vector4_159bb4232f82428893101734a03e2a1e, Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float IN, out float4 WindPoint_1)
|
|
{
|
|
float3 _Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3 = Vector3_90379ebf40aa468b8362f8d265f4f234;
|
|
float4x4 _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4 = Matrix4_cb72bb33b7a84dfda97778a514f9b60f;
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].r);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].g);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].b);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].a);
|
|
float3 _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4.xyz), _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3);
|
|
float3 _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3);
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[0];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[1];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[2];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[3];
|
|
float _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float);
|
|
float4 _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4 = Vector4_159bb4232f82428893101734a03e2a1e;
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[0];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[1];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[2];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[3];
|
|
float _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float;
|
|
Unity_Divide_float(_Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float, _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float);
|
|
float _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float, float(0), float(1), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float);
|
|
float _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float;
|
|
Unity_Lerp_float(_Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float, float(0), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float);
|
|
float3 _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3, (_Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float.xxx), _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3);
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[0];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[1];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[2];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_A_4_Float = 0;
|
|
float4 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4;
|
|
float3 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3;
|
|
float2 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2);
|
|
float3 _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4.xyz), _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3);
|
|
float3 _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3);
|
|
float _Split_8bbd5052350846968bf312362efd9f01_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[0];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[1];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[2];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[3];
|
|
float _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float);
|
|
float _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float;
|
|
Unity_Divide_float(_Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float, _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float);
|
|
float _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float, float(0), float(1), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float);
|
|
float _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float;
|
|
Unity_Lerp_float(_Split_8bbd5052350846968bf312362efd9f01_A_4_Float, float(0), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float);
|
|
float3 _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3, (_Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float.xxx), _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3);
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[0];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[1];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[2];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_A_4_Float = 0;
|
|
float4 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4;
|
|
float3 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3;
|
|
float2 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2);
|
|
float4 _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4;
|
|
Unity_Add_float4(_Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4);
|
|
float3 _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4.xyz), _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3);
|
|
float3 _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3);
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[0];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[1];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[2];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[3];
|
|
float _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float);
|
|
float _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float;
|
|
Unity_Divide_float(_Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float, _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float);
|
|
float _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float, float(0), float(1), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float);
|
|
float _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float;
|
|
Unity_Lerp_float(_Split_fa21a8022f944854903e06c07c6f079c_A_4_Float, float(0), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float);
|
|
float3 _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3, (_Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float.xxx), _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3);
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[0];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[1];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[2];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_A_4_Float = 0;
|
|
float4 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4;
|
|
float3 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3;
|
|
float2 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2);
|
|
float4 _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4);
|
|
float3 _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4.xyz), _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3);
|
|
float3 _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3);
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[0];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[1];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[2];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[3];
|
|
float _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float);
|
|
float _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float;
|
|
Unity_Divide_float(_Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float, _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float);
|
|
float _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float, float(0), float(1), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float);
|
|
float _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float;
|
|
Unity_Lerp_float(_Split_1bfec6763d4b458398e36937b4114c29_A_4_Float, float(0), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float);
|
|
float3 _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3, (_Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float.xxx), _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3);
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_R_1_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[0];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[1];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[2];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_A_4_Float = 0;
|
|
float4 _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4;
|
|
float3 _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3;
|
|
float2 _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_e22879e6c4574322ab21f6261a21bced_R_1_Float, _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float, _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3, _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2);
|
|
float4 _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4);
|
|
WindPoint_1 = _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Or_float(float A, float B, out float Out)
|
|
{
|
|
Out = A || B;
|
|
}
|
|
|
|
void Unity_Branch_float3(float Predicate, float3 True, float3 False, out float3 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Add_float(float A, float B, out float Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(float3 Vector3_604F121F, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7F78DDD2, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float Vector1_5EFF6B1A, Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float IN, out float3 direction_1, out float strength_2)
|
|
{
|
|
float4 _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[0];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[1];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[2];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_A_4_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[3];
|
|
float4 _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4;
|
|
float3 _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3;
|
|
float2 _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float, float(0), _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4, _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2);
|
|
float3 _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3);
|
|
float4 _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_R_1_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[0];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_G_2_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[1];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_B_3_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[2];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[3];
|
|
float3 _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, (_Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float.xxx), _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3);
|
|
float _Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float = Vector1_9365F438;
|
|
float _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float, float(0), _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean);
|
|
UnityTexture2D _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float3 _Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3 = float3(float(1), float(0), float(0));
|
|
float _Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float.xxx), _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3);
|
|
float _Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float = Vector1_5EFF6B1A;
|
|
float3 _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3);
|
|
float3 _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3, _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3, _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3);
|
|
float _Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float = Vector1_6803B355;
|
|
float3 _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3, (_Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float.xxx), _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3);
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[0];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_G_2_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[1];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[2];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_A_4_Float = 0;
|
|
float4 _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4;
|
|
float3 _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3;
|
|
float2 _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float, _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float, float(0), float(0), _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4, _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3, _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.tex, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.samplerstate, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.GetTransformedUV(_Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_G_6_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_B_7_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_A_8_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.a;
|
|
float _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float;
|
|
Unity_Branch_float(_Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean, _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float, float(0), _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float);
|
|
float _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float;
|
|
Unity_Power_float(_Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float, float(2), _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float);
|
|
float _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float = Vector1_F53C4B89;
|
|
float _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float;
|
|
Unity_Multiply_float_float(_Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float, _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float, _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float);
|
|
float3 _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3((_Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float.xxx), _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3);
|
|
float _Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3, (_Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float.xxx), _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3);
|
|
float3 _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3, _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3, _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3);
|
|
float4 _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_e719665c40324e89a536d165d0427a68_R_1_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[0];
|
|
float _Split_e719665c40324e89a536d165d0427a68_G_2_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[1];
|
|
float _Split_e719665c40324e89a536d165d0427a68_B_3_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[2];
|
|
float _Split_e719665c40324e89a536d165d0427a68_A_4_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[3];
|
|
float _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Split_e719665c40324e89a536d165d0427a68_A_4_Float, float(0), _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean);
|
|
float _Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float = Vector1_2EC6D670;
|
|
float _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float, float(0), _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean);
|
|
float _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean;
|
|
Unity_Or_float(_Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean, _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean, _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean);
|
|
UnityTexture2D _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
float3 _Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Split_e719665c40324e89a536d165d0427a68_A_4_Float.xxx), _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3);
|
|
float3 _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3);
|
|
float3 _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3, _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3, _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3);
|
|
float _Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float = Vector1_B4470F9B;
|
|
float3 _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3, (_Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float.xxx), _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3);
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[0];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_G_2_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[1];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[2];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_A_4_Float = 0;
|
|
float4 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4;
|
|
float3 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3;
|
|
float2 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float, _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float, float(0), float(0), _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.tex, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.samplerstate, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.GetTransformedUV(_Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_A_8_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.a;
|
|
float4 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4;
|
|
float3 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3;
|
|
float2 _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2;
|
|
Unity_Combine_float(_SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float, float(0), _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4, _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2);
|
|
float3 _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3;
|
|
Unity_Add_float3(_Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, float3(-0.5, -0.5, -0.5), _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3);
|
|
float3 _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3;
|
|
Unity_Branch_float3(_Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean, _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3, float3(0, 0, 0), _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3);
|
|
float _Property_9946d066804cc584a96830f8d35269cc_Out_0_Float = Vector1_2EC6D670;
|
|
float3 _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3, (_Property_9946d066804cc584a96830f8d35269cc_Out_0_Float.xxx), _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3);
|
|
float3 _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3, _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3, _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3);
|
|
float _Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float = Vector1_A2C4B4F4;
|
|
float3 _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3, (_Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float.xxx), _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3);
|
|
float _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float;
|
|
Unity_Length_float3(_Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3, _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float);
|
|
float _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float = Vector1_7F78DDD2;
|
|
float _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float;
|
|
Unity_Add_float(_Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float, _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float, _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float);
|
|
float _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
Unity_Multiply_float_float(_Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float, 0.001, _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float);
|
|
direction_1 = _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
strength_2 = _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
}
|
|
|
|
void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = cross(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Equal_float(float A, float B, out float Out)
|
|
{
|
|
Out = A == B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_DotProduct_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = dot(A, B);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Maximum_float(float A, float B, out float Out)
|
|
{
|
|
Out = max(A, B);
|
|
}
|
|
|
|
void Unity_Cosine_float(float In, out float Out)
|
|
{
|
|
Out = cos(In);
|
|
}
|
|
|
|
void Unity_Sine_float(float In, out float Out)
|
|
{
|
|
Out = sin(In);
|
|
}
|
|
|
|
void Unity_Comparison_NotEqual_float(float A, float B, out float Out)
|
|
{
|
|
Out = A != B ? 1 : 0;
|
|
}
|
|
|
|
struct Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float4 VertexColor;
|
|
};
|
|
|
|
void SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(float Vector1_BCB03E1A, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7EE0F94A, float Boolean_527CB26E, float Vector1_DE1BF63A, float Vector1_7F78DDD2, float3 Vector3_DE8CC74D, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float4x4 Matrix4_0617b0bd42fc46ff90b1d55303a5477f, float4 Vector4_b44806ec67ca461fbcdf009dc6092cc3, Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float IN, out float3 vertex_1, out float3 normal_2)
|
|
{
|
|
float4 _Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3;
|
|
{
|
|
// Converting Position from Object to AbsoluteWorld via world space
|
|
float3 world;
|
|
world = TransformObjectToWorld((_Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4.xyz).xyz);
|
|
_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3 = GetAbsolutePositionWS(world);
|
|
}
|
|
float _Distance_343883e4e5444664abed46100940f24f_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3, float3(0, 0, 0), _Distance_343883e4e5444664abed46100940f24f_Out_2_Float);
|
|
float _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Distance_343883e4e5444664abed46100940f24f_Out_2_Float, float(0.001), _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean);
|
|
float3 _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3 = Vector3_C30D997B;
|
|
float4 _Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3;
|
|
_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3 = TransformObjectToWorld((_Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4.xyz).xyz);
|
|
float3 _Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3;
|
|
_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3 = TransformObjectToWorld(_Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3.xyz);
|
|
float _Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean = Boolean_527CB26E;
|
|
float _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float = Vector1_7EE0F94A;
|
|
float _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, float(0), _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean);
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_R_1_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[0];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[1];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_B_3_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[2];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_A_4_Float = 0;
|
|
float _Split_7a634ef857769683b2100876a36535a2_R_1_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[0];
|
|
float _Split_7a634ef857769683b2100876a36535a2_G_2_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[1];
|
|
float _Split_7a634ef857769683b2100876a36535a2_B_3_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[2];
|
|
float _Split_7a634ef857769683b2100876a36535a2_A_4_Float = 0;
|
|
float _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float;
|
|
Unity_Subtract_float(_Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float, _Split_7a634ef857769683b2100876a36535a2_G_2_Float, _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float);
|
|
float _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float, _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean);
|
|
float _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean;
|
|
Unity_And_float(_Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean, _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean);
|
|
float _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float = Vector1_A2C4B4F4;
|
|
float _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float;
|
|
Unity_Branch_float(_And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean, float(1E-05), _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float);
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_R_1_Float = IN.VertexColor[0];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_G_2_Float = IN.VertexColor[1];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_B_3_Float = IN.VertexColor[2];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float = IN.VertexColor[3];
|
|
float _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float);
|
|
float _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float;
|
|
Unity_Branch_float(_Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float);
|
|
float _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float = Vector1_7F78DDD2;
|
|
UnityTexture2D _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
UnityTexture2D _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float4 _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float;
|
|
Unity_Length_float4(_Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float);
|
|
float _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float, float(0), _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean);
|
|
float4 _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4;
|
|
Unity_Branch_float4(_Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean, _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, float4(0, 0, 1, 1), _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4);
|
|
float4x4 _Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4 = Matrix4_0617b0bd42fc46ff90b1d55303a5477f;
|
|
float4 _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4 = Vector4_b44806ec67ca461fbcdf009dc6092cc3;
|
|
Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float _WindNMPoints_071e9370484b4168b560a27fbea64a52;
|
|
float4 _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4;
|
|
SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(_Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4, SHADERGRAPH_OBJECT_POSITION, _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4);
|
|
float4 _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4;
|
|
Unity_Add_float4(_Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4);
|
|
float _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float = Vector1_B4470F9B;
|
|
float _Property_6b508d48a081548385021b27896c0622_Out_0_Float = Vector1_2EC6D670;
|
|
float _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float = Vector1_9365F438;
|
|
float _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float = Vector1_F53C4B89;
|
|
float _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float = Vector1_6803B355;
|
|
float _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float = Vector1_BCB03E1A;
|
|
Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba;
|
|
float3 _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3;
|
|
float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float;
|
|
SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float, _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float, _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D, _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4, _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float, _Property_6b508d48a081548385021b27896c0622_Out_0_Float, _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float, _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float, _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float, _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float);
|
|
float3 _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3;
|
|
Unity_CrossProduct_float(float3 (0, 1, 0), _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3);
|
|
float _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean;
|
|
Unity_Comparison_Equal_float((_CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3).x, float(0), _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean);
|
|
float3 _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean, float3(1E-06, 1E-06, 1E-06), _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3, _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3);
|
|
float3 _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3, _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3);
|
|
float3 _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3);
|
|
float _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float;
|
|
Unity_DotProduct_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3, _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float);
|
|
float3 _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, (_DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float.xxx), _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3);
|
|
float3 _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3;
|
|
Unity_Add_float3(_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3);
|
|
float3 _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3);
|
|
float _Distance_702b068f612c7289a99272879da274ed_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Distance_702b068f612c7289a99272879da274ed_Out_2_Float);
|
|
float _Property_f5c255b0f666358291012b78132d6593_Out_0_Float = Vector1_DE1BF63A;
|
|
float _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float;
|
|
Unity_Divide_float(_Distance_702b068f612c7289a99272879da274ed_Out_2_Float, _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float);
|
|
float _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float;
|
|
Unity_Absolute_float(_Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float, _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float);
|
|
float _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float = float(1E-07);
|
|
float _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float;
|
|
Unity_Maximum_float(_Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float, _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float, _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float);
|
|
float _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float;
|
|
Unity_Divide_float(float(1), _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float);
|
|
float _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float;
|
|
Unity_Power_float(_Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float);
|
|
float _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float;
|
|
Unity_Multiply_float_float(_WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float, _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float);
|
|
float _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float;
|
|
Unity_Cosine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float);
|
|
float3 _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, (_Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float.xxx), _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3);
|
|
float3 _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3;
|
|
Unity_CrossProduct_float(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3);
|
|
float _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float;
|
|
Unity_Sine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float);
|
|
float3 _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3, (_Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float.xxx), _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3);
|
|
float3 _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3, _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3);
|
|
float3 _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3, _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3);
|
|
float3 _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3;
|
|
_Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3 = TransformWorldToObject(_Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3.xyz);
|
|
float3 _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean, _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3, _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3, _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3);
|
|
float3 _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3 = Vector3_DE8CC74D;
|
|
float _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float;
|
|
Unity_Length_float3(_Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float);
|
|
float _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean;
|
|
Unity_Comparison_NotEqual_float(_Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float, float(0), _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean);
|
|
float3 _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(IN.WorldSpaceNormal, _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3);
|
|
float3 _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3, IN.WorldSpaceNormal, _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3);
|
|
vertex_1 = _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
normal_2 = _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
}
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
float3 _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3;
|
|
Unity_Add_float3(IN.ObjectSpacePosition, float3(1E-07, 1E-07, 1E-07), _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3);
|
|
float _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float = _Drag;
|
|
float _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float = _HeightDrag;
|
|
float _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float = _Stiffness;
|
|
float _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float = _InitialBend;
|
|
float4 _Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4 = _NewNormal;
|
|
UnityTexture2D _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexNoise);
|
|
UnityTexture2D _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexGust);
|
|
float4 _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4 = WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float = WIND_SETTINGS_FlexNoiseScale;
|
|
float _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float = WIND_SETTINGS_Turbulence;
|
|
float _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float = WIND_SETTINGS_GustSpeed;
|
|
float _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float = WIND_SETTINGS_GustScale;
|
|
float _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float = WIND_SETTINGS_GustWorldScale;
|
|
float4x4 _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4 = WIND_SETTINGS_Points;
|
|
float4 _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4 = WIND_SETTINGS_Points_Radius;
|
|
Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.WorldSpaceNormal = IN.WorldSpaceNormal;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.VertexColor = IN.VertexColor;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3;
|
|
SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(IN.TimeParameters.x, _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3, _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float, _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float, 0, _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float, _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float, (_Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4.xyz), _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D, _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D, _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4, _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float, _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float, _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float, _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float, _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float, _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4, _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3);
|
|
description.Position = _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.WorldSpaceNormal = TransformObjectToWorldNormal(input.normalOS);
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
output.VertexColor = input.color;
|
|
output.TimeParameters = _TimeParameters.xyz; // Note: in case of animation this will be overwrite (allow to handle motion vector)
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
vertexDescriptionInputs.TimeParameters = timeParameters;
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
input.positionOS = vertexDescription.Position;
|
|
input.normalOS = vertexDescription.Normal;
|
|
input.tangentOS.xyz = vertexDescription.Tangent;
|
|
|
|
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.texCoord0 = input.texCoord0;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
alphaCutoff = _UseShadowThreshold ? surfaceDescription.AlphaClipThresholdShadow : alphaCutoff;
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassDepthOnly.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "META"
|
|
Tags
|
|
{
|
|
"LightMode" = "META"
|
|
}
|
|
|
|
// Render State
|
|
Cull Off
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma instancing_options renderinglayer
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma shader_feature _ EDITOR_VISUALIZATION
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_LIGHT_TRANSPORT
|
|
#define RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define SCENEPICKINGPASS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreInclude' */
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define ATTRIBUTES_NEED_TEXCOORD2
|
|
#define ATTRIBUTES_NEED_TEXCOORD3
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_POSITIONPREDISPLACEMENT_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_TEXCOORD2
|
|
#define VARYINGS_NEED_TEXCOORD3
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
#define FRAG_INPUTS_USE_TEXCOORD1
|
|
#define FRAG_INPUTS_USE_TEXCOORD2
|
|
#define FRAG_INPUTS_USE_TEXCOORD3
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 uv1 : TEXCOORD1;
|
|
float4 uv2 : TEXCOORD2;
|
|
float4 uv3 : TEXCOORD3;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 positionRWS;
|
|
float3 positionPredisplacementRWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
float4 texCoord1;
|
|
float4 texCoord2;
|
|
float4 texCoord3;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float4 texCoord1 : INTERP2;
|
|
float4 texCoord2 : INTERP3;
|
|
float4 texCoord3 : INTERP4;
|
|
float3 positionRWS : INTERP5;
|
|
float3 positionPredisplacementRWS : INTERP6;
|
|
float3 normalWS : INTERP7;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.texCoord1.xyzw = input.texCoord1;
|
|
output.texCoord2.xyzw = input.texCoord2;
|
|
output.texCoord3.xyzw = input.texCoord3;
|
|
output.positionRWS.xyz = input.positionRWS;
|
|
output.positionPredisplacementRWS.xyz = input.positionPredisplacementRWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.texCoord1 = input.texCoord1.xyzw;
|
|
output.texCoord2 = input.texCoord2.xyzw;
|
|
output.texCoord3 = input.texCoord3.xyzw;
|
|
output.positionRWS = input.positionRWS.xyz;
|
|
output.positionPredisplacementRWS = input.positionPredisplacementRWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorVertMeshCustomInterpolation' */
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.positionRWS = input.positionRWS;
|
|
output.positionPredisplacementRWS = input.positionPredisplacementRWS;
|
|
output.tangentToWorld = BuildTangentToWorld(input.tangentWS, input.normalWS);
|
|
output.texCoord0 = input.texCoord0;
|
|
output.texCoord1 = input.texCoord1;
|
|
output.texCoord2 = input.texCoord2;
|
|
output.texCoord3 = input.texCoord3;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorVaryingsToFragInputs' */
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorCopyToSDI' */
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "ScenePickingPass"
|
|
Tags
|
|
{
|
|
"LightMode" = "Picking"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_CullMode]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma editor_sync_compilation
|
|
#pragma instancing_options renderinglayer
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_DEPTH_ONLY
|
|
#define SCENEPICKINGPASS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
struct CustomInterpolators
|
|
{
|
|
};
|
|
#define USE_CUSTOMINTERP_SUBSTRUCT
|
|
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_COLOR
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 color : COLOR;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 positionRWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 WorldSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
float4 VertexColor;
|
|
float3 TimeParameters;
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float3 positionRWS : INTERP2;
|
|
float3 normalWS : INTERP3;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.positionRWS.xyz = input.positionRWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.positionRWS = input.positionRWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Add_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
void Unity_Distance_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = distance(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Less_float(float A, float B, out float Out)
|
|
{
|
|
Out = A < B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Comparison_Greater_float(float A, float B, out float Out)
|
|
{
|
|
Out = A > B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Subtract_float(float A, float B, out float Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_And_float(float A, float B, out float Out)
|
|
{
|
|
Out = A && B;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Length_float4(float4 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Subtract_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_Normalize_float3(float3 In, out float3 Out)
|
|
{
|
|
Out = normalize(In);
|
|
}
|
|
|
|
void Unity_Length_float3(float3 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
void Unity_Add_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(float4x4 Matrix4_cb72bb33b7a84dfda97778a514f9b60f, float3 Vector3_90379ebf40aa468b8362f8d265f4f234, float4 Vector4_159bb4232f82428893101734a03e2a1e, Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float IN, out float4 WindPoint_1)
|
|
{
|
|
float3 _Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3 = Vector3_90379ebf40aa468b8362f8d265f4f234;
|
|
float4x4 _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4 = Matrix4_cb72bb33b7a84dfda97778a514f9b60f;
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].r);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].g);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].b);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].a);
|
|
float3 _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4.xyz), _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3);
|
|
float3 _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3);
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[0];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[1];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[2];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[3];
|
|
float _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float);
|
|
float4 _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4 = Vector4_159bb4232f82428893101734a03e2a1e;
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[0];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[1];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[2];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[3];
|
|
float _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float;
|
|
Unity_Divide_float(_Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float, _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float);
|
|
float _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float, float(0), float(1), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float);
|
|
float _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float;
|
|
Unity_Lerp_float(_Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float, float(0), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float);
|
|
float3 _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3, (_Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float.xxx), _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3);
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[0];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[1];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[2];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_A_4_Float = 0;
|
|
float4 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4;
|
|
float3 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3;
|
|
float2 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2);
|
|
float3 _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4.xyz), _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3);
|
|
float3 _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3);
|
|
float _Split_8bbd5052350846968bf312362efd9f01_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[0];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[1];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[2];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[3];
|
|
float _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float);
|
|
float _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float;
|
|
Unity_Divide_float(_Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float, _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float);
|
|
float _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float, float(0), float(1), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float);
|
|
float _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float;
|
|
Unity_Lerp_float(_Split_8bbd5052350846968bf312362efd9f01_A_4_Float, float(0), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float);
|
|
float3 _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3, (_Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float.xxx), _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3);
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[0];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[1];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[2];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_A_4_Float = 0;
|
|
float4 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4;
|
|
float3 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3;
|
|
float2 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2);
|
|
float4 _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4;
|
|
Unity_Add_float4(_Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4);
|
|
float3 _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4.xyz), _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3);
|
|
float3 _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3);
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[0];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[1];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[2];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[3];
|
|
float _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float);
|
|
float _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float;
|
|
Unity_Divide_float(_Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float, _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float);
|
|
float _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float, float(0), float(1), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float);
|
|
float _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float;
|
|
Unity_Lerp_float(_Split_fa21a8022f944854903e06c07c6f079c_A_4_Float, float(0), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float);
|
|
float3 _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3, (_Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float.xxx), _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3);
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[0];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[1];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[2];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_A_4_Float = 0;
|
|
float4 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4;
|
|
float3 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3;
|
|
float2 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2);
|
|
float4 _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4);
|
|
float3 _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4.xyz), _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3);
|
|
float3 _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3);
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[0];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[1];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[2];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[3];
|
|
float _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float);
|
|
float _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float;
|
|
Unity_Divide_float(_Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float, _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float);
|
|
float _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float, float(0), float(1), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float);
|
|
float _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float;
|
|
Unity_Lerp_float(_Split_1bfec6763d4b458398e36937b4114c29_A_4_Float, float(0), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float);
|
|
float3 _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3, (_Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float.xxx), _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3);
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_R_1_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[0];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[1];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[2];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_A_4_Float = 0;
|
|
float4 _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4;
|
|
float3 _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3;
|
|
float2 _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_e22879e6c4574322ab21f6261a21bced_R_1_Float, _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float, _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3, _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2);
|
|
float4 _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4);
|
|
WindPoint_1 = _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Or_float(float A, float B, out float Out)
|
|
{
|
|
Out = A || B;
|
|
}
|
|
|
|
void Unity_Branch_float3(float Predicate, float3 True, float3 False, out float3 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Add_float(float A, float B, out float Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(float3 Vector3_604F121F, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7F78DDD2, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float Vector1_5EFF6B1A, Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float IN, out float3 direction_1, out float strength_2)
|
|
{
|
|
float4 _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[0];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[1];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[2];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_A_4_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[3];
|
|
float4 _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4;
|
|
float3 _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3;
|
|
float2 _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float, float(0), _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4, _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2);
|
|
float3 _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3);
|
|
float4 _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_R_1_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[0];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_G_2_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[1];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_B_3_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[2];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[3];
|
|
float3 _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, (_Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float.xxx), _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3);
|
|
float _Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float = Vector1_9365F438;
|
|
float _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float, float(0), _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean);
|
|
UnityTexture2D _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float3 _Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3 = float3(float(1), float(0), float(0));
|
|
float _Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float.xxx), _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3);
|
|
float _Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float = Vector1_5EFF6B1A;
|
|
float3 _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3);
|
|
float3 _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3, _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3, _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3);
|
|
float _Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float = Vector1_6803B355;
|
|
float3 _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3, (_Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float.xxx), _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3);
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[0];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_G_2_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[1];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[2];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_A_4_Float = 0;
|
|
float4 _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4;
|
|
float3 _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3;
|
|
float2 _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float, _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float, float(0), float(0), _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4, _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3, _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.tex, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.samplerstate, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.GetTransformedUV(_Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_G_6_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_B_7_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_A_8_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.a;
|
|
float _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float;
|
|
Unity_Branch_float(_Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean, _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float, float(0), _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float);
|
|
float _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float;
|
|
Unity_Power_float(_Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float, float(2), _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float);
|
|
float _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float = Vector1_F53C4B89;
|
|
float _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float;
|
|
Unity_Multiply_float_float(_Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float, _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float, _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float);
|
|
float3 _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3((_Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float.xxx), _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3);
|
|
float _Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3, (_Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float.xxx), _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3);
|
|
float3 _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3, _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3, _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3);
|
|
float4 _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_e719665c40324e89a536d165d0427a68_R_1_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[0];
|
|
float _Split_e719665c40324e89a536d165d0427a68_G_2_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[1];
|
|
float _Split_e719665c40324e89a536d165d0427a68_B_3_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[2];
|
|
float _Split_e719665c40324e89a536d165d0427a68_A_4_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[3];
|
|
float _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Split_e719665c40324e89a536d165d0427a68_A_4_Float, float(0), _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean);
|
|
float _Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float = Vector1_2EC6D670;
|
|
float _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float, float(0), _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean);
|
|
float _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean;
|
|
Unity_Or_float(_Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean, _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean, _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean);
|
|
UnityTexture2D _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
float3 _Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Split_e719665c40324e89a536d165d0427a68_A_4_Float.xxx), _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3);
|
|
float3 _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3);
|
|
float3 _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3, _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3, _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3);
|
|
float _Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float = Vector1_B4470F9B;
|
|
float3 _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3, (_Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float.xxx), _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3);
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[0];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_G_2_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[1];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[2];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_A_4_Float = 0;
|
|
float4 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4;
|
|
float3 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3;
|
|
float2 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float, _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float, float(0), float(0), _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.tex, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.samplerstate, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.GetTransformedUV(_Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_A_8_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.a;
|
|
float4 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4;
|
|
float3 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3;
|
|
float2 _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2;
|
|
Unity_Combine_float(_SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float, float(0), _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4, _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2);
|
|
float3 _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3;
|
|
Unity_Add_float3(_Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, float3(-0.5, -0.5, -0.5), _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3);
|
|
float3 _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3;
|
|
Unity_Branch_float3(_Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean, _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3, float3(0, 0, 0), _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3);
|
|
float _Property_9946d066804cc584a96830f8d35269cc_Out_0_Float = Vector1_2EC6D670;
|
|
float3 _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3, (_Property_9946d066804cc584a96830f8d35269cc_Out_0_Float.xxx), _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3);
|
|
float3 _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3, _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3, _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3);
|
|
float _Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float = Vector1_A2C4B4F4;
|
|
float3 _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3, (_Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float.xxx), _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3);
|
|
float _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float;
|
|
Unity_Length_float3(_Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3, _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float);
|
|
float _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float = Vector1_7F78DDD2;
|
|
float _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float;
|
|
Unity_Add_float(_Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float, _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float, _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float);
|
|
float _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
Unity_Multiply_float_float(_Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float, 0.001, _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float);
|
|
direction_1 = _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
strength_2 = _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
}
|
|
|
|
void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = cross(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Equal_float(float A, float B, out float Out)
|
|
{
|
|
Out = A == B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_DotProduct_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = dot(A, B);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Maximum_float(float A, float B, out float Out)
|
|
{
|
|
Out = max(A, B);
|
|
}
|
|
|
|
void Unity_Cosine_float(float In, out float Out)
|
|
{
|
|
Out = cos(In);
|
|
}
|
|
|
|
void Unity_Sine_float(float In, out float Out)
|
|
{
|
|
Out = sin(In);
|
|
}
|
|
|
|
void Unity_Comparison_NotEqual_float(float A, float B, out float Out)
|
|
{
|
|
Out = A != B ? 1 : 0;
|
|
}
|
|
|
|
struct Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float4 VertexColor;
|
|
};
|
|
|
|
void SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(float Vector1_BCB03E1A, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7EE0F94A, float Boolean_527CB26E, float Vector1_DE1BF63A, float Vector1_7F78DDD2, float3 Vector3_DE8CC74D, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float4x4 Matrix4_0617b0bd42fc46ff90b1d55303a5477f, float4 Vector4_b44806ec67ca461fbcdf009dc6092cc3, Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float IN, out float3 vertex_1, out float3 normal_2)
|
|
{
|
|
float4 _Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3;
|
|
{
|
|
// Converting Position from Object to AbsoluteWorld via world space
|
|
float3 world;
|
|
world = TransformObjectToWorld((_Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4.xyz).xyz);
|
|
_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3 = GetAbsolutePositionWS(world);
|
|
}
|
|
float _Distance_343883e4e5444664abed46100940f24f_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3, float3(0, 0, 0), _Distance_343883e4e5444664abed46100940f24f_Out_2_Float);
|
|
float _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Distance_343883e4e5444664abed46100940f24f_Out_2_Float, float(0.001), _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean);
|
|
float3 _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3 = Vector3_C30D997B;
|
|
float4 _Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3;
|
|
_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3 = TransformObjectToWorld((_Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4.xyz).xyz);
|
|
float3 _Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3;
|
|
_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3 = TransformObjectToWorld(_Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3.xyz);
|
|
float _Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean = Boolean_527CB26E;
|
|
float _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float = Vector1_7EE0F94A;
|
|
float _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, float(0), _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean);
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_R_1_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[0];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[1];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_B_3_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[2];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_A_4_Float = 0;
|
|
float _Split_7a634ef857769683b2100876a36535a2_R_1_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[0];
|
|
float _Split_7a634ef857769683b2100876a36535a2_G_2_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[1];
|
|
float _Split_7a634ef857769683b2100876a36535a2_B_3_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[2];
|
|
float _Split_7a634ef857769683b2100876a36535a2_A_4_Float = 0;
|
|
float _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float;
|
|
Unity_Subtract_float(_Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float, _Split_7a634ef857769683b2100876a36535a2_G_2_Float, _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float);
|
|
float _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float, _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean);
|
|
float _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean;
|
|
Unity_And_float(_Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean, _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean);
|
|
float _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float = Vector1_A2C4B4F4;
|
|
float _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float;
|
|
Unity_Branch_float(_And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean, float(1E-05), _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float);
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_R_1_Float = IN.VertexColor[0];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_G_2_Float = IN.VertexColor[1];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_B_3_Float = IN.VertexColor[2];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float = IN.VertexColor[3];
|
|
float _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float);
|
|
float _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float;
|
|
Unity_Branch_float(_Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float);
|
|
float _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float = Vector1_7F78DDD2;
|
|
UnityTexture2D _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
UnityTexture2D _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float4 _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float;
|
|
Unity_Length_float4(_Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float);
|
|
float _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float, float(0), _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean);
|
|
float4 _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4;
|
|
Unity_Branch_float4(_Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean, _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, float4(0, 0, 1, 1), _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4);
|
|
float4x4 _Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4 = Matrix4_0617b0bd42fc46ff90b1d55303a5477f;
|
|
float4 _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4 = Vector4_b44806ec67ca461fbcdf009dc6092cc3;
|
|
Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float _WindNMPoints_071e9370484b4168b560a27fbea64a52;
|
|
float4 _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4;
|
|
SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(_Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4, SHADERGRAPH_OBJECT_POSITION, _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4);
|
|
float4 _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4;
|
|
Unity_Add_float4(_Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4);
|
|
float _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float = Vector1_B4470F9B;
|
|
float _Property_6b508d48a081548385021b27896c0622_Out_0_Float = Vector1_2EC6D670;
|
|
float _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float = Vector1_9365F438;
|
|
float _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float = Vector1_F53C4B89;
|
|
float _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float = Vector1_6803B355;
|
|
float _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float = Vector1_BCB03E1A;
|
|
Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba;
|
|
float3 _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3;
|
|
float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float;
|
|
SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float, _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float, _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D, _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4, _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float, _Property_6b508d48a081548385021b27896c0622_Out_0_Float, _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float, _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float, _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float, _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float);
|
|
float3 _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3;
|
|
Unity_CrossProduct_float(float3 (0, 1, 0), _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3);
|
|
float _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean;
|
|
Unity_Comparison_Equal_float((_CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3).x, float(0), _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean);
|
|
float3 _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean, float3(1E-06, 1E-06, 1E-06), _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3, _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3);
|
|
float3 _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3, _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3);
|
|
float3 _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3);
|
|
float _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float;
|
|
Unity_DotProduct_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3, _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float);
|
|
float3 _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, (_DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float.xxx), _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3);
|
|
float3 _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3;
|
|
Unity_Add_float3(_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3);
|
|
float3 _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3);
|
|
float _Distance_702b068f612c7289a99272879da274ed_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Distance_702b068f612c7289a99272879da274ed_Out_2_Float);
|
|
float _Property_f5c255b0f666358291012b78132d6593_Out_0_Float = Vector1_DE1BF63A;
|
|
float _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float;
|
|
Unity_Divide_float(_Distance_702b068f612c7289a99272879da274ed_Out_2_Float, _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float);
|
|
float _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float;
|
|
Unity_Absolute_float(_Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float, _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float);
|
|
float _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float = float(1E-07);
|
|
float _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float;
|
|
Unity_Maximum_float(_Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float, _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float, _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float);
|
|
float _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float;
|
|
Unity_Divide_float(float(1), _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float);
|
|
float _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float;
|
|
Unity_Power_float(_Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float);
|
|
float _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float;
|
|
Unity_Multiply_float_float(_WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float, _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float);
|
|
float _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float;
|
|
Unity_Cosine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float);
|
|
float3 _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, (_Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float.xxx), _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3);
|
|
float3 _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3;
|
|
Unity_CrossProduct_float(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3);
|
|
float _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float;
|
|
Unity_Sine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float);
|
|
float3 _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3, (_Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float.xxx), _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3);
|
|
float3 _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3, _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3);
|
|
float3 _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3, _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3);
|
|
float3 _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3;
|
|
_Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3 = TransformWorldToObject(_Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3.xyz);
|
|
float3 _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean, _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3, _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3, _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3);
|
|
float3 _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3 = Vector3_DE8CC74D;
|
|
float _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float;
|
|
Unity_Length_float3(_Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float);
|
|
float _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean;
|
|
Unity_Comparison_NotEqual_float(_Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float, float(0), _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean);
|
|
float3 _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(IN.WorldSpaceNormal, _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3);
|
|
float3 _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3, IN.WorldSpaceNormal, _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3);
|
|
vertex_1 = _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
normal_2 = _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
}
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
float3 _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3;
|
|
Unity_Add_float3(IN.ObjectSpacePosition, float3(1E-07, 1E-07, 1E-07), _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3);
|
|
float _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float = _Drag;
|
|
float _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float = _HeightDrag;
|
|
float _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float = _Stiffness;
|
|
float _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float = _InitialBend;
|
|
float4 _Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4 = _NewNormal;
|
|
UnityTexture2D _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexNoise);
|
|
UnityTexture2D _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexGust);
|
|
float4 _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4 = WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float = WIND_SETTINGS_FlexNoiseScale;
|
|
float _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float = WIND_SETTINGS_Turbulence;
|
|
float _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float = WIND_SETTINGS_GustSpeed;
|
|
float _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float = WIND_SETTINGS_GustScale;
|
|
float _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float = WIND_SETTINGS_GustWorldScale;
|
|
float4x4 _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4 = WIND_SETTINGS_Points;
|
|
float4 _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4 = WIND_SETTINGS_Points_Radius;
|
|
Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.WorldSpaceNormal = IN.WorldSpaceNormal;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.VertexColor = IN.VertexColor;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3;
|
|
SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(IN.TimeParameters.x, _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3, _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float, _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float, 0, _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float, _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float, (_Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4.xyz), _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D, _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D, _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4, _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float, _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float, _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float, _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float, _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float, _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4, _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3);
|
|
description.Position = _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.WorldSpaceNormal = TransformObjectToWorldNormal(input.normalOS);
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
output.VertexColor = input.color;
|
|
output.TimeParameters = _TimeParameters.xyz; // Note: in case of animation this will be overwrite (allow to handle motion vector)
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
vertexDescriptionInputs.TimeParameters = timeParameters;
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
input.positionOS = vertexDescription.Position;
|
|
input.normalOS = vertexDescription.Normal;
|
|
input.tangentOS.xyz = vertexDescription.Tangent;
|
|
|
|
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.positionRWS = input.positionRWS;
|
|
output.tangentToWorld = BuildTangentToWorld(input.tangentWS, input.normalWS);
|
|
output.texCoord0 = input.texCoord0;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassDepthOnly.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "SceneSelectionPass"
|
|
Tags
|
|
{
|
|
"LightMode" = "SceneSelectionPass"
|
|
}
|
|
|
|
// Render State
|
|
Cull Off
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma editor_sync_compilation
|
|
#pragma instancing_options renderinglayer
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_DEPTH_ONLY
|
|
#define RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define SCENESELECTIONPASS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
struct CustomInterpolators
|
|
{
|
|
};
|
|
#define USE_CUSTOMINTERP_SUBSTRUCT
|
|
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_COLOR
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 color : COLOR;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 positionRWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 WorldSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
float4 VertexColor;
|
|
float3 TimeParameters;
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float3 positionRWS : INTERP2;
|
|
float3 normalWS : INTERP3;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.positionRWS.xyz = input.positionRWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.positionRWS = input.positionRWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Add_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
void Unity_Distance_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = distance(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Less_float(float A, float B, out float Out)
|
|
{
|
|
Out = A < B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Comparison_Greater_float(float A, float B, out float Out)
|
|
{
|
|
Out = A > B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Subtract_float(float A, float B, out float Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_And_float(float A, float B, out float Out)
|
|
{
|
|
Out = A && B;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Length_float4(float4 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Subtract_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_Normalize_float3(float3 In, out float3 Out)
|
|
{
|
|
Out = normalize(In);
|
|
}
|
|
|
|
void Unity_Length_float3(float3 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
void Unity_Add_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(float4x4 Matrix4_cb72bb33b7a84dfda97778a514f9b60f, float3 Vector3_90379ebf40aa468b8362f8d265f4f234, float4 Vector4_159bb4232f82428893101734a03e2a1e, Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float IN, out float4 WindPoint_1)
|
|
{
|
|
float3 _Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3 = Vector3_90379ebf40aa468b8362f8d265f4f234;
|
|
float4x4 _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4 = Matrix4_cb72bb33b7a84dfda97778a514f9b60f;
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].r);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].g);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].b);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].a);
|
|
float3 _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4.xyz), _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3);
|
|
float3 _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3);
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[0];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[1];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[2];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[3];
|
|
float _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float);
|
|
float4 _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4 = Vector4_159bb4232f82428893101734a03e2a1e;
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[0];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[1];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[2];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[3];
|
|
float _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float;
|
|
Unity_Divide_float(_Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float, _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float);
|
|
float _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float, float(0), float(1), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float);
|
|
float _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float;
|
|
Unity_Lerp_float(_Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float, float(0), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float);
|
|
float3 _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3, (_Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float.xxx), _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3);
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[0];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[1];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[2];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_A_4_Float = 0;
|
|
float4 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4;
|
|
float3 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3;
|
|
float2 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2);
|
|
float3 _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4.xyz), _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3);
|
|
float3 _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3);
|
|
float _Split_8bbd5052350846968bf312362efd9f01_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[0];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[1];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[2];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[3];
|
|
float _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float);
|
|
float _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float;
|
|
Unity_Divide_float(_Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float, _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float);
|
|
float _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float, float(0), float(1), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float);
|
|
float _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float;
|
|
Unity_Lerp_float(_Split_8bbd5052350846968bf312362efd9f01_A_4_Float, float(0), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float);
|
|
float3 _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3, (_Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float.xxx), _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3);
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[0];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[1];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[2];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_A_4_Float = 0;
|
|
float4 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4;
|
|
float3 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3;
|
|
float2 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2);
|
|
float4 _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4;
|
|
Unity_Add_float4(_Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4);
|
|
float3 _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4.xyz), _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3);
|
|
float3 _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3);
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[0];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[1];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[2];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[3];
|
|
float _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float);
|
|
float _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float;
|
|
Unity_Divide_float(_Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float, _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float);
|
|
float _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float, float(0), float(1), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float);
|
|
float _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float;
|
|
Unity_Lerp_float(_Split_fa21a8022f944854903e06c07c6f079c_A_4_Float, float(0), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float);
|
|
float3 _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3, (_Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float.xxx), _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3);
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[0];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[1];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[2];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_A_4_Float = 0;
|
|
float4 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4;
|
|
float3 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3;
|
|
float2 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2);
|
|
float4 _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4);
|
|
float3 _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4.xyz), _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3);
|
|
float3 _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3);
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[0];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[1];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[2];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[3];
|
|
float _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float);
|
|
float _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float;
|
|
Unity_Divide_float(_Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float, _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float);
|
|
float _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float, float(0), float(1), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float);
|
|
float _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float;
|
|
Unity_Lerp_float(_Split_1bfec6763d4b458398e36937b4114c29_A_4_Float, float(0), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float);
|
|
float3 _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3, (_Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float.xxx), _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3);
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_R_1_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[0];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[1];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[2];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_A_4_Float = 0;
|
|
float4 _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4;
|
|
float3 _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3;
|
|
float2 _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_e22879e6c4574322ab21f6261a21bced_R_1_Float, _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float, _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3, _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2);
|
|
float4 _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4);
|
|
WindPoint_1 = _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Or_float(float A, float B, out float Out)
|
|
{
|
|
Out = A || B;
|
|
}
|
|
|
|
void Unity_Branch_float3(float Predicate, float3 True, float3 False, out float3 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Add_float(float A, float B, out float Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(float3 Vector3_604F121F, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7F78DDD2, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float Vector1_5EFF6B1A, Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float IN, out float3 direction_1, out float strength_2)
|
|
{
|
|
float4 _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[0];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[1];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[2];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_A_4_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[3];
|
|
float4 _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4;
|
|
float3 _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3;
|
|
float2 _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float, float(0), _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4, _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2);
|
|
float3 _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3);
|
|
float4 _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_R_1_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[0];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_G_2_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[1];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_B_3_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[2];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[3];
|
|
float3 _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, (_Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float.xxx), _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3);
|
|
float _Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float = Vector1_9365F438;
|
|
float _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float, float(0), _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean);
|
|
UnityTexture2D _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float3 _Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3 = float3(float(1), float(0), float(0));
|
|
float _Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float.xxx), _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3);
|
|
float _Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float = Vector1_5EFF6B1A;
|
|
float3 _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3);
|
|
float3 _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3, _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3, _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3);
|
|
float _Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float = Vector1_6803B355;
|
|
float3 _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3, (_Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float.xxx), _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3);
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[0];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_G_2_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[1];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[2];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_A_4_Float = 0;
|
|
float4 _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4;
|
|
float3 _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3;
|
|
float2 _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float, _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float, float(0), float(0), _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4, _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3, _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.tex, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.samplerstate, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.GetTransformedUV(_Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_G_6_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_B_7_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_A_8_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.a;
|
|
float _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float;
|
|
Unity_Branch_float(_Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean, _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float, float(0), _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float);
|
|
float _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float;
|
|
Unity_Power_float(_Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float, float(2), _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float);
|
|
float _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float = Vector1_F53C4B89;
|
|
float _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float;
|
|
Unity_Multiply_float_float(_Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float, _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float, _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float);
|
|
float3 _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3((_Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float.xxx), _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3);
|
|
float _Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3, (_Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float.xxx), _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3);
|
|
float3 _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3, _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3, _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3);
|
|
float4 _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_e719665c40324e89a536d165d0427a68_R_1_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[0];
|
|
float _Split_e719665c40324e89a536d165d0427a68_G_2_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[1];
|
|
float _Split_e719665c40324e89a536d165d0427a68_B_3_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[2];
|
|
float _Split_e719665c40324e89a536d165d0427a68_A_4_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[3];
|
|
float _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Split_e719665c40324e89a536d165d0427a68_A_4_Float, float(0), _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean);
|
|
float _Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float = Vector1_2EC6D670;
|
|
float _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float, float(0), _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean);
|
|
float _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean;
|
|
Unity_Or_float(_Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean, _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean, _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean);
|
|
UnityTexture2D _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
float3 _Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Split_e719665c40324e89a536d165d0427a68_A_4_Float.xxx), _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3);
|
|
float3 _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3);
|
|
float3 _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3, _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3, _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3);
|
|
float _Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float = Vector1_B4470F9B;
|
|
float3 _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3, (_Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float.xxx), _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3);
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[0];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_G_2_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[1];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[2];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_A_4_Float = 0;
|
|
float4 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4;
|
|
float3 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3;
|
|
float2 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float, _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float, float(0), float(0), _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.tex, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.samplerstate, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.GetTransformedUV(_Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_A_8_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.a;
|
|
float4 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4;
|
|
float3 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3;
|
|
float2 _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2;
|
|
Unity_Combine_float(_SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float, float(0), _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4, _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2);
|
|
float3 _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3;
|
|
Unity_Add_float3(_Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, float3(-0.5, -0.5, -0.5), _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3);
|
|
float3 _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3;
|
|
Unity_Branch_float3(_Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean, _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3, float3(0, 0, 0), _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3);
|
|
float _Property_9946d066804cc584a96830f8d35269cc_Out_0_Float = Vector1_2EC6D670;
|
|
float3 _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3, (_Property_9946d066804cc584a96830f8d35269cc_Out_0_Float.xxx), _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3);
|
|
float3 _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3, _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3, _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3);
|
|
float _Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float = Vector1_A2C4B4F4;
|
|
float3 _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3, (_Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float.xxx), _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3);
|
|
float _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float;
|
|
Unity_Length_float3(_Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3, _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float);
|
|
float _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float = Vector1_7F78DDD2;
|
|
float _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float;
|
|
Unity_Add_float(_Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float, _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float, _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float);
|
|
float _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
Unity_Multiply_float_float(_Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float, 0.001, _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float);
|
|
direction_1 = _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
strength_2 = _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
}
|
|
|
|
void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = cross(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Equal_float(float A, float B, out float Out)
|
|
{
|
|
Out = A == B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_DotProduct_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = dot(A, B);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Maximum_float(float A, float B, out float Out)
|
|
{
|
|
Out = max(A, B);
|
|
}
|
|
|
|
void Unity_Cosine_float(float In, out float Out)
|
|
{
|
|
Out = cos(In);
|
|
}
|
|
|
|
void Unity_Sine_float(float In, out float Out)
|
|
{
|
|
Out = sin(In);
|
|
}
|
|
|
|
void Unity_Comparison_NotEqual_float(float A, float B, out float Out)
|
|
{
|
|
Out = A != B ? 1 : 0;
|
|
}
|
|
|
|
struct Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float4 VertexColor;
|
|
};
|
|
|
|
void SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(float Vector1_BCB03E1A, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7EE0F94A, float Boolean_527CB26E, float Vector1_DE1BF63A, float Vector1_7F78DDD2, float3 Vector3_DE8CC74D, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float4x4 Matrix4_0617b0bd42fc46ff90b1d55303a5477f, float4 Vector4_b44806ec67ca461fbcdf009dc6092cc3, Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float IN, out float3 vertex_1, out float3 normal_2)
|
|
{
|
|
float4 _Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3;
|
|
{
|
|
// Converting Position from Object to AbsoluteWorld via world space
|
|
float3 world;
|
|
world = TransformObjectToWorld((_Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4.xyz).xyz);
|
|
_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3 = GetAbsolutePositionWS(world);
|
|
}
|
|
float _Distance_343883e4e5444664abed46100940f24f_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3, float3(0, 0, 0), _Distance_343883e4e5444664abed46100940f24f_Out_2_Float);
|
|
float _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Distance_343883e4e5444664abed46100940f24f_Out_2_Float, float(0.001), _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean);
|
|
float3 _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3 = Vector3_C30D997B;
|
|
float4 _Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3;
|
|
_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3 = TransformObjectToWorld((_Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4.xyz).xyz);
|
|
float3 _Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3;
|
|
_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3 = TransformObjectToWorld(_Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3.xyz);
|
|
float _Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean = Boolean_527CB26E;
|
|
float _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float = Vector1_7EE0F94A;
|
|
float _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, float(0), _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean);
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_R_1_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[0];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[1];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_B_3_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[2];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_A_4_Float = 0;
|
|
float _Split_7a634ef857769683b2100876a36535a2_R_1_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[0];
|
|
float _Split_7a634ef857769683b2100876a36535a2_G_2_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[1];
|
|
float _Split_7a634ef857769683b2100876a36535a2_B_3_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[2];
|
|
float _Split_7a634ef857769683b2100876a36535a2_A_4_Float = 0;
|
|
float _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float;
|
|
Unity_Subtract_float(_Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float, _Split_7a634ef857769683b2100876a36535a2_G_2_Float, _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float);
|
|
float _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float, _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean);
|
|
float _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean;
|
|
Unity_And_float(_Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean, _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean);
|
|
float _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float = Vector1_A2C4B4F4;
|
|
float _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float;
|
|
Unity_Branch_float(_And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean, float(1E-05), _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float);
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_R_1_Float = IN.VertexColor[0];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_G_2_Float = IN.VertexColor[1];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_B_3_Float = IN.VertexColor[2];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float = IN.VertexColor[3];
|
|
float _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float);
|
|
float _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float;
|
|
Unity_Branch_float(_Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float);
|
|
float _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float = Vector1_7F78DDD2;
|
|
UnityTexture2D _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
UnityTexture2D _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float4 _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float;
|
|
Unity_Length_float4(_Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float);
|
|
float _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float, float(0), _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean);
|
|
float4 _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4;
|
|
Unity_Branch_float4(_Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean, _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, float4(0, 0, 1, 1), _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4);
|
|
float4x4 _Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4 = Matrix4_0617b0bd42fc46ff90b1d55303a5477f;
|
|
float4 _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4 = Vector4_b44806ec67ca461fbcdf009dc6092cc3;
|
|
Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float _WindNMPoints_071e9370484b4168b560a27fbea64a52;
|
|
float4 _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4;
|
|
SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(_Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4, SHADERGRAPH_OBJECT_POSITION, _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4);
|
|
float4 _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4;
|
|
Unity_Add_float4(_Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4);
|
|
float _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float = Vector1_B4470F9B;
|
|
float _Property_6b508d48a081548385021b27896c0622_Out_0_Float = Vector1_2EC6D670;
|
|
float _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float = Vector1_9365F438;
|
|
float _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float = Vector1_F53C4B89;
|
|
float _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float = Vector1_6803B355;
|
|
float _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float = Vector1_BCB03E1A;
|
|
Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba;
|
|
float3 _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3;
|
|
float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float;
|
|
SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float, _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float, _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D, _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4, _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float, _Property_6b508d48a081548385021b27896c0622_Out_0_Float, _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float, _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float, _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float, _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float);
|
|
float3 _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3;
|
|
Unity_CrossProduct_float(float3 (0, 1, 0), _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3);
|
|
float _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean;
|
|
Unity_Comparison_Equal_float((_CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3).x, float(0), _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean);
|
|
float3 _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean, float3(1E-06, 1E-06, 1E-06), _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3, _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3);
|
|
float3 _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3, _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3);
|
|
float3 _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3);
|
|
float _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float;
|
|
Unity_DotProduct_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3, _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float);
|
|
float3 _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, (_DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float.xxx), _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3);
|
|
float3 _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3;
|
|
Unity_Add_float3(_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3);
|
|
float3 _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3);
|
|
float _Distance_702b068f612c7289a99272879da274ed_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Distance_702b068f612c7289a99272879da274ed_Out_2_Float);
|
|
float _Property_f5c255b0f666358291012b78132d6593_Out_0_Float = Vector1_DE1BF63A;
|
|
float _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float;
|
|
Unity_Divide_float(_Distance_702b068f612c7289a99272879da274ed_Out_2_Float, _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float);
|
|
float _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float;
|
|
Unity_Absolute_float(_Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float, _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float);
|
|
float _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float = float(1E-07);
|
|
float _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float;
|
|
Unity_Maximum_float(_Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float, _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float, _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float);
|
|
float _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float;
|
|
Unity_Divide_float(float(1), _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float);
|
|
float _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float;
|
|
Unity_Power_float(_Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float);
|
|
float _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float;
|
|
Unity_Multiply_float_float(_WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float, _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float);
|
|
float _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float;
|
|
Unity_Cosine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float);
|
|
float3 _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, (_Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float.xxx), _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3);
|
|
float3 _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3;
|
|
Unity_CrossProduct_float(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3);
|
|
float _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float;
|
|
Unity_Sine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float);
|
|
float3 _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3, (_Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float.xxx), _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3);
|
|
float3 _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3, _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3);
|
|
float3 _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3, _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3);
|
|
float3 _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3;
|
|
_Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3 = TransformWorldToObject(_Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3.xyz);
|
|
float3 _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean, _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3, _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3, _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3);
|
|
float3 _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3 = Vector3_DE8CC74D;
|
|
float _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float;
|
|
Unity_Length_float3(_Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float);
|
|
float _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean;
|
|
Unity_Comparison_NotEqual_float(_Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float, float(0), _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean);
|
|
float3 _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(IN.WorldSpaceNormal, _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3);
|
|
float3 _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3, IN.WorldSpaceNormal, _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3);
|
|
vertex_1 = _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
normal_2 = _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
}
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
float3 _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3;
|
|
Unity_Add_float3(IN.ObjectSpacePosition, float3(1E-07, 1E-07, 1E-07), _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3);
|
|
float _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float = _Drag;
|
|
float _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float = _HeightDrag;
|
|
float _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float = _Stiffness;
|
|
float _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float = _InitialBend;
|
|
float4 _Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4 = _NewNormal;
|
|
UnityTexture2D _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexNoise);
|
|
UnityTexture2D _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexGust);
|
|
float4 _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4 = WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float = WIND_SETTINGS_FlexNoiseScale;
|
|
float _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float = WIND_SETTINGS_Turbulence;
|
|
float _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float = WIND_SETTINGS_GustSpeed;
|
|
float _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float = WIND_SETTINGS_GustScale;
|
|
float _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float = WIND_SETTINGS_GustWorldScale;
|
|
float4x4 _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4 = WIND_SETTINGS_Points;
|
|
float4 _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4 = WIND_SETTINGS_Points_Radius;
|
|
Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.WorldSpaceNormal = IN.WorldSpaceNormal;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.VertexColor = IN.VertexColor;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3;
|
|
SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(IN.TimeParameters.x, _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3, _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float, _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float, 0, _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float, _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float, (_Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4.xyz), _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D, _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D, _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4, _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float, _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float, _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float, _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float, _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float, _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4, _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3);
|
|
description.Position = _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.WorldSpaceNormal = TransformObjectToWorldNormal(input.normalOS);
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
output.VertexColor = input.color;
|
|
output.TimeParameters = _TimeParameters.xyz; // Note: in case of animation this will be overwrite (allow to handle motion vector)
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
vertexDescriptionInputs.TimeParameters = timeParameters;
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
input.positionOS = vertexDescription.Position;
|
|
input.normalOS = vertexDescription.Normal;
|
|
input.tangentOS.xyz = vertexDescription.Tangent;
|
|
|
|
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.positionRWS = input.positionRWS;
|
|
output.tangentToWorld = BuildTangentToWorld(input.tangentWS, input.normalWS);
|
|
output.texCoord0 = input.texCoord0;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassDepthOnly.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "MotionVectors"
|
|
Tags
|
|
{
|
|
"LightMode" = "MotionVectors"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_CullMode]
|
|
ZWrite On
|
|
Stencil
|
|
{
|
|
WriteMask [_StencilWriteMaskMV]
|
|
Ref [_StencilRefMV]
|
|
CompFront Always
|
|
PassFront Replace
|
|
CompBack Always
|
|
PassBack Replace
|
|
}
|
|
AlphaToMask [_AlphaCutoffEnable]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma instancing_options renderinglayer
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma multi_compile_fragment _ WRITE_MSAA_DEPTH
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma multi_compile_fragment _ WRITE_DECAL_BUFFER_AND_RENDERING_LAYER
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_MOTION_VECTORS
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
struct CustomInterpolators
|
|
{
|
|
};
|
|
#define USE_CUSTOMINTERP_SUBSTRUCT
|
|
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_COLOR
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 color : COLOR;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 positionRWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 WorldSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
float4 VertexColor;
|
|
float3 TimeParameters;
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float3 positionRWS : INTERP2;
|
|
float3 normalWS : INTERP3;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.positionRWS.xyz = input.positionRWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.positionRWS = input.positionRWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Add_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
void Unity_Distance_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = distance(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Less_float(float A, float B, out float Out)
|
|
{
|
|
Out = A < B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Comparison_Greater_float(float A, float B, out float Out)
|
|
{
|
|
Out = A > B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Subtract_float(float A, float B, out float Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_And_float(float A, float B, out float Out)
|
|
{
|
|
Out = A && B;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Length_float4(float4 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Subtract_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_Normalize_float3(float3 In, out float3 Out)
|
|
{
|
|
Out = normalize(In);
|
|
}
|
|
|
|
void Unity_Length_float3(float3 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
void Unity_Add_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(float4x4 Matrix4_cb72bb33b7a84dfda97778a514f9b60f, float3 Vector3_90379ebf40aa468b8362f8d265f4f234, float4 Vector4_159bb4232f82428893101734a03e2a1e, Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float IN, out float4 WindPoint_1)
|
|
{
|
|
float3 _Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3 = Vector3_90379ebf40aa468b8362f8d265f4f234;
|
|
float4x4 _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4 = Matrix4_cb72bb33b7a84dfda97778a514f9b60f;
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].r);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].g);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].b);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].a);
|
|
float3 _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4.xyz), _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3);
|
|
float3 _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3);
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[0];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[1];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[2];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[3];
|
|
float _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float);
|
|
float4 _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4 = Vector4_159bb4232f82428893101734a03e2a1e;
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[0];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[1];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[2];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[3];
|
|
float _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float;
|
|
Unity_Divide_float(_Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float, _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float);
|
|
float _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float, float(0), float(1), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float);
|
|
float _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float;
|
|
Unity_Lerp_float(_Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float, float(0), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float);
|
|
float3 _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3, (_Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float.xxx), _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3);
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[0];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[1];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[2];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_A_4_Float = 0;
|
|
float4 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4;
|
|
float3 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3;
|
|
float2 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2);
|
|
float3 _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4.xyz), _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3);
|
|
float3 _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3);
|
|
float _Split_8bbd5052350846968bf312362efd9f01_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[0];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[1];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[2];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[3];
|
|
float _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float);
|
|
float _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float;
|
|
Unity_Divide_float(_Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float, _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float);
|
|
float _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float, float(0), float(1), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float);
|
|
float _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float;
|
|
Unity_Lerp_float(_Split_8bbd5052350846968bf312362efd9f01_A_4_Float, float(0), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float);
|
|
float3 _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3, (_Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float.xxx), _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3);
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[0];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[1];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[2];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_A_4_Float = 0;
|
|
float4 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4;
|
|
float3 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3;
|
|
float2 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2);
|
|
float4 _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4;
|
|
Unity_Add_float4(_Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4);
|
|
float3 _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4.xyz), _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3);
|
|
float3 _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3);
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[0];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[1];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[2];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[3];
|
|
float _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float);
|
|
float _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float;
|
|
Unity_Divide_float(_Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float, _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float);
|
|
float _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float, float(0), float(1), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float);
|
|
float _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float;
|
|
Unity_Lerp_float(_Split_fa21a8022f944854903e06c07c6f079c_A_4_Float, float(0), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float);
|
|
float3 _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3, (_Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float.xxx), _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3);
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[0];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[1];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[2];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_A_4_Float = 0;
|
|
float4 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4;
|
|
float3 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3;
|
|
float2 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2);
|
|
float4 _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4);
|
|
float3 _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4.xyz), _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3);
|
|
float3 _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3);
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[0];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[1];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[2];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[3];
|
|
float _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float);
|
|
float _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float;
|
|
Unity_Divide_float(_Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float, _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float);
|
|
float _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float, float(0), float(1), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float);
|
|
float _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float;
|
|
Unity_Lerp_float(_Split_1bfec6763d4b458398e36937b4114c29_A_4_Float, float(0), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float);
|
|
float3 _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3, (_Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float.xxx), _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3);
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_R_1_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[0];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[1];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[2];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_A_4_Float = 0;
|
|
float4 _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4;
|
|
float3 _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3;
|
|
float2 _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_e22879e6c4574322ab21f6261a21bced_R_1_Float, _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float, _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3, _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2);
|
|
float4 _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4);
|
|
WindPoint_1 = _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Or_float(float A, float B, out float Out)
|
|
{
|
|
Out = A || B;
|
|
}
|
|
|
|
void Unity_Branch_float3(float Predicate, float3 True, float3 False, out float3 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Add_float(float A, float B, out float Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(float3 Vector3_604F121F, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7F78DDD2, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float Vector1_5EFF6B1A, Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float IN, out float3 direction_1, out float strength_2)
|
|
{
|
|
float4 _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[0];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[1];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[2];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_A_4_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[3];
|
|
float4 _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4;
|
|
float3 _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3;
|
|
float2 _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float, float(0), _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4, _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2);
|
|
float3 _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3);
|
|
float4 _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_R_1_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[0];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_G_2_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[1];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_B_3_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[2];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[3];
|
|
float3 _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, (_Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float.xxx), _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3);
|
|
float _Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float = Vector1_9365F438;
|
|
float _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float, float(0), _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean);
|
|
UnityTexture2D _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float3 _Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3 = float3(float(1), float(0), float(0));
|
|
float _Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float.xxx), _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3);
|
|
float _Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float = Vector1_5EFF6B1A;
|
|
float3 _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3);
|
|
float3 _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3, _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3, _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3);
|
|
float _Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float = Vector1_6803B355;
|
|
float3 _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3, (_Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float.xxx), _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3);
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[0];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_G_2_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[1];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[2];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_A_4_Float = 0;
|
|
float4 _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4;
|
|
float3 _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3;
|
|
float2 _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float, _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float, float(0), float(0), _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4, _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3, _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.tex, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.samplerstate, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.GetTransformedUV(_Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_G_6_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_B_7_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_A_8_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.a;
|
|
float _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float;
|
|
Unity_Branch_float(_Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean, _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float, float(0), _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float);
|
|
float _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float;
|
|
Unity_Power_float(_Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float, float(2), _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float);
|
|
float _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float = Vector1_F53C4B89;
|
|
float _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float;
|
|
Unity_Multiply_float_float(_Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float, _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float, _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float);
|
|
float3 _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3((_Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float.xxx), _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3);
|
|
float _Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3, (_Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float.xxx), _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3);
|
|
float3 _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3, _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3, _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3);
|
|
float4 _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_e719665c40324e89a536d165d0427a68_R_1_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[0];
|
|
float _Split_e719665c40324e89a536d165d0427a68_G_2_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[1];
|
|
float _Split_e719665c40324e89a536d165d0427a68_B_3_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[2];
|
|
float _Split_e719665c40324e89a536d165d0427a68_A_4_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[3];
|
|
float _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Split_e719665c40324e89a536d165d0427a68_A_4_Float, float(0), _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean);
|
|
float _Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float = Vector1_2EC6D670;
|
|
float _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float, float(0), _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean);
|
|
float _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean;
|
|
Unity_Or_float(_Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean, _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean, _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean);
|
|
UnityTexture2D _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
float3 _Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Split_e719665c40324e89a536d165d0427a68_A_4_Float.xxx), _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3);
|
|
float3 _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3);
|
|
float3 _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3, _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3, _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3);
|
|
float _Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float = Vector1_B4470F9B;
|
|
float3 _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3, (_Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float.xxx), _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3);
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[0];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_G_2_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[1];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[2];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_A_4_Float = 0;
|
|
float4 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4;
|
|
float3 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3;
|
|
float2 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float, _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float, float(0), float(0), _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.tex, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.samplerstate, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.GetTransformedUV(_Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_A_8_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.a;
|
|
float4 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4;
|
|
float3 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3;
|
|
float2 _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2;
|
|
Unity_Combine_float(_SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float, float(0), _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4, _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2);
|
|
float3 _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3;
|
|
Unity_Add_float3(_Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, float3(-0.5, -0.5, -0.5), _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3);
|
|
float3 _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3;
|
|
Unity_Branch_float3(_Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean, _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3, float3(0, 0, 0), _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3);
|
|
float _Property_9946d066804cc584a96830f8d35269cc_Out_0_Float = Vector1_2EC6D670;
|
|
float3 _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3, (_Property_9946d066804cc584a96830f8d35269cc_Out_0_Float.xxx), _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3);
|
|
float3 _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3, _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3, _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3);
|
|
float _Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float = Vector1_A2C4B4F4;
|
|
float3 _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3, (_Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float.xxx), _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3);
|
|
float _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float;
|
|
Unity_Length_float3(_Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3, _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float);
|
|
float _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float = Vector1_7F78DDD2;
|
|
float _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float;
|
|
Unity_Add_float(_Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float, _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float, _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float);
|
|
float _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
Unity_Multiply_float_float(_Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float, 0.001, _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float);
|
|
direction_1 = _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
strength_2 = _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
}
|
|
|
|
void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = cross(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Equal_float(float A, float B, out float Out)
|
|
{
|
|
Out = A == B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_DotProduct_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = dot(A, B);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Maximum_float(float A, float B, out float Out)
|
|
{
|
|
Out = max(A, B);
|
|
}
|
|
|
|
void Unity_Cosine_float(float In, out float Out)
|
|
{
|
|
Out = cos(In);
|
|
}
|
|
|
|
void Unity_Sine_float(float In, out float Out)
|
|
{
|
|
Out = sin(In);
|
|
}
|
|
|
|
void Unity_Comparison_NotEqual_float(float A, float B, out float Out)
|
|
{
|
|
Out = A != B ? 1 : 0;
|
|
}
|
|
|
|
struct Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float4 VertexColor;
|
|
};
|
|
|
|
void SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(float Vector1_BCB03E1A, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7EE0F94A, float Boolean_527CB26E, float Vector1_DE1BF63A, float Vector1_7F78DDD2, float3 Vector3_DE8CC74D, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float4x4 Matrix4_0617b0bd42fc46ff90b1d55303a5477f, float4 Vector4_b44806ec67ca461fbcdf009dc6092cc3, Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float IN, out float3 vertex_1, out float3 normal_2)
|
|
{
|
|
float4 _Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3;
|
|
{
|
|
// Converting Position from Object to AbsoluteWorld via world space
|
|
float3 world;
|
|
world = TransformObjectToWorld((_Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4.xyz).xyz);
|
|
_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3 = GetAbsolutePositionWS(world);
|
|
}
|
|
float _Distance_343883e4e5444664abed46100940f24f_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3, float3(0, 0, 0), _Distance_343883e4e5444664abed46100940f24f_Out_2_Float);
|
|
float _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Distance_343883e4e5444664abed46100940f24f_Out_2_Float, float(0.001), _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean);
|
|
float3 _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3 = Vector3_C30D997B;
|
|
float4 _Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3;
|
|
_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3 = TransformObjectToWorld((_Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4.xyz).xyz);
|
|
float3 _Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3;
|
|
_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3 = TransformObjectToWorld(_Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3.xyz);
|
|
float _Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean = Boolean_527CB26E;
|
|
float _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float = Vector1_7EE0F94A;
|
|
float _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, float(0), _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean);
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_R_1_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[0];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[1];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_B_3_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[2];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_A_4_Float = 0;
|
|
float _Split_7a634ef857769683b2100876a36535a2_R_1_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[0];
|
|
float _Split_7a634ef857769683b2100876a36535a2_G_2_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[1];
|
|
float _Split_7a634ef857769683b2100876a36535a2_B_3_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[2];
|
|
float _Split_7a634ef857769683b2100876a36535a2_A_4_Float = 0;
|
|
float _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float;
|
|
Unity_Subtract_float(_Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float, _Split_7a634ef857769683b2100876a36535a2_G_2_Float, _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float);
|
|
float _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float, _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean);
|
|
float _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean;
|
|
Unity_And_float(_Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean, _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean);
|
|
float _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float = Vector1_A2C4B4F4;
|
|
float _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float;
|
|
Unity_Branch_float(_And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean, float(1E-05), _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float);
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_R_1_Float = IN.VertexColor[0];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_G_2_Float = IN.VertexColor[1];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_B_3_Float = IN.VertexColor[2];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float = IN.VertexColor[3];
|
|
float _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float);
|
|
float _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float;
|
|
Unity_Branch_float(_Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float);
|
|
float _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float = Vector1_7F78DDD2;
|
|
UnityTexture2D _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
UnityTexture2D _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float4 _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float;
|
|
Unity_Length_float4(_Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float);
|
|
float _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float, float(0), _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean);
|
|
float4 _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4;
|
|
Unity_Branch_float4(_Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean, _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, float4(0, 0, 1, 1), _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4);
|
|
float4x4 _Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4 = Matrix4_0617b0bd42fc46ff90b1d55303a5477f;
|
|
float4 _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4 = Vector4_b44806ec67ca461fbcdf009dc6092cc3;
|
|
Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float _WindNMPoints_071e9370484b4168b560a27fbea64a52;
|
|
float4 _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4;
|
|
SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(_Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4, SHADERGRAPH_OBJECT_POSITION, _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4);
|
|
float4 _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4;
|
|
Unity_Add_float4(_Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4);
|
|
float _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float = Vector1_B4470F9B;
|
|
float _Property_6b508d48a081548385021b27896c0622_Out_0_Float = Vector1_2EC6D670;
|
|
float _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float = Vector1_9365F438;
|
|
float _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float = Vector1_F53C4B89;
|
|
float _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float = Vector1_6803B355;
|
|
float _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float = Vector1_BCB03E1A;
|
|
Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba;
|
|
float3 _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3;
|
|
float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float;
|
|
SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float, _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float, _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D, _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4, _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float, _Property_6b508d48a081548385021b27896c0622_Out_0_Float, _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float, _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float, _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float, _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float);
|
|
float3 _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3;
|
|
Unity_CrossProduct_float(float3 (0, 1, 0), _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3);
|
|
float _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean;
|
|
Unity_Comparison_Equal_float((_CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3).x, float(0), _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean);
|
|
float3 _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean, float3(1E-06, 1E-06, 1E-06), _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3, _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3);
|
|
float3 _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3, _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3);
|
|
float3 _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3);
|
|
float _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float;
|
|
Unity_DotProduct_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3, _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float);
|
|
float3 _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, (_DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float.xxx), _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3);
|
|
float3 _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3;
|
|
Unity_Add_float3(_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3);
|
|
float3 _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3);
|
|
float _Distance_702b068f612c7289a99272879da274ed_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Distance_702b068f612c7289a99272879da274ed_Out_2_Float);
|
|
float _Property_f5c255b0f666358291012b78132d6593_Out_0_Float = Vector1_DE1BF63A;
|
|
float _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float;
|
|
Unity_Divide_float(_Distance_702b068f612c7289a99272879da274ed_Out_2_Float, _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float);
|
|
float _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float;
|
|
Unity_Absolute_float(_Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float, _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float);
|
|
float _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float = float(1E-07);
|
|
float _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float;
|
|
Unity_Maximum_float(_Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float, _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float, _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float);
|
|
float _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float;
|
|
Unity_Divide_float(float(1), _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float);
|
|
float _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float;
|
|
Unity_Power_float(_Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float);
|
|
float _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float;
|
|
Unity_Multiply_float_float(_WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float, _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float);
|
|
float _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float;
|
|
Unity_Cosine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float);
|
|
float3 _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, (_Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float.xxx), _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3);
|
|
float3 _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3;
|
|
Unity_CrossProduct_float(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3);
|
|
float _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float;
|
|
Unity_Sine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float);
|
|
float3 _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3, (_Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float.xxx), _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3);
|
|
float3 _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3, _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3);
|
|
float3 _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3, _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3);
|
|
float3 _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3;
|
|
_Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3 = TransformWorldToObject(_Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3.xyz);
|
|
float3 _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean, _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3, _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3, _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3);
|
|
float3 _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3 = Vector3_DE8CC74D;
|
|
float _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float;
|
|
Unity_Length_float3(_Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float);
|
|
float _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean;
|
|
Unity_Comparison_NotEqual_float(_Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float, float(0), _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean);
|
|
float3 _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(IN.WorldSpaceNormal, _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3);
|
|
float3 _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3, IN.WorldSpaceNormal, _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3);
|
|
vertex_1 = _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
normal_2 = _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
}
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
float3 _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3;
|
|
Unity_Add_float3(IN.ObjectSpacePosition, float3(1E-07, 1E-07, 1E-07), _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3);
|
|
float _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float = _Drag;
|
|
float _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float = _HeightDrag;
|
|
float _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float = _Stiffness;
|
|
float _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float = _InitialBend;
|
|
float4 _Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4 = _NewNormal;
|
|
UnityTexture2D _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexNoise);
|
|
UnityTexture2D _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexGust);
|
|
float4 _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4 = WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float = WIND_SETTINGS_FlexNoiseScale;
|
|
float _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float = WIND_SETTINGS_Turbulence;
|
|
float _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float = WIND_SETTINGS_GustSpeed;
|
|
float _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float = WIND_SETTINGS_GustScale;
|
|
float _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float = WIND_SETTINGS_GustWorldScale;
|
|
float4x4 _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4 = WIND_SETTINGS_Points;
|
|
float4 _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4 = WIND_SETTINGS_Points_Radius;
|
|
Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.WorldSpaceNormal = IN.WorldSpaceNormal;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.VertexColor = IN.VertexColor;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3;
|
|
SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(IN.TimeParameters.x, _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3, _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float, _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float, 0, _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float, _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float, (_Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4.xyz), _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D, _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D, _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4, _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float, _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float, _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float, _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float, _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float, _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4, _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3);
|
|
description.Position = _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.WorldSpaceNormal = TransformObjectToWorldNormal(input.normalOS);
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
output.VertexColor = input.color;
|
|
output.TimeParameters = _TimeParameters.xyz; // Note: in case of animation this will be overwrite (allow to handle motion vector)
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
vertexDescriptionInputs.TimeParameters = timeParameters;
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
input.positionOS = vertexDescription.Position;
|
|
input.normalOS = vertexDescription.Normal;
|
|
input.tangentOS.xyz = vertexDescription.Tangent;
|
|
|
|
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.positionRWS = input.positionRWS;
|
|
output.tangentToWorld = BuildTangentToWorld(input.tangentWS, input.normalWS);
|
|
output.texCoord0 = input.texCoord0;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassMotionVectors.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "TransparentDepthPrepass"
|
|
Tags
|
|
{
|
|
"LightMode" = "TransparentDepthPrepass"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_CullMode]
|
|
Blend One Zero
|
|
ZWrite On
|
|
Stencil
|
|
{
|
|
WriteMask [_StencilWriteMaskDepth]
|
|
Ref [_StencilRefDepth]
|
|
CompFront Always
|
|
PassFront Replace
|
|
CompBack Always
|
|
PassBack Replace
|
|
}
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma instancing_options renderinglayer
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#define RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
struct CustomInterpolators
|
|
{
|
|
};
|
|
#define USE_CUSTOMINTERP_SUBSTRUCT
|
|
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_COLOR
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
// GraphIncludes: <None>
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 color : COLOR;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 WorldSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
float4 VertexColor;
|
|
float3 TimeParameters;
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float3 normalWS : INTERP2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Add_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
void Unity_Distance_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = distance(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Less_float(float A, float B, out float Out)
|
|
{
|
|
Out = A < B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Comparison_Greater_float(float A, float B, out float Out)
|
|
{
|
|
Out = A > B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Subtract_float(float A, float B, out float Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_And_float(float A, float B, out float Out)
|
|
{
|
|
Out = A && B;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Length_float4(float4 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Subtract_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_Normalize_float3(float3 In, out float3 Out)
|
|
{
|
|
Out = normalize(In);
|
|
}
|
|
|
|
void Unity_Length_float3(float3 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
void Unity_Add_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(float4x4 Matrix4_cb72bb33b7a84dfda97778a514f9b60f, float3 Vector3_90379ebf40aa468b8362f8d265f4f234, float4 Vector4_159bb4232f82428893101734a03e2a1e, Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float IN, out float4 WindPoint_1)
|
|
{
|
|
float3 _Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3 = Vector3_90379ebf40aa468b8362f8d265f4f234;
|
|
float4x4 _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4 = Matrix4_cb72bb33b7a84dfda97778a514f9b60f;
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].r);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].g);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].b);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].a);
|
|
float3 _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4.xyz), _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3);
|
|
float3 _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3);
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[0];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[1];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[2];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[3];
|
|
float _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float);
|
|
float4 _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4 = Vector4_159bb4232f82428893101734a03e2a1e;
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[0];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[1];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[2];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[3];
|
|
float _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float;
|
|
Unity_Divide_float(_Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float, _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float);
|
|
float _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float, float(0), float(1), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float);
|
|
float _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float;
|
|
Unity_Lerp_float(_Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float, float(0), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float);
|
|
float3 _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3, (_Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float.xxx), _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3);
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[0];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[1];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[2];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_A_4_Float = 0;
|
|
float4 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4;
|
|
float3 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3;
|
|
float2 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2);
|
|
float3 _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4.xyz), _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3);
|
|
float3 _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3);
|
|
float _Split_8bbd5052350846968bf312362efd9f01_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[0];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[1];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[2];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[3];
|
|
float _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float);
|
|
float _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float;
|
|
Unity_Divide_float(_Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float, _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float);
|
|
float _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float, float(0), float(1), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float);
|
|
float _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float;
|
|
Unity_Lerp_float(_Split_8bbd5052350846968bf312362efd9f01_A_4_Float, float(0), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float);
|
|
float3 _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3, (_Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float.xxx), _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3);
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[0];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[1];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[2];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_A_4_Float = 0;
|
|
float4 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4;
|
|
float3 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3;
|
|
float2 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2);
|
|
float4 _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4;
|
|
Unity_Add_float4(_Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4);
|
|
float3 _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4.xyz), _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3);
|
|
float3 _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3);
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[0];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[1];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[2];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[3];
|
|
float _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float);
|
|
float _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float;
|
|
Unity_Divide_float(_Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float, _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float);
|
|
float _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float, float(0), float(1), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float);
|
|
float _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float;
|
|
Unity_Lerp_float(_Split_fa21a8022f944854903e06c07c6f079c_A_4_Float, float(0), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float);
|
|
float3 _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3, (_Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float.xxx), _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3);
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[0];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[1];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[2];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_A_4_Float = 0;
|
|
float4 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4;
|
|
float3 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3;
|
|
float2 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2);
|
|
float4 _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4);
|
|
float3 _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4.xyz), _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3);
|
|
float3 _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3);
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[0];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[1];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[2];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[3];
|
|
float _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float);
|
|
float _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float;
|
|
Unity_Divide_float(_Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float, _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float);
|
|
float _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float, float(0), float(1), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float);
|
|
float _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float;
|
|
Unity_Lerp_float(_Split_1bfec6763d4b458398e36937b4114c29_A_4_Float, float(0), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float);
|
|
float3 _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3, (_Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float.xxx), _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3);
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_R_1_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[0];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[1];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[2];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_A_4_Float = 0;
|
|
float4 _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4;
|
|
float3 _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3;
|
|
float2 _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_e22879e6c4574322ab21f6261a21bced_R_1_Float, _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float, _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3, _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2);
|
|
float4 _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4);
|
|
WindPoint_1 = _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Or_float(float A, float B, out float Out)
|
|
{
|
|
Out = A || B;
|
|
}
|
|
|
|
void Unity_Branch_float3(float Predicate, float3 True, float3 False, out float3 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Add_float(float A, float B, out float Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(float3 Vector3_604F121F, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7F78DDD2, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float Vector1_5EFF6B1A, Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float IN, out float3 direction_1, out float strength_2)
|
|
{
|
|
float4 _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[0];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[1];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[2];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_A_4_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[3];
|
|
float4 _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4;
|
|
float3 _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3;
|
|
float2 _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float, float(0), _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4, _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2);
|
|
float3 _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3);
|
|
float4 _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_R_1_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[0];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_G_2_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[1];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_B_3_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[2];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[3];
|
|
float3 _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, (_Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float.xxx), _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3);
|
|
float _Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float = Vector1_9365F438;
|
|
float _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float, float(0), _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean);
|
|
UnityTexture2D _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float3 _Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3 = float3(float(1), float(0), float(0));
|
|
float _Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float.xxx), _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3);
|
|
float _Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float = Vector1_5EFF6B1A;
|
|
float3 _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3);
|
|
float3 _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3, _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3, _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3);
|
|
float _Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float = Vector1_6803B355;
|
|
float3 _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3, (_Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float.xxx), _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3);
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[0];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_G_2_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[1];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[2];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_A_4_Float = 0;
|
|
float4 _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4;
|
|
float3 _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3;
|
|
float2 _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float, _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float, float(0), float(0), _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4, _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3, _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.tex, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.samplerstate, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.GetTransformedUV(_Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_G_6_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_B_7_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_A_8_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.a;
|
|
float _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float;
|
|
Unity_Branch_float(_Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean, _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float, float(0), _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float);
|
|
float _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float;
|
|
Unity_Power_float(_Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float, float(2), _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float);
|
|
float _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float = Vector1_F53C4B89;
|
|
float _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float;
|
|
Unity_Multiply_float_float(_Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float, _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float, _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float);
|
|
float3 _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3((_Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float.xxx), _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3);
|
|
float _Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3, (_Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float.xxx), _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3);
|
|
float3 _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3, _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3, _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3);
|
|
float4 _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_e719665c40324e89a536d165d0427a68_R_1_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[0];
|
|
float _Split_e719665c40324e89a536d165d0427a68_G_2_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[1];
|
|
float _Split_e719665c40324e89a536d165d0427a68_B_3_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[2];
|
|
float _Split_e719665c40324e89a536d165d0427a68_A_4_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[3];
|
|
float _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Split_e719665c40324e89a536d165d0427a68_A_4_Float, float(0), _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean);
|
|
float _Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float = Vector1_2EC6D670;
|
|
float _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float, float(0), _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean);
|
|
float _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean;
|
|
Unity_Or_float(_Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean, _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean, _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean);
|
|
UnityTexture2D _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
float3 _Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Split_e719665c40324e89a536d165d0427a68_A_4_Float.xxx), _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3);
|
|
float3 _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3);
|
|
float3 _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3, _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3, _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3);
|
|
float _Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float = Vector1_B4470F9B;
|
|
float3 _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3, (_Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float.xxx), _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3);
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[0];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_G_2_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[1];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[2];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_A_4_Float = 0;
|
|
float4 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4;
|
|
float3 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3;
|
|
float2 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float, _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float, float(0), float(0), _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.tex, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.samplerstate, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.GetTransformedUV(_Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_A_8_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.a;
|
|
float4 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4;
|
|
float3 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3;
|
|
float2 _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2;
|
|
Unity_Combine_float(_SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float, float(0), _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4, _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2);
|
|
float3 _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3;
|
|
Unity_Add_float3(_Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, float3(-0.5, -0.5, -0.5), _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3);
|
|
float3 _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3;
|
|
Unity_Branch_float3(_Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean, _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3, float3(0, 0, 0), _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3);
|
|
float _Property_9946d066804cc584a96830f8d35269cc_Out_0_Float = Vector1_2EC6D670;
|
|
float3 _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3, (_Property_9946d066804cc584a96830f8d35269cc_Out_0_Float.xxx), _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3);
|
|
float3 _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3, _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3, _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3);
|
|
float _Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float = Vector1_A2C4B4F4;
|
|
float3 _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3, (_Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float.xxx), _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3);
|
|
float _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float;
|
|
Unity_Length_float3(_Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3, _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float);
|
|
float _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float = Vector1_7F78DDD2;
|
|
float _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float;
|
|
Unity_Add_float(_Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float, _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float, _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float);
|
|
float _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
Unity_Multiply_float_float(_Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float, 0.001, _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float);
|
|
direction_1 = _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
strength_2 = _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
}
|
|
|
|
void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = cross(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Equal_float(float A, float B, out float Out)
|
|
{
|
|
Out = A == B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_DotProduct_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = dot(A, B);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Maximum_float(float A, float B, out float Out)
|
|
{
|
|
Out = max(A, B);
|
|
}
|
|
|
|
void Unity_Cosine_float(float In, out float Out)
|
|
{
|
|
Out = cos(In);
|
|
}
|
|
|
|
void Unity_Sine_float(float In, out float Out)
|
|
{
|
|
Out = sin(In);
|
|
}
|
|
|
|
void Unity_Comparison_NotEqual_float(float A, float B, out float Out)
|
|
{
|
|
Out = A != B ? 1 : 0;
|
|
}
|
|
|
|
struct Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float4 VertexColor;
|
|
};
|
|
|
|
void SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(float Vector1_BCB03E1A, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7EE0F94A, float Boolean_527CB26E, float Vector1_DE1BF63A, float Vector1_7F78DDD2, float3 Vector3_DE8CC74D, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float4x4 Matrix4_0617b0bd42fc46ff90b1d55303a5477f, float4 Vector4_b44806ec67ca461fbcdf009dc6092cc3, Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float IN, out float3 vertex_1, out float3 normal_2)
|
|
{
|
|
float4 _Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3;
|
|
{
|
|
// Converting Position from Object to AbsoluteWorld via world space
|
|
float3 world;
|
|
world = TransformObjectToWorld((_Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4.xyz).xyz);
|
|
_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3 = GetAbsolutePositionWS(world);
|
|
}
|
|
float _Distance_343883e4e5444664abed46100940f24f_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3, float3(0, 0, 0), _Distance_343883e4e5444664abed46100940f24f_Out_2_Float);
|
|
float _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Distance_343883e4e5444664abed46100940f24f_Out_2_Float, float(0.001), _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean);
|
|
float3 _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3 = Vector3_C30D997B;
|
|
float4 _Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3;
|
|
_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3 = TransformObjectToWorld((_Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4.xyz).xyz);
|
|
float3 _Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3;
|
|
_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3 = TransformObjectToWorld(_Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3.xyz);
|
|
float _Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean = Boolean_527CB26E;
|
|
float _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float = Vector1_7EE0F94A;
|
|
float _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, float(0), _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean);
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_R_1_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[0];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[1];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_B_3_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[2];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_A_4_Float = 0;
|
|
float _Split_7a634ef857769683b2100876a36535a2_R_1_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[0];
|
|
float _Split_7a634ef857769683b2100876a36535a2_G_2_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[1];
|
|
float _Split_7a634ef857769683b2100876a36535a2_B_3_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[2];
|
|
float _Split_7a634ef857769683b2100876a36535a2_A_4_Float = 0;
|
|
float _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float;
|
|
Unity_Subtract_float(_Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float, _Split_7a634ef857769683b2100876a36535a2_G_2_Float, _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float);
|
|
float _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float, _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean);
|
|
float _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean;
|
|
Unity_And_float(_Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean, _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean);
|
|
float _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float = Vector1_A2C4B4F4;
|
|
float _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float;
|
|
Unity_Branch_float(_And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean, float(1E-05), _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float);
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_R_1_Float = IN.VertexColor[0];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_G_2_Float = IN.VertexColor[1];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_B_3_Float = IN.VertexColor[2];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float = IN.VertexColor[3];
|
|
float _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float);
|
|
float _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float;
|
|
Unity_Branch_float(_Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float);
|
|
float _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float = Vector1_7F78DDD2;
|
|
UnityTexture2D _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
UnityTexture2D _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float4 _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float;
|
|
Unity_Length_float4(_Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float);
|
|
float _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float, float(0), _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean);
|
|
float4 _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4;
|
|
Unity_Branch_float4(_Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean, _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, float4(0, 0, 1, 1), _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4);
|
|
float4x4 _Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4 = Matrix4_0617b0bd42fc46ff90b1d55303a5477f;
|
|
float4 _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4 = Vector4_b44806ec67ca461fbcdf009dc6092cc3;
|
|
Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float _WindNMPoints_071e9370484b4168b560a27fbea64a52;
|
|
float4 _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4;
|
|
SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(_Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4, SHADERGRAPH_OBJECT_POSITION, _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4);
|
|
float4 _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4;
|
|
Unity_Add_float4(_Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4);
|
|
float _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float = Vector1_B4470F9B;
|
|
float _Property_6b508d48a081548385021b27896c0622_Out_0_Float = Vector1_2EC6D670;
|
|
float _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float = Vector1_9365F438;
|
|
float _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float = Vector1_F53C4B89;
|
|
float _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float = Vector1_6803B355;
|
|
float _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float = Vector1_BCB03E1A;
|
|
Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba;
|
|
float3 _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3;
|
|
float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float;
|
|
SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float, _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float, _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D, _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4, _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float, _Property_6b508d48a081548385021b27896c0622_Out_0_Float, _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float, _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float, _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float, _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float);
|
|
float3 _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3;
|
|
Unity_CrossProduct_float(float3 (0, 1, 0), _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3);
|
|
float _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean;
|
|
Unity_Comparison_Equal_float((_CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3).x, float(0), _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean);
|
|
float3 _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean, float3(1E-06, 1E-06, 1E-06), _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3, _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3);
|
|
float3 _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3, _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3);
|
|
float3 _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3);
|
|
float _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float;
|
|
Unity_DotProduct_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3, _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float);
|
|
float3 _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, (_DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float.xxx), _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3);
|
|
float3 _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3;
|
|
Unity_Add_float3(_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3);
|
|
float3 _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3);
|
|
float _Distance_702b068f612c7289a99272879da274ed_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Distance_702b068f612c7289a99272879da274ed_Out_2_Float);
|
|
float _Property_f5c255b0f666358291012b78132d6593_Out_0_Float = Vector1_DE1BF63A;
|
|
float _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float;
|
|
Unity_Divide_float(_Distance_702b068f612c7289a99272879da274ed_Out_2_Float, _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float);
|
|
float _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float;
|
|
Unity_Absolute_float(_Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float, _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float);
|
|
float _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float = float(1E-07);
|
|
float _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float;
|
|
Unity_Maximum_float(_Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float, _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float, _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float);
|
|
float _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float;
|
|
Unity_Divide_float(float(1), _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float);
|
|
float _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float;
|
|
Unity_Power_float(_Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float);
|
|
float _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float;
|
|
Unity_Multiply_float_float(_WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float, _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float);
|
|
float _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float;
|
|
Unity_Cosine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float);
|
|
float3 _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, (_Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float.xxx), _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3);
|
|
float3 _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3;
|
|
Unity_CrossProduct_float(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3);
|
|
float _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float;
|
|
Unity_Sine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float);
|
|
float3 _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3, (_Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float.xxx), _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3);
|
|
float3 _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3, _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3);
|
|
float3 _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3, _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3);
|
|
float3 _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3;
|
|
_Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3 = TransformWorldToObject(_Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3.xyz);
|
|
float3 _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean, _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3, _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3, _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3);
|
|
float3 _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3 = Vector3_DE8CC74D;
|
|
float _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float;
|
|
Unity_Length_float3(_Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float);
|
|
float _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean;
|
|
Unity_Comparison_NotEqual_float(_Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float, float(0), _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean);
|
|
float3 _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(IN.WorldSpaceNormal, _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3);
|
|
float3 _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3, IN.WorldSpaceNormal, _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3);
|
|
vertex_1 = _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
normal_2 = _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
}
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
float3 _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3;
|
|
Unity_Add_float3(IN.ObjectSpacePosition, float3(1E-07, 1E-07, 1E-07), _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3);
|
|
float _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float = _Drag;
|
|
float _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float = _HeightDrag;
|
|
float _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float = _Stiffness;
|
|
float _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float = _InitialBend;
|
|
float4 _Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4 = _NewNormal;
|
|
UnityTexture2D _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexNoise);
|
|
UnityTexture2D _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexGust);
|
|
float4 _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4 = WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float = WIND_SETTINGS_FlexNoiseScale;
|
|
float _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float = WIND_SETTINGS_Turbulence;
|
|
float _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float = WIND_SETTINGS_GustSpeed;
|
|
float _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float = WIND_SETTINGS_GustScale;
|
|
float _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float = WIND_SETTINGS_GustWorldScale;
|
|
float4x4 _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4 = WIND_SETTINGS_Points;
|
|
float4 _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4 = WIND_SETTINGS_Points_Radius;
|
|
Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.WorldSpaceNormal = IN.WorldSpaceNormal;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.VertexColor = IN.VertexColor;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3;
|
|
SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(IN.TimeParameters.x, _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3, _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float, _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float, 0, _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float, _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float, (_Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4.xyz), _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D, _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D, _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4, _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float, _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float, _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float, _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float, _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float, _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4, _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3);
|
|
description.Position = _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float3 NormalTS;
|
|
float Smoothness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.WorldSpaceNormal = TransformObjectToWorldNormal(input.normalOS);
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
output.VertexColor = input.color;
|
|
output.TimeParameters = _TimeParameters.xyz; // Note: in case of animation this will be overwrite (allow to handle motion vector)
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
vertexDescriptionInputs.TimeParameters = timeParameters;
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
input.positionOS = vertexDescription.Position;
|
|
input.normalOS = vertexDescription.Normal;
|
|
input.tangentOS.xyz = vertexDescription.Tangent;
|
|
|
|
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.tangentToWorld = BuildTangentToWorld(input.tangentWS, input.normalWS);
|
|
output.texCoord0 = input.texCoord0;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassDepthOnly.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "FullScreenDebug"
|
|
Tags
|
|
{
|
|
"LightMode" = "FullScreenDebug"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_CullMode]
|
|
ZTest LEqual
|
|
ZWrite Off
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma instancing_options renderinglayer
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
struct CustomInterpolators
|
|
{
|
|
};
|
|
#define USE_CUSTOMINTERP_SUBSTRUCT
|
|
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_COLOR
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 color : COLOR;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 positionRWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 WorldSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
float4 VertexColor;
|
|
float3 TimeParameters;
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float3 positionRWS : INTERP2;
|
|
float3 normalWS : INTERP3;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.positionRWS.xyz = input.positionRWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.positionRWS = input.positionRWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Add_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
void Unity_Distance_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = distance(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Less_float(float A, float B, out float Out)
|
|
{
|
|
Out = A < B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Comparison_Greater_float(float A, float B, out float Out)
|
|
{
|
|
Out = A > B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Subtract_float(float A, float B, out float Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_And_float(float A, float B, out float Out)
|
|
{
|
|
Out = A && B;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Length_float4(float4 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Subtract_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_Normalize_float3(float3 In, out float3 Out)
|
|
{
|
|
Out = normalize(In);
|
|
}
|
|
|
|
void Unity_Length_float3(float3 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
void Unity_Add_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(float4x4 Matrix4_cb72bb33b7a84dfda97778a514f9b60f, float3 Vector3_90379ebf40aa468b8362f8d265f4f234, float4 Vector4_159bb4232f82428893101734a03e2a1e, Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float IN, out float4 WindPoint_1)
|
|
{
|
|
float3 _Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3 = Vector3_90379ebf40aa468b8362f8d265f4f234;
|
|
float4x4 _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4 = Matrix4_cb72bb33b7a84dfda97778a514f9b60f;
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].r);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].g);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].b);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].a);
|
|
float3 _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4.xyz), _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3);
|
|
float3 _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3);
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[0];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[1];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[2];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[3];
|
|
float _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float);
|
|
float4 _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4 = Vector4_159bb4232f82428893101734a03e2a1e;
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[0];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[1];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[2];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[3];
|
|
float _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float;
|
|
Unity_Divide_float(_Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float, _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float);
|
|
float _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float, float(0), float(1), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float);
|
|
float _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float;
|
|
Unity_Lerp_float(_Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float, float(0), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float);
|
|
float3 _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3, (_Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float.xxx), _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3);
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[0];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[1];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[2];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_A_4_Float = 0;
|
|
float4 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4;
|
|
float3 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3;
|
|
float2 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2);
|
|
float3 _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4.xyz), _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3);
|
|
float3 _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3);
|
|
float _Split_8bbd5052350846968bf312362efd9f01_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[0];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[1];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[2];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[3];
|
|
float _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float);
|
|
float _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float;
|
|
Unity_Divide_float(_Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float, _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float);
|
|
float _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float, float(0), float(1), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float);
|
|
float _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float;
|
|
Unity_Lerp_float(_Split_8bbd5052350846968bf312362efd9f01_A_4_Float, float(0), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float);
|
|
float3 _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3, (_Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float.xxx), _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3);
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[0];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[1];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[2];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_A_4_Float = 0;
|
|
float4 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4;
|
|
float3 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3;
|
|
float2 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2);
|
|
float4 _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4;
|
|
Unity_Add_float4(_Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4);
|
|
float3 _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4.xyz), _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3);
|
|
float3 _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3);
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[0];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[1];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[2];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[3];
|
|
float _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float);
|
|
float _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float;
|
|
Unity_Divide_float(_Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float, _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float);
|
|
float _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float, float(0), float(1), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float);
|
|
float _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float;
|
|
Unity_Lerp_float(_Split_fa21a8022f944854903e06c07c6f079c_A_4_Float, float(0), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float);
|
|
float3 _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3, (_Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float.xxx), _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3);
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[0];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[1];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[2];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_A_4_Float = 0;
|
|
float4 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4;
|
|
float3 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3;
|
|
float2 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2);
|
|
float4 _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4);
|
|
float3 _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4.xyz), _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3);
|
|
float3 _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3);
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[0];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[1];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[2];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[3];
|
|
float _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float);
|
|
float _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float;
|
|
Unity_Divide_float(_Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float, _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float);
|
|
float _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float, float(0), float(1), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float);
|
|
float _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float;
|
|
Unity_Lerp_float(_Split_1bfec6763d4b458398e36937b4114c29_A_4_Float, float(0), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float);
|
|
float3 _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3, (_Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float.xxx), _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3);
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_R_1_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[0];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[1];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[2];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_A_4_Float = 0;
|
|
float4 _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4;
|
|
float3 _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3;
|
|
float2 _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_e22879e6c4574322ab21f6261a21bced_R_1_Float, _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float, _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3, _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2);
|
|
float4 _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4);
|
|
WindPoint_1 = _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Or_float(float A, float B, out float Out)
|
|
{
|
|
Out = A || B;
|
|
}
|
|
|
|
void Unity_Branch_float3(float Predicate, float3 True, float3 False, out float3 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Add_float(float A, float B, out float Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(float3 Vector3_604F121F, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7F78DDD2, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float Vector1_5EFF6B1A, Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float IN, out float3 direction_1, out float strength_2)
|
|
{
|
|
float4 _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[0];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[1];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[2];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_A_4_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[3];
|
|
float4 _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4;
|
|
float3 _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3;
|
|
float2 _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float, float(0), _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4, _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2);
|
|
float3 _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3);
|
|
float4 _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_R_1_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[0];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_G_2_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[1];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_B_3_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[2];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[3];
|
|
float3 _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, (_Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float.xxx), _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3);
|
|
float _Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float = Vector1_9365F438;
|
|
float _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float, float(0), _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean);
|
|
UnityTexture2D _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float3 _Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3 = float3(float(1), float(0), float(0));
|
|
float _Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float.xxx), _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3);
|
|
float _Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float = Vector1_5EFF6B1A;
|
|
float3 _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3);
|
|
float3 _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3, _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3, _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3);
|
|
float _Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float = Vector1_6803B355;
|
|
float3 _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3, (_Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float.xxx), _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3);
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[0];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_G_2_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[1];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[2];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_A_4_Float = 0;
|
|
float4 _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4;
|
|
float3 _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3;
|
|
float2 _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float, _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float, float(0), float(0), _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4, _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3, _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.tex, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.samplerstate, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.GetTransformedUV(_Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_G_6_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_B_7_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_A_8_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.a;
|
|
float _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float;
|
|
Unity_Branch_float(_Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean, _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float, float(0), _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float);
|
|
float _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float;
|
|
Unity_Power_float(_Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float, float(2), _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float);
|
|
float _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float = Vector1_F53C4B89;
|
|
float _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float;
|
|
Unity_Multiply_float_float(_Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float, _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float, _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float);
|
|
float3 _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3((_Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float.xxx), _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3);
|
|
float _Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3, (_Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float.xxx), _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3);
|
|
float3 _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3, _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3, _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3);
|
|
float4 _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_e719665c40324e89a536d165d0427a68_R_1_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[0];
|
|
float _Split_e719665c40324e89a536d165d0427a68_G_2_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[1];
|
|
float _Split_e719665c40324e89a536d165d0427a68_B_3_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[2];
|
|
float _Split_e719665c40324e89a536d165d0427a68_A_4_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[3];
|
|
float _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Split_e719665c40324e89a536d165d0427a68_A_4_Float, float(0), _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean);
|
|
float _Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float = Vector1_2EC6D670;
|
|
float _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float, float(0), _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean);
|
|
float _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean;
|
|
Unity_Or_float(_Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean, _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean, _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean);
|
|
UnityTexture2D _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
float3 _Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Split_e719665c40324e89a536d165d0427a68_A_4_Float.xxx), _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3);
|
|
float3 _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3);
|
|
float3 _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3, _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3, _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3);
|
|
float _Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float = Vector1_B4470F9B;
|
|
float3 _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3, (_Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float.xxx), _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3);
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[0];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_G_2_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[1];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[2];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_A_4_Float = 0;
|
|
float4 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4;
|
|
float3 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3;
|
|
float2 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float, _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float, float(0), float(0), _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.tex, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.samplerstate, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.GetTransformedUV(_Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_A_8_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.a;
|
|
float4 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4;
|
|
float3 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3;
|
|
float2 _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2;
|
|
Unity_Combine_float(_SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float, float(0), _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4, _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2);
|
|
float3 _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3;
|
|
Unity_Add_float3(_Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, float3(-0.5, -0.5, -0.5), _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3);
|
|
float3 _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3;
|
|
Unity_Branch_float3(_Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean, _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3, float3(0, 0, 0), _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3);
|
|
float _Property_9946d066804cc584a96830f8d35269cc_Out_0_Float = Vector1_2EC6D670;
|
|
float3 _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3, (_Property_9946d066804cc584a96830f8d35269cc_Out_0_Float.xxx), _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3);
|
|
float3 _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3, _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3, _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3);
|
|
float _Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float = Vector1_A2C4B4F4;
|
|
float3 _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3, (_Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float.xxx), _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3);
|
|
float _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float;
|
|
Unity_Length_float3(_Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3, _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float);
|
|
float _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float = Vector1_7F78DDD2;
|
|
float _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float;
|
|
Unity_Add_float(_Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float, _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float, _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float);
|
|
float _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
Unity_Multiply_float_float(_Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float, 0.001, _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float);
|
|
direction_1 = _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
strength_2 = _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
}
|
|
|
|
void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = cross(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Equal_float(float A, float B, out float Out)
|
|
{
|
|
Out = A == B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_DotProduct_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = dot(A, B);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Maximum_float(float A, float B, out float Out)
|
|
{
|
|
Out = max(A, B);
|
|
}
|
|
|
|
void Unity_Cosine_float(float In, out float Out)
|
|
{
|
|
Out = cos(In);
|
|
}
|
|
|
|
void Unity_Sine_float(float In, out float Out)
|
|
{
|
|
Out = sin(In);
|
|
}
|
|
|
|
void Unity_Comparison_NotEqual_float(float A, float B, out float Out)
|
|
{
|
|
Out = A != B ? 1 : 0;
|
|
}
|
|
|
|
struct Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float4 VertexColor;
|
|
};
|
|
|
|
void SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(float Vector1_BCB03E1A, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7EE0F94A, float Boolean_527CB26E, float Vector1_DE1BF63A, float Vector1_7F78DDD2, float3 Vector3_DE8CC74D, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float4x4 Matrix4_0617b0bd42fc46ff90b1d55303a5477f, float4 Vector4_b44806ec67ca461fbcdf009dc6092cc3, Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float IN, out float3 vertex_1, out float3 normal_2)
|
|
{
|
|
float4 _Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3;
|
|
{
|
|
// Converting Position from Object to AbsoluteWorld via world space
|
|
float3 world;
|
|
world = TransformObjectToWorld((_Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4.xyz).xyz);
|
|
_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3 = GetAbsolutePositionWS(world);
|
|
}
|
|
float _Distance_343883e4e5444664abed46100940f24f_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3, float3(0, 0, 0), _Distance_343883e4e5444664abed46100940f24f_Out_2_Float);
|
|
float _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Distance_343883e4e5444664abed46100940f24f_Out_2_Float, float(0.001), _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean);
|
|
float3 _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3 = Vector3_C30D997B;
|
|
float4 _Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3;
|
|
_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3 = TransformObjectToWorld((_Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4.xyz).xyz);
|
|
float3 _Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3;
|
|
_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3 = TransformObjectToWorld(_Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3.xyz);
|
|
float _Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean = Boolean_527CB26E;
|
|
float _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float = Vector1_7EE0F94A;
|
|
float _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, float(0), _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean);
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_R_1_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[0];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[1];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_B_3_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[2];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_A_4_Float = 0;
|
|
float _Split_7a634ef857769683b2100876a36535a2_R_1_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[0];
|
|
float _Split_7a634ef857769683b2100876a36535a2_G_2_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[1];
|
|
float _Split_7a634ef857769683b2100876a36535a2_B_3_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[2];
|
|
float _Split_7a634ef857769683b2100876a36535a2_A_4_Float = 0;
|
|
float _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float;
|
|
Unity_Subtract_float(_Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float, _Split_7a634ef857769683b2100876a36535a2_G_2_Float, _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float);
|
|
float _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float, _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean);
|
|
float _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean;
|
|
Unity_And_float(_Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean, _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean);
|
|
float _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float = Vector1_A2C4B4F4;
|
|
float _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float;
|
|
Unity_Branch_float(_And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean, float(1E-05), _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float);
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_R_1_Float = IN.VertexColor[0];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_G_2_Float = IN.VertexColor[1];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_B_3_Float = IN.VertexColor[2];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float = IN.VertexColor[3];
|
|
float _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float);
|
|
float _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float;
|
|
Unity_Branch_float(_Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float);
|
|
float _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float = Vector1_7F78DDD2;
|
|
UnityTexture2D _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
UnityTexture2D _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float4 _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float;
|
|
Unity_Length_float4(_Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float);
|
|
float _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float, float(0), _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean);
|
|
float4 _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4;
|
|
Unity_Branch_float4(_Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean, _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, float4(0, 0, 1, 1), _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4);
|
|
float4x4 _Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4 = Matrix4_0617b0bd42fc46ff90b1d55303a5477f;
|
|
float4 _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4 = Vector4_b44806ec67ca461fbcdf009dc6092cc3;
|
|
Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float _WindNMPoints_071e9370484b4168b560a27fbea64a52;
|
|
float4 _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4;
|
|
SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(_Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4, SHADERGRAPH_OBJECT_POSITION, _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4);
|
|
float4 _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4;
|
|
Unity_Add_float4(_Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4);
|
|
float _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float = Vector1_B4470F9B;
|
|
float _Property_6b508d48a081548385021b27896c0622_Out_0_Float = Vector1_2EC6D670;
|
|
float _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float = Vector1_9365F438;
|
|
float _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float = Vector1_F53C4B89;
|
|
float _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float = Vector1_6803B355;
|
|
float _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float = Vector1_BCB03E1A;
|
|
Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba;
|
|
float3 _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3;
|
|
float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float;
|
|
SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float, _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float, _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D, _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4, _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float, _Property_6b508d48a081548385021b27896c0622_Out_0_Float, _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float, _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float, _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float, _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float);
|
|
float3 _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3;
|
|
Unity_CrossProduct_float(float3 (0, 1, 0), _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3);
|
|
float _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean;
|
|
Unity_Comparison_Equal_float((_CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3).x, float(0), _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean);
|
|
float3 _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean, float3(1E-06, 1E-06, 1E-06), _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3, _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3);
|
|
float3 _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3, _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3);
|
|
float3 _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3);
|
|
float _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float;
|
|
Unity_DotProduct_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3, _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float);
|
|
float3 _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, (_DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float.xxx), _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3);
|
|
float3 _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3;
|
|
Unity_Add_float3(_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3);
|
|
float3 _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3);
|
|
float _Distance_702b068f612c7289a99272879da274ed_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Distance_702b068f612c7289a99272879da274ed_Out_2_Float);
|
|
float _Property_f5c255b0f666358291012b78132d6593_Out_0_Float = Vector1_DE1BF63A;
|
|
float _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float;
|
|
Unity_Divide_float(_Distance_702b068f612c7289a99272879da274ed_Out_2_Float, _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float);
|
|
float _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float;
|
|
Unity_Absolute_float(_Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float, _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float);
|
|
float _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float = float(1E-07);
|
|
float _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float;
|
|
Unity_Maximum_float(_Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float, _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float, _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float);
|
|
float _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float;
|
|
Unity_Divide_float(float(1), _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float);
|
|
float _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float;
|
|
Unity_Power_float(_Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float);
|
|
float _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float;
|
|
Unity_Multiply_float_float(_WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float, _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float);
|
|
float _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float;
|
|
Unity_Cosine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float);
|
|
float3 _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, (_Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float.xxx), _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3);
|
|
float3 _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3;
|
|
Unity_CrossProduct_float(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3);
|
|
float _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float;
|
|
Unity_Sine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float);
|
|
float3 _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3, (_Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float.xxx), _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3);
|
|
float3 _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3, _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3);
|
|
float3 _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3, _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3);
|
|
float3 _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3;
|
|
_Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3 = TransformWorldToObject(_Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3.xyz);
|
|
float3 _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean, _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3, _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3, _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3);
|
|
float3 _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3 = Vector3_DE8CC74D;
|
|
float _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float;
|
|
Unity_Length_float3(_Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float);
|
|
float _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean;
|
|
Unity_Comparison_NotEqual_float(_Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float, float(0), _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean);
|
|
float3 _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(IN.WorldSpaceNormal, _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3);
|
|
float3 _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3, IN.WorldSpaceNormal, _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3);
|
|
vertex_1 = _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
normal_2 = _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
}
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
float3 _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3;
|
|
Unity_Add_float3(IN.ObjectSpacePosition, float3(1E-07, 1E-07, 1E-07), _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3);
|
|
float _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float = _Drag;
|
|
float _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float = _HeightDrag;
|
|
float _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float = _Stiffness;
|
|
float _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float = _InitialBend;
|
|
float4 _Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4 = _NewNormal;
|
|
UnityTexture2D _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexNoise);
|
|
UnityTexture2D _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexGust);
|
|
float4 _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4 = WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float = WIND_SETTINGS_FlexNoiseScale;
|
|
float _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float = WIND_SETTINGS_Turbulence;
|
|
float _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float = WIND_SETTINGS_GustSpeed;
|
|
float _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float = WIND_SETTINGS_GustScale;
|
|
float _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float = WIND_SETTINGS_GustWorldScale;
|
|
float4x4 _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4 = WIND_SETTINGS_Points;
|
|
float4 _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4 = WIND_SETTINGS_Points_Radius;
|
|
Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.WorldSpaceNormal = IN.WorldSpaceNormal;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.VertexColor = IN.VertexColor;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3;
|
|
SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(IN.TimeParameters.x, _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3, _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float, _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float, 0, _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float, _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float, (_Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4.xyz), _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D, _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D, _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4, _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float, _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float, _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float, _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float, _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float, _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4, _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3);
|
|
description.Position = _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.WorldSpaceNormal = TransformObjectToWorldNormal(input.normalOS);
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
output.VertexColor = input.color;
|
|
output.TimeParameters = _TimeParameters.xyz; // Note: in case of animation this will be overwrite (allow to handle motion vector)
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
vertexDescriptionInputs.TimeParameters = timeParameters;
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
input.positionOS = vertexDescription.Position;
|
|
input.normalOS = vertexDescription.Normal;
|
|
input.tangentOS.xyz = vertexDescription.Tangent;
|
|
|
|
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.positionRWS = input.positionRWS;
|
|
output.tangentToWorld = BuildTangentToWorld(input.tangentWS, input.normalWS);
|
|
output.texCoord0 = input.texCoord0;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassFullScreenDebug.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "DepthOnly"
|
|
Tags
|
|
{
|
|
"LightMode" = "DepthOnly"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_CullMode]
|
|
ZWrite On
|
|
Stencil
|
|
{
|
|
WriteMask [_StencilWriteMaskDepth]
|
|
Ref [_StencilRefDepth]
|
|
CompFront Always
|
|
PassFront Replace
|
|
CompBack Always
|
|
PassBack Replace
|
|
}
|
|
AlphaToMask [_AlphaCutoffEnable]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma instancing_options renderinglayer
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma multi_compile_fragment _ WRITE_MSAA_DEPTH
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma multi_compile_fragment _ WRITE_DECAL_BUFFER WRITE_RENDERING_LAYER
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_DEPTH_ONLY
|
|
#define RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
struct CustomInterpolators
|
|
{
|
|
};
|
|
#define USE_CUSTOMINTERP_SUBSTRUCT
|
|
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_COLOR
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 color : COLOR;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 positionRWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 WorldSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
float4 VertexColor;
|
|
float3 TimeParameters;
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float3 positionRWS : INTERP2;
|
|
float3 normalWS : INTERP3;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.positionRWS.xyz = input.positionRWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.positionRWS = input.positionRWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Add_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
void Unity_Distance_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = distance(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Less_float(float A, float B, out float Out)
|
|
{
|
|
Out = A < B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Comparison_Greater_float(float A, float B, out float Out)
|
|
{
|
|
Out = A > B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Subtract_float(float A, float B, out float Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_And_float(float A, float B, out float Out)
|
|
{
|
|
Out = A && B;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Length_float4(float4 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Subtract_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_Normalize_float3(float3 In, out float3 Out)
|
|
{
|
|
Out = normalize(In);
|
|
}
|
|
|
|
void Unity_Length_float3(float3 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
void Unity_Add_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(float4x4 Matrix4_cb72bb33b7a84dfda97778a514f9b60f, float3 Vector3_90379ebf40aa468b8362f8d265f4f234, float4 Vector4_159bb4232f82428893101734a03e2a1e, Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float IN, out float4 WindPoint_1)
|
|
{
|
|
float3 _Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3 = Vector3_90379ebf40aa468b8362f8d265f4f234;
|
|
float4x4 _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4 = Matrix4_cb72bb33b7a84dfda97778a514f9b60f;
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].r);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].g);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].b);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].a);
|
|
float3 _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4.xyz), _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3);
|
|
float3 _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3);
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[0];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[1];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[2];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[3];
|
|
float _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float);
|
|
float4 _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4 = Vector4_159bb4232f82428893101734a03e2a1e;
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[0];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[1];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[2];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[3];
|
|
float _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float;
|
|
Unity_Divide_float(_Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float, _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float);
|
|
float _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float, float(0), float(1), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float);
|
|
float _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float;
|
|
Unity_Lerp_float(_Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float, float(0), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float);
|
|
float3 _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3, (_Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float.xxx), _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3);
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[0];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[1];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[2];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_A_4_Float = 0;
|
|
float4 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4;
|
|
float3 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3;
|
|
float2 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2);
|
|
float3 _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4.xyz), _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3);
|
|
float3 _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3);
|
|
float _Split_8bbd5052350846968bf312362efd9f01_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[0];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[1];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[2];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[3];
|
|
float _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float);
|
|
float _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float;
|
|
Unity_Divide_float(_Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float, _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float);
|
|
float _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float, float(0), float(1), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float);
|
|
float _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float;
|
|
Unity_Lerp_float(_Split_8bbd5052350846968bf312362efd9f01_A_4_Float, float(0), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float);
|
|
float3 _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3, (_Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float.xxx), _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3);
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[0];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[1];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[2];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_A_4_Float = 0;
|
|
float4 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4;
|
|
float3 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3;
|
|
float2 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2);
|
|
float4 _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4;
|
|
Unity_Add_float4(_Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4);
|
|
float3 _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4.xyz), _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3);
|
|
float3 _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3);
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[0];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[1];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[2];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[3];
|
|
float _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float);
|
|
float _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float;
|
|
Unity_Divide_float(_Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float, _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float);
|
|
float _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float, float(0), float(1), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float);
|
|
float _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float;
|
|
Unity_Lerp_float(_Split_fa21a8022f944854903e06c07c6f079c_A_4_Float, float(0), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float);
|
|
float3 _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3, (_Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float.xxx), _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3);
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[0];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[1];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[2];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_A_4_Float = 0;
|
|
float4 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4;
|
|
float3 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3;
|
|
float2 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2);
|
|
float4 _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4);
|
|
float3 _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4.xyz), _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3);
|
|
float3 _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3);
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[0];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[1];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[2];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[3];
|
|
float _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float);
|
|
float _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float;
|
|
Unity_Divide_float(_Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float, _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float);
|
|
float _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float, float(0), float(1), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float);
|
|
float _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float;
|
|
Unity_Lerp_float(_Split_1bfec6763d4b458398e36937b4114c29_A_4_Float, float(0), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float);
|
|
float3 _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3, (_Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float.xxx), _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3);
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_R_1_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[0];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[1];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[2];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_A_4_Float = 0;
|
|
float4 _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4;
|
|
float3 _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3;
|
|
float2 _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_e22879e6c4574322ab21f6261a21bced_R_1_Float, _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float, _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3, _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2);
|
|
float4 _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4);
|
|
WindPoint_1 = _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Or_float(float A, float B, out float Out)
|
|
{
|
|
Out = A || B;
|
|
}
|
|
|
|
void Unity_Branch_float3(float Predicate, float3 True, float3 False, out float3 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Add_float(float A, float B, out float Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(float3 Vector3_604F121F, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7F78DDD2, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float Vector1_5EFF6B1A, Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float IN, out float3 direction_1, out float strength_2)
|
|
{
|
|
float4 _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[0];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[1];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[2];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_A_4_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[3];
|
|
float4 _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4;
|
|
float3 _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3;
|
|
float2 _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float, float(0), _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4, _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2);
|
|
float3 _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3);
|
|
float4 _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_R_1_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[0];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_G_2_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[1];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_B_3_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[2];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[3];
|
|
float3 _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, (_Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float.xxx), _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3);
|
|
float _Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float = Vector1_9365F438;
|
|
float _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float, float(0), _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean);
|
|
UnityTexture2D _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float3 _Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3 = float3(float(1), float(0), float(0));
|
|
float _Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float.xxx), _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3);
|
|
float _Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float = Vector1_5EFF6B1A;
|
|
float3 _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3);
|
|
float3 _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3, _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3, _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3);
|
|
float _Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float = Vector1_6803B355;
|
|
float3 _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3, (_Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float.xxx), _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3);
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[0];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_G_2_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[1];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[2];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_A_4_Float = 0;
|
|
float4 _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4;
|
|
float3 _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3;
|
|
float2 _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float, _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float, float(0), float(0), _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4, _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3, _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.tex, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.samplerstate, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.GetTransformedUV(_Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_G_6_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_B_7_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_A_8_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.a;
|
|
float _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float;
|
|
Unity_Branch_float(_Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean, _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float, float(0), _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float);
|
|
float _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float;
|
|
Unity_Power_float(_Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float, float(2), _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float);
|
|
float _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float = Vector1_F53C4B89;
|
|
float _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float;
|
|
Unity_Multiply_float_float(_Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float, _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float, _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float);
|
|
float3 _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3((_Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float.xxx), _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3);
|
|
float _Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3, (_Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float.xxx), _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3);
|
|
float3 _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3, _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3, _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3);
|
|
float4 _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_e719665c40324e89a536d165d0427a68_R_1_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[0];
|
|
float _Split_e719665c40324e89a536d165d0427a68_G_2_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[1];
|
|
float _Split_e719665c40324e89a536d165d0427a68_B_3_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[2];
|
|
float _Split_e719665c40324e89a536d165d0427a68_A_4_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[3];
|
|
float _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Split_e719665c40324e89a536d165d0427a68_A_4_Float, float(0), _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean);
|
|
float _Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float = Vector1_2EC6D670;
|
|
float _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float, float(0), _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean);
|
|
float _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean;
|
|
Unity_Or_float(_Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean, _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean, _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean);
|
|
UnityTexture2D _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
float3 _Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Split_e719665c40324e89a536d165d0427a68_A_4_Float.xxx), _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3);
|
|
float3 _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3);
|
|
float3 _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3, _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3, _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3);
|
|
float _Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float = Vector1_B4470F9B;
|
|
float3 _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3, (_Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float.xxx), _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3);
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[0];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_G_2_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[1];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[2];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_A_4_Float = 0;
|
|
float4 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4;
|
|
float3 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3;
|
|
float2 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float, _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float, float(0), float(0), _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.tex, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.samplerstate, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.GetTransformedUV(_Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_A_8_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.a;
|
|
float4 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4;
|
|
float3 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3;
|
|
float2 _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2;
|
|
Unity_Combine_float(_SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float, float(0), _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4, _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2);
|
|
float3 _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3;
|
|
Unity_Add_float3(_Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, float3(-0.5, -0.5, -0.5), _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3);
|
|
float3 _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3;
|
|
Unity_Branch_float3(_Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean, _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3, float3(0, 0, 0), _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3);
|
|
float _Property_9946d066804cc584a96830f8d35269cc_Out_0_Float = Vector1_2EC6D670;
|
|
float3 _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3, (_Property_9946d066804cc584a96830f8d35269cc_Out_0_Float.xxx), _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3);
|
|
float3 _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3, _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3, _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3);
|
|
float _Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float = Vector1_A2C4B4F4;
|
|
float3 _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3, (_Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float.xxx), _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3);
|
|
float _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float;
|
|
Unity_Length_float3(_Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3, _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float);
|
|
float _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float = Vector1_7F78DDD2;
|
|
float _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float;
|
|
Unity_Add_float(_Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float, _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float, _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float);
|
|
float _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
Unity_Multiply_float_float(_Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float, 0.001, _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float);
|
|
direction_1 = _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
strength_2 = _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
}
|
|
|
|
void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = cross(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Equal_float(float A, float B, out float Out)
|
|
{
|
|
Out = A == B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_DotProduct_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = dot(A, B);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Maximum_float(float A, float B, out float Out)
|
|
{
|
|
Out = max(A, B);
|
|
}
|
|
|
|
void Unity_Cosine_float(float In, out float Out)
|
|
{
|
|
Out = cos(In);
|
|
}
|
|
|
|
void Unity_Sine_float(float In, out float Out)
|
|
{
|
|
Out = sin(In);
|
|
}
|
|
|
|
void Unity_Comparison_NotEqual_float(float A, float B, out float Out)
|
|
{
|
|
Out = A != B ? 1 : 0;
|
|
}
|
|
|
|
struct Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float4 VertexColor;
|
|
};
|
|
|
|
void SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(float Vector1_BCB03E1A, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7EE0F94A, float Boolean_527CB26E, float Vector1_DE1BF63A, float Vector1_7F78DDD2, float3 Vector3_DE8CC74D, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float4x4 Matrix4_0617b0bd42fc46ff90b1d55303a5477f, float4 Vector4_b44806ec67ca461fbcdf009dc6092cc3, Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float IN, out float3 vertex_1, out float3 normal_2)
|
|
{
|
|
float4 _Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3;
|
|
{
|
|
// Converting Position from Object to AbsoluteWorld via world space
|
|
float3 world;
|
|
world = TransformObjectToWorld((_Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4.xyz).xyz);
|
|
_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3 = GetAbsolutePositionWS(world);
|
|
}
|
|
float _Distance_343883e4e5444664abed46100940f24f_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3, float3(0, 0, 0), _Distance_343883e4e5444664abed46100940f24f_Out_2_Float);
|
|
float _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Distance_343883e4e5444664abed46100940f24f_Out_2_Float, float(0.001), _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean);
|
|
float3 _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3 = Vector3_C30D997B;
|
|
float4 _Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3;
|
|
_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3 = TransformObjectToWorld((_Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4.xyz).xyz);
|
|
float3 _Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3;
|
|
_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3 = TransformObjectToWorld(_Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3.xyz);
|
|
float _Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean = Boolean_527CB26E;
|
|
float _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float = Vector1_7EE0F94A;
|
|
float _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, float(0), _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean);
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_R_1_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[0];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[1];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_B_3_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[2];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_A_4_Float = 0;
|
|
float _Split_7a634ef857769683b2100876a36535a2_R_1_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[0];
|
|
float _Split_7a634ef857769683b2100876a36535a2_G_2_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[1];
|
|
float _Split_7a634ef857769683b2100876a36535a2_B_3_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[2];
|
|
float _Split_7a634ef857769683b2100876a36535a2_A_4_Float = 0;
|
|
float _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float;
|
|
Unity_Subtract_float(_Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float, _Split_7a634ef857769683b2100876a36535a2_G_2_Float, _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float);
|
|
float _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float, _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean);
|
|
float _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean;
|
|
Unity_And_float(_Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean, _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean);
|
|
float _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float = Vector1_A2C4B4F4;
|
|
float _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float;
|
|
Unity_Branch_float(_And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean, float(1E-05), _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float);
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_R_1_Float = IN.VertexColor[0];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_G_2_Float = IN.VertexColor[1];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_B_3_Float = IN.VertexColor[2];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float = IN.VertexColor[3];
|
|
float _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float);
|
|
float _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float;
|
|
Unity_Branch_float(_Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float);
|
|
float _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float = Vector1_7F78DDD2;
|
|
UnityTexture2D _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
UnityTexture2D _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float4 _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float;
|
|
Unity_Length_float4(_Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float);
|
|
float _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float, float(0), _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean);
|
|
float4 _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4;
|
|
Unity_Branch_float4(_Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean, _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, float4(0, 0, 1, 1), _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4);
|
|
float4x4 _Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4 = Matrix4_0617b0bd42fc46ff90b1d55303a5477f;
|
|
float4 _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4 = Vector4_b44806ec67ca461fbcdf009dc6092cc3;
|
|
Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float _WindNMPoints_071e9370484b4168b560a27fbea64a52;
|
|
float4 _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4;
|
|
SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(_Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4, SHADERGRAPH_OBJECT_POSITION, _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4);
|
|
float4 _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4;
|
|
Unity_Add_float4(_Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4);
|
|
float _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float = Vector1_B4470F9B;
|
|
float _Property_6b508d48a081548385021b27896c0622_Out_0_Float = Vector1_2EC6D670;
|
|
float _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float = Vector1_9365F438;
|
|
float _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float = Vector1_F53C4B89;
|
|
float _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float = Vector1_6803B355;
|
|
float _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float = Vector1_BCB03E1A;
|
|
Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba;
|
|
float3 _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3;
|
|
float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float;
|
|
SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float, _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float, _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D, _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4, _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float, _Property_6b508d48a081548385021b27896c0622_Out_0_Float, _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float, _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float, _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float, _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float);
|
|
float3 _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3;
|
|
Unity_CrossProduct_float(float3 (0, 1, 0), _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3);
|
|
float _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean;
|
|
Unity_Comparison_Equal_float((_CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3).x, float(0), _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean);
|
|
float3 _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean, float3(1E-06, 1E-06, 1E-06), _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3, _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3);
|
|
float3 _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3, _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3);
|
|
float3 _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3);
|
|
float _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float;
|
|
Unity_DotProduct_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3, _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float);
|
|
float3 _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, (_DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float.xxx), _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3);
|
|
float3 _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3;
|
|
Unity_Add_float3(_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3);
|
|
float3 _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3);
|
|
float _Distance_702b068f612c7289a99272879da274ed_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Distance_702b068f612c7289a99272879da274ed_Out_2_Float);
|
|
float _Property_f5c255b0f666358291012b78132d6593_Out_0_Float = Vector1_DE1BF63A;
|
|
float _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float;
|
|
Unity_Divide_float(_Distance_702b068f612c7289a99272879da274ed_Out_2_Float, _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float);
|
|
float _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float;
|
|
Unity_Absolute_float(_Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float, _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float);
|
|
float _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float = float(1E-07);
|
|
float _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float;
|
|
Unity_Maximum_float(_Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float, _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float, _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float);
|
|
float _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float;
|
|
Unity_Divide_float(float(1), _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float);
|
|
float _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float;
|
|
Unity_Power_float(_Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float);
|
|
float _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float;
|
|
Unity_Multiply_float_float(_WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float, _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float);
|
|
float _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float;
|
|
Unity_Cosine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float);
|
|
float3 _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, (_Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float.xxx), _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3);
|
|
float3 _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3;
|
|
Unity_CrossProduct_float(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3);
|
|
float _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float;
|
|
Unity_Sine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float);
|
|
float3 _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3, (_Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float.xxx), _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3);
|
|
float3 _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3, _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3);
|
|
float3 _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3, _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3);
|
|
float3 _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3;
|
|
_Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3 = TransformWorldToObject(_Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3.xyz);
|
|
float3 _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean, _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3, _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3, _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3);
|
|
float3 _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3 = Vector3_DE8CC74D;
|
|
float _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float;
|
|
Unity_Length_float3(_Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float);
|
|
float _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean;
|
|
Unity_Comparison_NotEqual_float(_Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float, float(0), _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean);
|
|
float3 _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(IN.WorldSpaceNormal, _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3);
|
|
float3 _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3, IN.WorldSpaceNormal, _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3);
|
|
vertex_1 = _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
normal_2 = _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
}
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
float3 _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3;
|
|
Unity_Add_float3(IN.ObjectSpacePosition, float3(1E-07, 1E-07, 1E-07), _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3);
|
|
float _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float = _Drag;
|
|
float _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float = _HeightDrag;
|
|
float _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float = _Stiffness;
|
|
float _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float = _InitialBend;
|
|
float4 _Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4 = _NewNormal;
|
|
UnityTexture2D _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexNoise);
|
|
UnityTexture2D _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexGust);
|
|
float4 _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4 = WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float = WIND_SETTINGS_FlexNoiseScale;
|
|
float _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float = WIND_SETTINGS_Turbulence;
|
|
float _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float = WIND_SETTINGS_GustSpeed;
|
|
float _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float = WIND_SETTINGS_GustScale;
|
|
float _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float = WIND_SETTINGS_GustWorldScale;
|
|
float4x4 _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4 = WIND_SETTINGS_Points;
|
|
float4 _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4 = WIND_SETTINGS_Points_Radius;
|
|
Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.WorldSpaceNormal = IN.WorldSpaceNormal;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.VertexColor = IN.VertexColor;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3;
|
|
SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(IN.TimeParameters.x, _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3, _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float, _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float, 0, _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float, _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float, (_Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4.xyz), _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D, _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D, _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4, _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float, _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float, _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float, _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float, _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float, _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4, _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3);
|
|
description.Position = _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.WorldSpaceNormal = TransformObjectToWorldNormal(input.normalOS);
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
output.VertexColor = input.color;
|
|
output.TimeParameters = _TimeParameters.xyz; // Note: in case of animation this will be overwrite (allow to handle motion vector)
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
vertexDescriptionInputs.TimeParameters = timeParameters;
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
input.positionOS = vertexDescription.Position;
|
|
input.normalOS = vertexDescription.Normal;
|
|
input.tangentOS.xyz = vertexDescription.Tangent;
|
|
|
|
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.positionRWS = input.positionRWS;
|
|
output.tangentToWorld = BuildTangentToWorld(input.tangentWS, input.normalWS);
|
|
output.texCoord0 = input.texCoord0;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassDepthOnly.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "GBuffer"
|
|
Tags
|
|
{
|
|
"LightMode" = "GBuffer"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_CullMode]
|
|
ZTest [_ZTestGBuffer]
|
|
Stencil
|
|
{
|
|
WriteMask [_StencilWriteMaskGBuffer]
|
|
Ref [_StencilRefGBuffer]
|
|
CompFront Always
|
|
PassFront Replace
|
|
CompBack Always
|
|
PassBack Replace
|
|
}
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma instancing_options renderinglayer
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma multi_compile_fragment _ RENDERING_LAYERS
|
|
#pragma multi_compile_raytracing _ RENDERING_LAYERS
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ DEBUG_DISPLAY
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile_raytracing _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile_fragment _ SHADOWS_SHADOWMASK
|
|
#pragma multi_compile_raytracing _ SHADOWS_SHADOWMASK
|
|
#pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT
|
|
#pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT
|
|
#pragma multi_compile _ USE_LEGACY_LIGHTMAPS
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_GBUFFER
|
|
#define RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
struct CustomInterpolators
|
|
{
|
|
};
|
|
#define USE_CUSTOMINTERP_SUBSTRUCT
|
|
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define ATTRIBUTES_NEED_TEXCOORD2
|
|
#define ATTRIBUTES_NEED_COLOR
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_TEXCOORD2
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
#define FRAG_INPUTS_USE_TEXCOORD1
|
|
#define FRAG_INPUTS_USE_TEXCOORD2
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 uv1 : TEXCOORD1;
|
|
float4 uv2 : TEXCOORD2;
|
|
float4 color : COLOR;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 positionRWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
float4 texCoord1;
|
|
float4 texCoord2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 WorldSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
float4 VertexColor;
|
|
float3 TimeParameters;
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float4 texCoord1 : INTERP2;
|
|
float4 texCoord2 : INTERP3;
|
|
float3 positionRWS : INTERP4;
|
|
float3 normalWS : INTERP5;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.texCoord1.xyzw = input.texCoord1;
|
|
output.texCoord2.xyzw = input.texCoord2;
|
|
output.positionRWS.xyz = input.positionRWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.texCoord1 = input.texCoord1.xyzw;
|
|
output.texCoord2 = input.texCoord2.xyzw;
|
|
output.positionRWS = input.positionRWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Add_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
void Unity_Distance_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = distance(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Less_float(float A, float B, out float Out)
|
|
{
|
|
Out = A < B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Comparison_Greater_float(float A, float B, out float Out)
|
|
{
|
|
Out = A > B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Subtract_float(float A, float B, out float Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_And_float(float A, float B, out float Out)
|
|
{
|
|
Out = A && B;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Length_float4(float4 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Subtract_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_Normalize_float3(float3 In, out float3 Out)
|
|
{
|
|
Out = normalize(In);
|
|
}
|
|
|
|
void Unity_Length_float3(float3 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
void Unity_Add_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(float4x4 Matrix4_cb72bb33b7a84dfda97778a514f9b60f, float3 Vector3_90379ebf40aa468b8362f8d265f4f234, float4 Vector4_159bb4232f82428893101734a03e2a1e, Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float IN, out float4 WindPoint_1)
|
|
{
|
|
float3 _Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3 = Vector3_90379ebf40aa468b8362f8d265f4f234;
|
|
float4x4 _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4 = Matrix4_cb72bb33b7a84dfda97778a514f9b60f;
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].r);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].g);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].b);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].a);
|
|
float3 _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4.xyz), _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3);
|
|
float3 _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3);
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[0];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[1];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[2];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[3];
|
|
float _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float);
|
|
float4 _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4 = Vector4_159bb4232f82428893101734a03e2a1e;
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[0];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[1];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[2];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[3];
|
|
float _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float;
|
|
Unity_Divide_float(_Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float, _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float);
|
|
float _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float, float(0), float(1), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float);
|
|
float _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float;
|
|
Unity_Lerp_float(_Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float, float(0), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float);
|
|
float3 _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3, (_Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float.xxx), _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3);
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[0];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[1];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[2];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_A_4_Float = 0;
|
|
float4 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4;
|
|
float3 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3;
|
|
float2 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2);
|
|
float3 _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4.xyz), _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3);
|
|
float3 _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3);
|
|
float _Split_8bbd5052350846968bf312362efd9f01_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[0];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[1];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[2];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[3];
|
|
float _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float);
|
|
float _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float;
|
|
Unity_Divide_float(_Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float, _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float);
|
|
float _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float, float(0), float(1), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float);
|
|
float _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float;
|
|
Unity_Lerp_float(_Split_8bbd5052350846968bf312362efd9f01_A_4_Float, float(0), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float);
|
|
float3 _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3, (_Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float.xxx), _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3);
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[0];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[1];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[2];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_A_4_Float = 0;
|
|
float4 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4;
|
|
float3 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3;
|
|
float2 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2);
|
|
float4 _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4;
|
|
Unity_Add_float4(_Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4);
|
|
float3 _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4.xyz), _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3);
|
|
float3 _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3);
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[0];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[1];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[2];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[3];
|
|
float _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float);
|
|
float _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float;
|
|
Unity_Divide_float(_Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float, _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float);
|
|
float _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float, float(0), float(1), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float);
|
|
float _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float;
|
|
Unity_Lerp_float(_Split_fa21a8022f944854903e06c07c6f079c_A_4_Float, float(0), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float);
|
|
float3 _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3, (_Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float.xxx), _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3);
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[0];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[1];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[2];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_A_4_Float = 0;
|
|
float4 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4;
|
|
float3 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3;
|
|
float2 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2);
|
|
float4 _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4);
|
|
float3 _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4.xyz), _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3);
|
|
float3 _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3);
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[0];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[1];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[2];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[3];
|
|
float _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float);
|
|
float _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float;
|
|
Unity_Divide_float(_Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float, _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float);
|
|
float _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float, float(0), float(1), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float);
|
|
float _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float;
|
|
Unity_Lerp_float(_Split_1bfec6763d4b458398e36937b4114c29_A_4_Float, float(0), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float);
|
|
float3 _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3, (_Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float.xxx), _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3);
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_R_1_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[0];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[1];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[2];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_A_4_Float = 0;
|
|
float4 _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4;
|
|
float3 _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3;
|
|
float2 _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_e22879e6c4574322ab21f6261a21bced_R_1_Float, _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float, _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3, _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2);
|
|
float4 _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4);
|
|
WindPoint_1 = _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Or_float(float A, float B, out float Out)
|
|
{
|
|
Out = A || B;
|
|
}
|
|
|
|
void Unity_Branch_float3(float Predicate, float3 True, float3 False, out float3 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Add_float(float A, float B, out float Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(float3 Vector3_604F121F, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7F78DDD2, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float Vector1_5EFF6B1A, Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float IN, out float3 direction_1, out float strength_2)
|
|
{
|
|
float4 _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[0];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[1];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[2];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_A_4_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[3];
|
|
float4 _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4;
|
|
float3 _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3;
|
|
float2 _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float, float(0), _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4, _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2);
|
|
float3 _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3);
|
|
float4 _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_R_1_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[0];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_G_2_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[1];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_B_3_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[2];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[3];
|
|
float3 _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, (_Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float.xxx), _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3);
|
|
float _Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float = Vector1_9365F438;
|
|
float _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float, float(0), _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean);
|
|
UnityTexture2D _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float3 _Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3 = float3(float(1), float(0), float(0));
|
|
float _Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float.xxx), _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3);
|
|
float _Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float = Vector1_5EFF6B1A;
|
|
float3 _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3);
|
|
float3 _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3, _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3, _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3);
|
|
float _Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float = Vector1_6803B355;
|
|
float3 _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3, (_Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float.xxx), _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3);
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[0];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_G_2_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[1];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[2];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_A_4_Float = 0;
|
|
float4 _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4;
|
|
float3 _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3;
|
|
float2 _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float, _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float, float(0), float(0), _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4, _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3, _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.tex, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.samplerstate, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.GetTransformedUV(_Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_G_6_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_B_7_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_A_8_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.a;
|
|
float _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float;
|
|
Unity_Branch_float(_Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean, _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float, float(0), _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float);
|
|
float _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float;
|
|
Unity_Power_float(_Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float, float(2), _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float);
|
|
float _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float = Vector1_F53C4B89;
|
|
float _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float;
|
|
Unity_Multiply_float_float(_Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float, _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float, _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float);
|
|
float3 _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3((_Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float.xxx), _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3);
|
|
float _Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3, (_Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float.xxx), _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3);
|
|
float3 _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3, _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3, _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3);
|
|
float4 _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_e719665c40324e89a536d165d0427a68_R_1_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[0];
|
|
float _Split_e719665c40324e89a536d165d0427a68_G_2_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[1];
|
|
float _Split_e719665c40324e89a536d165d0427a68_B_3_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[2];
|
|
float _Split_e719665c40324e89a536d165d0427a68_A_4_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[3];
|
|
float _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Split_e719665c40324e89a536d165d0427a68_A_4_Float, float(0), _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean);
|
|
float _Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float = Vector1_2EC6D670;
|
|
float _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float, float(0), _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean);
|
|
float _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean;
|
|
Unity_Or_float(_Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean, _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean, _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean);
|
|
UnityTexture2D _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
float3 _Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Split_e719665c40324e89a536d165d0427a68_A_4_Float.xxx), _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3);
|
|
float3 _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3);
|
|
float3 _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3, _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3, _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3);
|
|
float _Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float = Vector1_B4470F9B;
|
|
float3 _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3, (_Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float.xxx), _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3);
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[0];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_G_2_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[1];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[2];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_A_4_Float = 0;
|
|
float4 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4;
|
|
float3 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3;
|
|
float2 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float, _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float, float(0), float(0), _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.tex, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.samplerstate, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.GetTransformedUV(_Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_A_8_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.a;
|
|
float4 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4;
|
|
float3 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3;
|
|
float2 _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2;
|
|
Unity_Combine_float(_SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float, float(0), _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4, _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2);
|
|
float3 _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3;
|
|
Unity_Add_float3(_Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, float3(-0.5, -0.5, -0.5), _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3);
|
|
float3 _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3;
|
|
Unity_Branch_float3(_Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean, _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3, float3(0, 0, 0), _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3);
|
|
float _Property_9946d066804cc584a96830f8d35269cc_Out_0_Float = Vector1_2EC6D670;
|
|
float3 _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3, (_Property_9946d066804cc584a96830f8d35269cc_Out_0_Float.xxx), _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3);
|
|
float3 _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3, _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3, _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3);
|
|
float _Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float = Vector1_A2C4B4F4;
|
|
float3 _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3, (_Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float.xxx), _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3);
|
|
float _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float;
|
|
Unity_Length_float3(_Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3, _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float);
|
|
float _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float = Vector1_7F78DDD2;
|
|
float _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float;
|
|
Unity_Add_float(_Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float, _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float, _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float);
|
|
float _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
Unity_Multiply_float_float(_Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float, 0.001, _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float);
|
|
direction_1 = _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
strength_2 = _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
}
|
|
|
|
void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = cross(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Equal_float(float A, float B, out float Out)
|
|
{
|
|
Out = A == B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_DotProduct_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = dot(A, B);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Maximum_float(float A, float B, out float Out)
|
|
{
|
|
Out = max(A, B);
|
|
}
|
|
|
|
void Unity_Cosine_float(float In, out float Out)
|
|
{
|
|
Out = cos(In);
|
|
}
|
|
|
|
void Unity_Sine_float(float In, out float Out)
|
|
{
|
|
Out = sin(In);
|
|
}
|
|
|
|
void Unity_Comparison_NotEqual_float(float A, float B, out float Out)
|
|
{
|
|
Out = A != B ? 1 : 0;
|
|
}
|
|
|
|
struct Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float4 VertexColor;
|
|
};
|
|
|
|
void SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(float Vector1_BCB03E1A, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7EE0F94A, float Boolean_527CB26E, float Vector1_DE1BF63A, float Vector1_7F78DDD2, float3 Vector3_DE8CC74D, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float4x4 Matrix4_0617b0bd42fc46ff90b1d55303a5477f, float4 Vector4_b44806ec67ca461fbcdf009dc6092cc3, Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float IN, out float3 vertex_1, out float3 normal_2)
|
|
{
|
|
float4 _Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3;
|
|
{
|
|
// Converting Position from Object to AbsoluteWorld via world space
|
|
float3 world;
|
|
world = TransformObjectToWorld((_Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4.xyz).xyz);
|
|
_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3 = GetAbsolutePositionWS(world);
|
|
}
|
|
float _Distance_343883e4e5444664abed46100940f24f_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3, float3(0, 0, 0), _Distance_343883e4e5444664abed46100940f24f_Out_2_Float);
|
|
float _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Distance_343883e4e5444664abed46100940f24f_Out_2_Float, float(0.001), _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean);
|
|
float3 _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3 = Vector3_C30D997B;
|
|
float4 _Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3;
|
|
_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3 = TransformObjectToWorld((_Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4.xyz).xyz);
|
|
float3 _Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3;
|
|
_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3 = TransformObjectToWorld(_Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3.xyz);
|
|
float _Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean = Boolean_527CB26E;
|
|
float _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float = Vector1_7EE0F94A;
|
|
float _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, float(0), _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean);
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_R_1_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[0];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[1];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_B_3_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[2];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_A_4_Float = 0;
|
|
float _Split_7a634ef857769683b2100876a36535a2_R_1_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[0];
|
|
float _Split_7a634ef857769683b2100876a36535a2_G_2_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[1];
|
|
float _Split_7a634ef857769683b2100876a36535a2_B_3_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[2];
|
|
float _Split_7a634ef857769683b2100876a36535a2_A_4_Float = 0;
|
|
float _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float;
|
|
Unity_Subtract_float(_Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float, _Split_7a634ef857769683b2100876a36535a2_G_2_Float, _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float);
|
|
float _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float, _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean);
|
|
float _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean;
|
|
Unity_And_float(_Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean, _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean);
|
|
float _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float = Vector1_A2C4B4F4;
|
|
float _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float;
|
|
Unity_Branch_float(_And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean, float(1E-05), _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float);
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_R_1_Float = IN.VertexColor[0];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_G_2_Float = IN.VertexColor[1];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_B_3_Float = IN.VertexColor[2];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float = IN.VertexColor[3];
|
|
float _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float);
|
|
float _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float;
|
|
Unity_Branch_float(_Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float);
|
|
float _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float = Vector1_7F78DDD2;
|
|
UnityTexture2D _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
UnityTexture2D _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float4 _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float;
|
|
Unity_Length_float4(_Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float);
|
|
float _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float, float(0), _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean);
|
|
float4 _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4;
|
|
Unity_Branch_float4(_Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean, _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, float4(0, 0, 1, 1), _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4);
|
|
float4x4 _Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4 = Matrix4_0617b0bd42fc46ff90b1d55303a5477f;
|
|
float4 _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4 = Vector4_b44806ec67ca461fbcdf009dc6092cc3;
|
|
Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float _WindNMPoints_071e9370484b4168b560a27fbea64a52;
|
|
float4 _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4;
|
|
SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(_Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4, SHADERGRAPH_OBJECT_POSITION, _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4);
|
|
float4 _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4;
|
|
Unity_Add_float4(_Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4);
|
|
float _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float = Vector1_B4470F9B;
|
|
float _Property_6b508d48a081548385021b27896c0622_Out_0_Float = Vector1_2EC6D670;
|
|
float _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float = Vector1_9365F438;
|
|
float _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float = Vector1_F53C4B89;
|
|
float _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float = Vector1_6803B355;
|
|
float _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float = Vector1_BCB03E1A;
|
|
Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba;
|
|
float3 _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3;
|
|
float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float;
|
|
SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float, _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float, _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D, _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4, _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float, _Property_6b508d48a081548385021b27896c0622_Out_0_Float, _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float, _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float, _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float, _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float);
|
|
float3 _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3;
|
|
Unity_CrossProduct_float(float3 (0, 1, 0), _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3);
|
|
float _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean;
|
|
Unity_Comparison_Equal_float((_CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3).x, float(0), _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean);
|
|
float3 _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean, float3(1E-06, 1E-06, 1E-06), _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3, _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3);
|
|
float3 _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3, _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3);
|
|
float3 _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3);
|
|
float _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float;
|
|
Unity_DotProduct_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3, _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float);
|
|
float3 _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, (_DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float.xxx), _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3);
|
|
float3 _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3;
|
|
Unity_Add_float3(_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3);
|
|
float3 _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3);
|
|
float _Distance_702b068f612c7289a99272879da274ed_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Distance_702b068f612c7289a99272879da274ed_Out_2_Float);
|
|
float _Property_f5c255b0f666358291012b78132d6593_Out_0_Float = Vector1_DE1BF63A;
|
|
float _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float;
|
|
Unity_Divide_float(_Distance_702b068f612c7289a99272879da274ed_Out_2_Float, _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float);
|
|
float _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float;
|
|
Unity_Absolute_float(_Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float, _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float);
|
|
float _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float = float(1E-07);
|
|
float _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float;
|
|
Unity_Maximum_float(_Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float, _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float, _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float);
|
|
float _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float;
|
|
Unity_Divide_float(float(1), _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float);
|
|
float _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float;
|
|
Unity_Power_float(_Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float);
|
|
float _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float;
|
|
Unity_Multiply_float_float(_WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float, _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float);
|
|
float _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float;
|
|
Unity_Cosine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float);
|
|
float3 _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, (_Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float.xxx), _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3);
|
|
float3 _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3;
|
|
Unity_CrossProduct_float(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3);
|
|
float _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float;
|
|
Unity_Sine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float);
|
|
float3 _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3, (_Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float.xxx), _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3);
|
|
float3 _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3, _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3);
|
|
float3 _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3, _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3);
|
|
float3 _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3;
|
|
_Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3 = TransformWorldToObject(_Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3.xyz);
|
|
float3 _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean, _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3, _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3, _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3);
|
|
float3 _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3 = Vector3_DE8CC74D;
|
|
float _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float;
|
|
Unity_Length_float3(_Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float);
|
|
float _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean;
|
|
Unity_Comparison_NotEqual_float(_Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float, float(0), _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean);
|
|
float3 _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(IN.WorldSpaceNormal, _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3);
|
|
float3 _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3, IN.WorldSpaceNormal, _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3);
|
|
vertex_1 = _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
normal_2 = _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
}
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
float3 _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3;
|
|
Unity_Add_float3(IN.ObjectSpacePosition, float3(1E-07, 1E-07, 1E-07), _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3);
|
|
float _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float = _Drag;
|
|
float _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float = _HeightDrag;
|
|
float _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float = _Stiffness;
|
|
float _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float = _InitialBend;
|
|
float4 _Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4 = _NewNormal;
|
|
UnityTexture2D _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexNoise);
|
|
UnityTexture2D _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexGust);
|
|
float4 _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4 = WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float = WIND_SETTINGS_FlexNoiseScale;
|
|
float _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float = WIND_SETTINGS_Turbulence;
|
|
float _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float = WIND_SETTINGS_GustSpeed;
|
|
float _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float = WIND_SETTINGS_GustScale;
|
|
float _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float = WIND_SETTINGS_GustWorldScale;
|
|
float4x4 _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4 = WIND_SETTINGS_Points;
|
|
float4 _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4 = WIND_SETTINGS_Points_Radius;
|
|
Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.WorldSpaceNormal = IN.WorldSpaceNormal;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.VertexColor = IN.VertexColor;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3;
|
|
SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(IN.TimeParameters.x, _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3, _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float, _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float, 0, _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float, _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float, (_Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4.xyz), _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D, _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D, _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4, _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float, _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float, _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float, _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float, _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float, _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4, _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3);
|
|
description.Position = _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
float4 VTPackedFeedback;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
{
|
|
surface.VTPackedFeedback = float4(1.0f,1.0f,1.0f,1.0f);
|
|
}
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.WorldSpaceNormal = TransformObjectToWorldNormal(input.normalOS);
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
output.VertexColor = input.color;
|
|
output.TimeParameters = _TimeParameters.xyz; // Note: in case of animation this will be overwrite (allow to handle motion vector)
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
vertexDescriptionInputs.TimeParameters = timeParameters;
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
input.positionOS = vertexDescription.Position;
|
|
input.normalOS = vertexDescription.Normal;
|
|
input.tangentOS.xyz = vertexDescription.Tangent;
|
|
|
|
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.positionRWS = input.positionRWS;
|
|
output.tangentToWorld = BuildTangentToWorld(input.tangentWS, input.normalWS);
|
|
output.texCoord0 = input.texCoord0;
|
|
output.texCoord1 = input.texCoord1;
|
|
output.texCoord2 = input.texCoord2;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
builtinData.vtPackedFeedback = surfaceDescription.VTPackedFeedback;
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassGBuffer.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "Forward"
|
|
Tags
|
|
{
|
|
"LightMode" = "Forward"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_CullModeForward]
|
|
Blend [_SrcBlend] [_DstBlend], [_AlphaSrcBlend] [_AlphaDstBlend]
|
|
Blend 1 One OneMinusSrcAlpha
|
|
Blend 2 One [_DstBlend2]
|
|
Blend 3 One [_DstBlend2]
|
|
Blend 4 One OneMinusSrcAlpha
|
|
ZTest [_ZTestDepthEqualForOpaque]
|
|
ZWrite [_ZWrite]
|
|
ColorMask [_ColorMaskTransparentVelOne] 1
|
|
ColorMask [_ColorMaskTransparentVelTwo] 2
|
|
Stencil
|
|
{
|
|
WriteMask [_StencilWriteMask]
|
|
Ref [_StencilRef]
|
|
CompFront Always
|
|
PassFront Replace
|
|
CompBack Always
|
|
PassBack Replace
|
|
}
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma instancing_options renderinglayer
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ DEBUG_DISPLAY
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile_raytracing _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile_fragment _ SHADOWS_SHADOWMASK
|
|
#pragma multi_compile_raytracing _ SHADOWS_SHADOWMASK
|
|
#pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT
|
|
#pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT
|
|
#pragma multi_compile _ USE_LEGACY_LIGHTMAPS
|
|
#pragma multi_compile_fragment PUNCTUAL_SHADOW_LOW PUNCTUAL_SHADOW_MEDIUM PUNCTUAL_SHADOW_HIGH
|
|
#pragma multi_compile_fragment DIRECTIONAL_SHADOW_LOW DIRECTIONAL_SHADOW_MEDIUM DIRECTIONAL_SHADOW_HIGH
|
|
#pragma multi_compile_fragment AREA_SHADOW_MEDIUM AREA_SHADOW_HIGH
|
|
#pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON
|
|
#pragma multi_compile_fragment USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_FORWARD
|
|
#define SUPPORT_BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1
|
|
#define HAS_LIGHTLOOP 1
|
|
#define RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define SHADER_LIT 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
struct CustomInterpolators
|
|
{
|
|
};
|
|
#define USE_CUSTOMINTERP_SUBSTRUCT
|
|
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define ATTRIBUTES_NEED_TEXCOORD2
|
|
#define ATTRIBUTES_NEED_COLOR
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_TEXCOORD2
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
#define FRAG_INPUTS_USE_TEXCOORD1
|
|
#define FRAG_INPUTS_USE_TEXCOORD2
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 uv1 : TEXCOORD1;
|
|
float4 uv2 : TEXCOORD2;
|
|
float4 color : COLOR;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 positionRWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
float4 texCoord1;
|
|
float4 texCoord2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 WorldSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
float4 VertexColor;
|
|
float3 TimeParameters;
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float4 texCoord1 : INTERP2;
|
|
float4 texCoord2 : INTERP3;
|
|
float3 positionRWS : INTERP4;
|
|
float3 normalWS : INTERP5;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.texCoord1.xyzw = input.texCoord1;
|
|
output.texCoord2.xyzw = input.texCoord2;
|
|
output.positionRWS.xyz = input.positionRWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.texCoord1 = input.texCoord1.xyzw;
|
|
output.texCoord2 = input.texCoord2.xyzw;
|
|
output.positionRWS = input.positionRWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Add_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
void Unity_Distance_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = distance(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Less_float(float A, float B, out float Out)
|
|
{
|
|
Out = A < B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Comparison_Greater_float(float A, float B, out float Out)
|
|
{
|
|
Out = A > B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Subtract_float(float A, float B, out float Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_And_float(float A, float B, out float Out)
|
|
{
|
|
Out = A && B;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Length_float4(float4 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Subtract_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_Normalize_float3(float3 In, out float3 Out)
|
|
{
|
|
Out = normalize(In);
|
|
}
|
|
|
|
void Unity_Length_float3(float3 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
void Unity_Add_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(float4x4 Matrix4_cb72bb33b7a84dfda97778a514f9b60f, float3 Vector3_90379ebf40aa468b8362f8d265f4f234, float4 Vector4_159bb4232f82428893101734a03e2a1e, Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float IN, out float4 WindPoint_1)
|
|
{
|
|
float3 _Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3 = Vector3_90379ebf40aa468b8362f8d265f4f234;
|
|
float4x4 _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4 = Matrix4_cb72bb33b7a84dfda97778a514f9b60f;
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].r);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].g);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].b);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].a);
|
|
float3 _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4.xyz), _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3);
|
|
float3 _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3);
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[0];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[1];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[2];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[3];
|
|
float _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float);
|
|
float4 _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4 = Vector4_159bb4232f82428893101734a03e2a1e;
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[0];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[1];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[2];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[3];
|
|
float _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float;
|
|
Unity_Divide_float(_Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float, _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float);
|
|
float _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float, float(0), float(1), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float);
|
|
float _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float;
|
|
Unity_Lerp_float(_Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float, float(0), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float);
|
|
float3 _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3, (_Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float.xxx), _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3);
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[0];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[1];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[2];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_A_4_Float = 0;
|
|
float4 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4;
|
|
float3 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3;
|
|
float2 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2);
|
|
float3 _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4.xyz), _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3);
|
|
float3 _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3);
|
|
float _Split_8bbd5052350846968bf312362efd9f01_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[0];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[1];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[2];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[3];
|
|
float _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float);
|
|
float _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float;
|
|
Unity_Divide_float(_Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float, _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float);
|
|
float _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float, float(0), float(1), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float);
|
|
float _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float;
|
|
Unity_Lerp_float(_Split_8bbd5052350846968bf312362efd9f01_A_4_Float, float(0), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float);
|
|
float3 _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3, (_Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float.xxx), _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3);
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[0];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[1];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[2];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_A_4_Float = 0;
|
|
float4 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4;
|
|
float3 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3;
|
|
float2 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2);
|
|
float4 _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4;
|
|
Unity_Add_float4(_Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4);
|
|
float3 _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4.xyz), _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3);
|
|
float3 _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3);
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[0];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[1];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[2];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[3];
|
|
float _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float);
|
|
float _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float;
|
|
Unity_Divide_float(_Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float, _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float);
|
|
float _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float, float(0), float(1), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float);
|
|
float _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float;
|
|
Unity_Lerp_float(_Split_fa21a8022f944854903e06c07c6f079c_A_4_Float, float(0), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float);
|
|
float3 _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3, (_Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float.xxx), _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3);
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[0];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[1];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[2];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_A_4_Float = 0;
|
|
float4 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4;
|
|
float3 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3;
|
|
float2 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2);
|
|
float4 _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4);
|
|
float3 _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4.xyz), _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3);
|
|
float3 _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3);
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[0];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[1];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[2];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[3];
|
|
float _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float);
|
|
float _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float;
|
|
Unity_Divide_float(_Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float, _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float);
|
|
float _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float, float(0), float(1), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float);
|
|
float _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float;
|
|
Unity_Lerp_float(_Split_1bfec6763d4b458398e36937b4114c29_A_4_Float, float(0), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float);
|
|
float3 _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3, (_Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float.xxx), _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3);
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_R_1_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[0];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[1];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[2];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_A_4_Float = 0;
|
|
float4 _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4;
|
|
float3 _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3;
|
|
float2 _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_e22879e6c4574322ab21f6261a21bced_R_1_Float, _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float, _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3, _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2);
|
|
float4 _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4);
|
|
WindPoint_1 = _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Or_float(float A, float B, out float Out)
|
|
{
|
|
Out = A || B;
|
|
}
|
|
|
|
void Unity_Branch_float3(float Predicate, float3 True, float3 False, out float3 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Add_float(float A, float B, out float Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(float3 Vector3_604F121F, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7F78DDD2, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float Vector1_5EFF6B1A, Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float IN, out float3 direction_1, out float strength_2)
|
|
{
|
|
float4 _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[0];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[1];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[2];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_A_4_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[3];
|
|
float4 _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4;
|
|
float3 _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3;
|
|
float2 _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float, float(0), _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4, _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2);
|
|
float3 _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3);
|
|
float4 _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_R_1_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[0];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_G_2_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[1];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_B_3_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[2];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[3];
|
|
float3 _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, (_Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float.xxx), _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3);
|
|
float _Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float = Vector1_9365F438;
|
|
float _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float, float(0), _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean);
|
|
UnityTexture2D _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float3 _Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3 = float3(float(1), float(0), float(0));
|
|
float _Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float.xxx), _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3);
|
|
float _Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float = Vector1_5EFF6B1A;
|
|
float3 _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3);
|
|
float3 _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3, _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3, _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3);
|
|
float _Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float = Vector1_6803B355;
|
|
float3 _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3, (_Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float.xxx), _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3);
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[0];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_G_2_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[1];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[2];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_A_4_Float = 0;
|
|
float4 _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4;
|
|
float3 _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3;
|
|
float2 _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float, _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float, float(0), float(0), _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4, _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3, _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.tex, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.samplerstate, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.GetTransformedUV(_Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_G_6_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_B_7_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_A_8_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.a;
|
|
float _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float;
|
|
Unity_Branch_float(_Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean, _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float, float(0), _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float);
|
|
float _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float;
|
|
Unity_Power_float(_Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float, float(2), _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float);
|
|
float _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float = Vector1_F53C4B89;
|
|
float _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float;
|
|
Unity_Multiply_float_float(_Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float, _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float, _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float);
|
|
float3 _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3((_Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float.xxx), _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3);
|
|
float _Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3, (_Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float.xxx), _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3);
|
|
float3 _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3, _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3, _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3);
|
|
float4 _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_e719665c40324e89a536d165d0427a68_R_1_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[0];
|
|
float _Split_e719665c40324e89a536d165d0427a68_G_2_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[1];
|
|
float _Split_e719665c40324e89a536d165d0427a68_B_3_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[2];
|
|
float _Split_e719665c40324e89a536d165d0427a68_A_4_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[3];
|
|
float _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Split_e719665c40324e89a536d165d0427a68_A_4_Float, float(0), _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean);
|
|
float _Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float = Vector1_2EC6D670;
|
|
float _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float, float(0), _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean);
|
|
float _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean;
|
|
Unity_Or_float(_Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean, _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean, _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean);
|
|
UnityTexture2D _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
float3 _Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Split_e719665c40324e89a536d165d0427a68_A_4_Float.xxx), _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3);
|
|
float3 _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3);
|
|
float3 _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3, _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3, _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3);
|
|
float _Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float = Vector1_B4470F9B;
|
|
float3 _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3, (_Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float.xxx), _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3);
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[0];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_G_2_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[1];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[2];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_A_4_Float = 0;
|
|
float4 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4;
|
|
float3 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3;
|
|
float2 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float, _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float, float(0), float(0), _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.tex, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.samplerstate, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.GetTransformedUV(_Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_A_8_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.a;
|
|
float4 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4;
|
|
float3 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3;
|
|
float2 _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2;
|
|
Unity_Combine_float(_SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float, float(0), _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4, _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2);
|
|
float3 _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3;
|
|
Unity_Add_float3(_Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, float3(-0.5, -0.5, -0.5), _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3);
|
|
float3 _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3;
|
|
Unity_Branch_float3(_Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean, _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3, float3(0, 0, 0), _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3);
|
|
float _Property_9946d066804cc584a96830f8d35269cc_Out_0_Float = Vector1_2EC6D670;
|
|
float3 _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3, (_Property_9946d066804cc584a96830f8d35269cc_Out_0_Float.xxx), _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3);
|
|
float3 _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3, _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3, _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3);
|
|
float _Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float = Vector1_A2C4B4F4;
|
|
float3 _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3, (_Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float.xxx), _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3);
|
|
float _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float;
|
|
Unity_Length_float3(_Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3, _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float);
|
|
float _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float = Vector1_7F78DDD2;
|
|
float _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float;
|
|
Unity_Add_float(_Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float, _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float, _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float);
|
|
float _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
Unity_Multiply_float_float(_Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float, 0.001, _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float);
|
|
direction_1 = _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
strength_2 = _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
}
|
|
|
|
void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = cross(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Equal_float(float A, float B, out float Out)
|
|
{
|
|
Out = A == B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_DotProduct_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = dot(A, B);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Maximum_float(float A, float B, out float Out)
|
|
{
|
|
Out = max(A, B);
|
|
}
|
|
|
|
void Unity_Cosine_float(float In, out float Out)
|
|
{
|
|
Out = cos(In);
|
|
}
|
|
|
|
void Unity_Sine_float(float In, out float Out)
|
|
{
|
|
Out = sin(In);
|
|
}
|
|
|
|
void Unity_Comparison_NotEqual_float(float A, float B, out float Out)
|
|
{
|
|
Out = A != B ? 1 : 0;
|
|
}
|
|
|
|
struct Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float4 VertexColor;
|
|
};
|
|
|
|
void SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(float Vector1_BCB03E1A, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7EE0F94A, float Boolean_527CB26E, float Vector1_DE1BF63A, float Vector1_7F78DDD2, float3 Vector3_DE8CC74D, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float4x4 Matrix4_0617b0bd42fc46ff90b1d55303a5477f, float4 Vector4_b44806ec67ca461fbcdf009dc6092cc3, Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float IN, out float3 vertex_1, out float3 normal_2)
|
|
{
|
|
float4 _Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3;
|
|
{
|
|
// Converting Position from Object to AbsoluteWorld via world space
|
|
float3 world;
|
|
world = TransformObjectToWorld((_Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4.xyz).xyz);
|
|
_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3 = GetAbsolutePositionWS(world);
|
|
}
|
|
float _Distance_343883e4e5444664abed46100940f24f_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3, float3(0, 0, 0), _Distance_343883e4e5444664abed46100940f24f_Out_2_Float);
|
|
float _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Distance_343883e4e5444664abed46100940f24f_Out_2_Float, float(0.001), _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean);
|
|
float3 _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3 = Vector3_C30D997B;
|
|
float4 _Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3;
|
|
_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3 = TransformObjectToWorld((_Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4.xyz).xyz);
|
|
float3 _Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3;
|
|
_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3 = TransformObjectToWorld(_Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3.xyz);
|
|
float _Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean = Boolean_527CB26E;
|
|
float _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float = Vector1_7EE0F94A;
|
|
float _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, float(0), _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean);
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_R_1_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[0];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[1];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_B_3_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[2];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_A_4_Float = 0;
|
|
float _Split_7a634ef857769683b2100876a36535a2_R_1_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[0];
|
|
float _Split_7a634ef857769683b2100876a36535a2_G_2_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[1];
|
|
float _Split_7a634ef857769683b2100876a36535a2_B_3_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[2];
|
|
float _Split_7a634ef857769683b2100876a36535a2_A_4_Float = 0;
|
|
float _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float;
|
|
Unity_Subtract_float(_Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float, _Split_7a634ef857769683b2100876a36535a2_G_2_Float, _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float);
|
|
float _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float, _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean);
|
|
float _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean;
|
|
Unity_And_float(_Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean, _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean);
|
|
float _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float = Vector1_A2C4B4F4;
|
|
float _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float;
|
|
Unity_Branch_float(_And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean, float(1E-05), _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float);
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_R_1_Float = IN.VertexColor[0];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_G_2_Float = IN.VertexColor[1];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_B_3_Float = IN.VertexColor[2];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float = IN.VertexColor[3];
|
|
float _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float);
|
|
float _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float;
|
|
Unity_Branch_float(_Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float);
|
|
float _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float = Vector1_7F78DDD2;
|
|
UnityTexture2D _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
UnityTexture2D _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float4 _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float;
|
|
Unity_Length_float4(_Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float);
|
|
float _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float, float(0), _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean);
|
|
float4 _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4;
|
|
Unity_Branch_float4(_Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean, _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, float4(0, 0, 1, 1), _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4);
|
|
float4x4 _Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4 = Matrix4_0617b0bd42fc46ff90b1d55303a5477f;
|
|
float4 _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4 = Vector4_b44806ec67ca461fbcdf009dc6092cc3;
|
|
Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float _WindNMPoints_071e9370484b4168b560a27fbea64a52;
|
|
float4 _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4;
|
|
SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(_Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4, SHADERGRAPH_OBJECT_POSITION, _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4);
|
|
float4 _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4;
|
|
Unity_Add_float4(_Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4);
|
|
float _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float = Vector1_B4470F9B;
|
|
float _Property_6b508d48a081548385021b27896c0622_Out_0_Float = Vector1_2EC6D670;
|
|
float _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float = Vector1_9365F438;
|
|
float _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float = Vector1_F53C4B89;
|
|
float _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float = Vector1_6803B355;
|
|
float _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float = Vector1_BCB03E1A;
|
|
Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba;
|
|
float3 _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3;
|
|
float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float;
|
|
SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float, _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float, _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D, _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4, _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float, _Property_6b508d48a081548385021b27896c0622_Out_0_Float, _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float, _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float, _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float, _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float);
|
|
float3 _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3;
|
|
Unity_CrossProduct_float(float3 (0, 1, 0), _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3);
|
|
float _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean;
|
|
Unity_Comparison_Equal_float((_CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3).x, float(0), _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean);
|
|
float3 _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean, float3(1E-06, 1E-06, 1E-06), _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3, _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3);
|
|
float3 _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3, _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3);
|
|
float3 _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3);
|
|
float _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float;
|
|
Unity_DotProduct_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3, _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float);
|
|
float3 _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, (_DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float.xxx), _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3);
|
|
float3 _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3;
|
|
Unity_Add_float3(_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3);
|
|
float3 _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3);
|
|
float _Distance_702b068f612c7289a99272879da274ed_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Distance_702b068f612c7289a99272879da274ed_Out_2_Float);
|
|
float _Property_f5c255b0f666358291012b78132d6593_Out_0_Float = Vector1_DE1BF63A;
|
|
float _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float;
|
|
Unity_Divide_float(_Distance_702b068f612c7289a99272879da274ed_Out_2_Float, _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float);
|
|
float _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float;
|
|
Unity_Absolute_float(_Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float, _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float);
|
|
float _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float = float(1E-07);
|
|
float _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float;
|
|
Unity_Maximum_float(_Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float, _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float, _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float);
|
|
float _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float;
|
|
Unity_Divide_float(float(1), _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float);
|
|
float _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float;
|
|
Unity_Power_float(_Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float);
|
|
float _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float;
|
|
Unity_Multiply_float_float(_WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float, _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float);
|
|
float _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float;
|
|
Unity_Cosine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float);
|
|
float3 _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, (_Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float.xxx), _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3);
|
|
float3 _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3;
|
|
Unity_CrossProduct_float(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3);
|
|
float _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float;
|
|
Unity_Sine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float);
|
|
float3 _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3, (_Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float.xxx), _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3);
|
|
float3 _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3, _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3);
|
|
float3 _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3, _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3);
|
|
float3 _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3;
|
|
_Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3 = TransformWorldToObject(_Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3.xyz);
|
|
float3 _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean, _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3, _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3, _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3);
|
|
float3 _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3 = Vector3_DE8CC74D;
|
|
float _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float;
|
|
Unity_Length_float3(_Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float);
|
|
float _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean;
|
|
Unity_Comparison_NotEqual_float(_Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float, float(0), _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean);
|
|
float3 _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(IN.WorldSpaceNormal, _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3);
|
|
float3 _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3, IN.WorldSpaceNormal, _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3);
|
|
vertex_1 = _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
normal_2 = _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
}
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
float3 _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3;
|
|
Unity_Add_float3(IN.ObjectSpacePosition, float3(1E-07, 1E-07, 1E-07), _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3);
|
|
float _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float = _Drag;
|
|
float _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float = _HeightDrag;
|
|
float _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float = _Stiffness;
|
|
float _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float = _InitialBend;
|
|
float4 _Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4 = _NewNormal;
|
|
UnityTexture2D _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexNoise);
|
|
UnityTexture2D _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexGust);
|
|
float4 _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4 = WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float = WIND_SETTINGS_FlexNoiseScale;
|
|
float _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float = WIND_SETTINGS_Turbulence;
|
|
float _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float = WIND_SETTINGS_GustSpeed;
|
|
float _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float = WIND_SETTINGS_GustScale;
|
|
float _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float = WIND_SETTINGS_GustWorldScale;
|
|
float4x4 _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4 = WIND_SETTINGS_Points;
|
|
float4 _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4 = WIND_SETTINGS_Points_Radius;
|
|
Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.WorldSpaceNormal = IN.WorldSpaceNormal;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.VertexColor = IN.VertexColor;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3;
|
|
SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(IN.TimeParameters.x, _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3, _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float, _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float, 0, _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float, _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float, (_Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4.xyz), _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D, _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D, _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4, _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float, _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float, _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float, _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float, _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float, _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4, _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3);
|
|
description.Position = _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
float4 VTPackedFeedback;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
{
|
|
surface.VTPackedFeedback = float4(1.0f,1.0f,1.0f,1.0f);
|
|
}
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.WorldSpaceNormal = TransformObjectToWorldNormal(input.normalOS);
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
output.VertexColor = input.color;
|
|
output.TimeParameters = _TimeParameters.xyz; // Note: in case of animation this will be overwrite (allow to handle motion vector)
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
vertexDescriptionInputs.TimeParameters = timeParameters;
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
input.positionOS = vertexDescription.Position;
|
|
input.normalOS = vertexDescription.Normal;
|
|
input.tangentOS.xyz = vertexDescription.Tangent;
|
|
|
|
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.positionRWS = input.positionRWS;
|
|
output.tangentToWorld = BuildTangentToWorld(input.tangentWS, input.normalWS);
|
|
output.texCoord0 = input.texCoord0;
|
|
output.texCoord1 = input.texCoord1;
|
|
output.texCoord2 = input.texCoord2;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
builtinData.vtPackedFeedback = surfaceDescription.VTPackedFeedback;
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassForward.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "RayTracingPrepass"
|
|
Tags
|
|
{
|
|
"LightMode" = "RayTracingPrepass"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_CullMode]
|
|
Blend One Zero
|
|
ZWrite On
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 4.5
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
|
#pragma multi_compile_instancing
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_CONSTANT
|
|
#define RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
struct CustomInterpolators
|
|
{
|
|
};
|
|
#define USE_CUSTOMINTERP_SUBSTRUCT
|
|
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_COLOR
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
|
|
#define HAVE_MESH_MODIFICATION
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct AttributesMesh
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 color : COLOR;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(ATTRIBUTES_NEED_INSTANCEID)
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct VaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 positionRWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 WorldSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
float4 VertexColor;
|
|
float3 TimeParameters;
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
struct PackedVaryingsMeshToPS
|
|
{
|
|
SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float3 positionRWS : INTERP2;
|
|
float3 normalWS : INTERP3;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryingsMeshToPS PackVaryingsMeshToPS (VaryingsMeshToPS input)
|
|
{
|
|
PackedVaryingsMeshToPS output;
|
|
ZERO_INITIALIZE(PackedVaryingsMeshToPS, output);
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.positionRWS.xyz = input.positionRWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
VaryingsMeshToPS UnpackVaryingsMeshToPS (PackedVaryingsMeshToPS input)
|
|
{
|
|
VaryingsMeshToPS output;
|
|
output.positionCS = input.positionCS;
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.positionRWS = input.positionRWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED || defined(VARYINGS_NEED_INSTANCEID)
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Add_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
void Unity_Distance_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = distance(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Less_float(float A, float B, out float Out)
|
|
{
|
|
Out = A < B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Comparison_Greater_float(float A, float B, out float Out)
|
|
{
|
|
Out = A > B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_Subtract_float(float A, float B, out float Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_And_float(float A, float B, out float Out)
|
|
{
|
|
Out = A && B;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Length_float4(float4 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Subtract_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A - B;
|
|
}
|
|
|
|
void Unity_Normalize_float3(float3 In, out float3 Out)
|
|
{
|
|
Out = normalize(In);
|
|
}
|
|
|
|
void Unity_Length_float3(float3 In, out float Out)
|
|
{
|
|
Out = length(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
void Unity_Add_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(float4x4 Matrix4_cb72bb33b7a84dfda97778a514f9b60f, float3 Vector3_90379ebf40aa468b8362f8d265f4f234, float4 Vector4_159bb4232f82428893101734a03e2a1e, Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float IN, out float4 WindPoint_1)
|
|
{
|
|
float3 _Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3 = Vector3_90379ebf40aa468b8362f8d265f4f234;
|
|
float4x4 _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4 = Matrix4_cb72bb33b7a84dfda97778a514f9b60f;
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].r, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].r);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].g, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].g);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].b, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].b);
|
|
float4 _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4 = float4(_Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[0].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[1].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[2].a, _Property_0ccfce542b5a45ac9b2982fe9b0a6f94_Out_0_Matrix4[3].a);
|
|
float3 _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4.xyz), _Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3);
|
|
float3 _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3);
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[0];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[1];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[2];
|
|
float _Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M0_1_Vector4[3];
|
|
float _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_95daedfd69f34cb1bdd7e1efcdaa8440_Out_2_Vector3, _Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float);
|
|
float4 _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4 = Vector4_159bb4232f82428893101734a03e2a1e;
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[0];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[1];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[2];
|
|
float _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float = _Property_95860f949fd1491fa36d8d177961e858_Out_0_Vector4[3];
|
|
float _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float;
|
|
Unity_Divide_float(_Length_dbcd47a2d3574d29bd8b12b1cdb0745a_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_R_1_Float, _Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float);
|
|
float _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_19f232d35a834d09895353590c5a8b5a_Out_2_Float, float(0), float(1), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float);
|
|
float _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float;
|
|
Unity_Lerp_float(_Split_d6e088f9ab90466583adc22ea79eb8cc_A_4_Float, float(0), _Clamp_de1c41c0ba3341a2911a314981cf7a7a_Out_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float);
|
|
float3 _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_bb19d5a0fb6544769cde736c8f2bcf83_Out_1_Vector3, (_Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float.xxx), _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3);
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[0];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[1];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float = _Multiply_d943bd948d9a4a6caab75f7761fc1c8d_Out_2_Vector3[2];
|
|
float _Split_ef99a48850fe4f8f8e30e870c5e2ee09_A_4_Float = 0;
|
|
float4 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4;
|
|
float3 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3;
|
|
float2 _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ef99a48850fe4f8f8e30e870c5e2ee09_R_1_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_G_2_Float, _Split_ef99a48850fe4f8f8e30e870c5e2ee09_B_3_Float, _Lerp_c895c7b6e0e94a65924bfc68c604c69e_Out_3_Float, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGB_5_Vector3, _Combine_d5dcc6adcb9e470599060ef2ff7859e6_RG_6_Vector2);
|
|
float3 _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4.xyz), _Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3);
|
|
float3 _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3);
|
|
float _Split_8bbd5052350846968bf312362efd9f01_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[0];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[1];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[2];
|
|
float _Split_8bbd5052350846968bf312362efd9f01_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M1_2_Vector4[3];
|
|
float _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_7197b65dd3b4425fb005b453c221c47d_Out_2_Vector3, _Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float);
|
|
float _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float;
|
|
Unity_Divide_float(_Length_25176aaf1e3847cb98d4410ff636b560_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_G_2_Float, _Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float);
|
|
float _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_d22ef2f383f94e6cbb0ec05ab2af98d0_Out_2_Float, float(0), float(1), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float);
|
|
float _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float;
|
|
Unity_Lerp_float(_Split_8bbd5052350846968bf312362efd9f01_A_4_Float, float(0), _Clamp_ec5be35d1db54279a9e0dcdc65ab5420_Out_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float);
|
|
float3 _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_c1cb58821e4547dcbdff92ca338be8b9_Out_1_Vector3, (_Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float.xxx), _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3);
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[0];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[1];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float = _Multiply_7bd4a79d1b37484996b73b3702618628_Out_2_Vector3[2];
|
|
float _Split_ab8841795f594d3a90b87ac9fcc98d38_A_4_Float = 0;
|
|
float4 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4;
|
|
float3 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3;
|
|
float2 _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_ab8841795f594d3a90b87ac9fcc98d38_R_1_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_G_2_Float, _Split_ab8841795f594d3a90b87ac9fcc98d38_B_3_Float, _Lerp_8e9751e8ad6842b3a85b84b5b568aa94_Out_3_Float, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGB_5_Vector3, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RG_6_Vector2);
|
|
float4 _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4;
|
|
Unity_Add_float4(_Combine_d5dcc6adcb9e470599060ef2ff7859e6_RGBA_4_Vector4, _Combine_2c29d82626064a91a7c4bd08cce14cc9_RGBA_4_Vector4, _Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4);
|
|
float3 _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4.xyz), _Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3);
|
|
float3 _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3);
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[0];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[1];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[2];
|
|
float _Split_fa21a8022f944854903e06c07c6f079c_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M2_3_Vector4[3];
|
|
float _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_f38c175f40644157a8c113a8fd7c038c_Out_2_Vector3, _Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float);
|
|
float _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float;
|
|
Unity_Divide_float(_Length_882dfabd3bce4dbebba98f988f897026_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_B_3_Float, _Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float);
|
|
float _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_997deb354f774bf5b27a9320f16d1a2f_Out_2_Float, float(0), float(1), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float);
|
|
float _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float;
|
|
Unity_Lerp_float(_Split_fa21a8022f944854903e06c07c6f079c_A_4_Float, float(0), _Clamp_616aa25ccc4b4508957dfe01132d62f5_Out_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float);
|
|
float3 _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_3e728f603e4844f0ada691bd863000b2_Out_1_Vector3, (_Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float.xxx), _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3);
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[0];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[1];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float = _Multiply_0399d775d57741a6b1308fce50cf7216_Out_2_Vector3[2];
|
|
float _Split_6b9b5ad9f14a49b9bc49c718430617a8_A_4_Float = 0;
|
|
float4 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4;
|
|
float3 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3;
|
|
float2 _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_6b9b5ad9f14a49b9bc49c718430617a8_R_1_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_G_2_Float, _Split_6b9b5ad9f14a49b9bc49c718430617a8_B_3_Float, _Lerp_5d383299b2154039a2583aeed4883a88_Out_3_Float, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGB_5_Vector3, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RG_6_Vector2);
|
|
float4 _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_d1b72dc7a2294f8a86c0f5ae8ed9831b_Out_2_Vector4, _Combine_ef684d29a4b74f918ca38fa0cf6bea4d_RGBA_4_Vector4, _Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4);
|
|
float3 _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_8921fe8497db4536a36227f7cadb23db_Out_0_Vector3, (_MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4.xyz), _Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3);
|
|
float3 _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3);
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_R_1_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[0];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_G_2_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[1];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_B_3_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[2];
|
|
float _Split_1bfec6763d4b458398e36937b4114c29_A_4_Float = _MatrixSplit_09b25987ae114376bd1deca21c911b24_M3_4_Vector4[3];
|
|
float _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float;
|
|
Unity_Length_float3(_Subtract_59668fc0d64640d3926a84feeb6cc7d1_Out_2_Vector3, _Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float);
|
|
float _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float;
|
|
Unity_Divide_float(_Length_8a37c2eaad554eeb885a33813fcb99c7_Out_1_Float, _Split_3d7febba13614fefa50d13642a1d3f97_A_4_Float, _Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float);
|
|
float _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float;
|
|
Unity_Clamp_float(_Divide_1c33f266d32a43d69818e21acd21cc3f_Out_2_Float, float(0), float(1), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float);
|
|
float _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float;
|
|
Unity_Lerp_float(_Split_1bfec6763d4b458398e36937b4114c29_A_4_Float, float(0), _Clamp_5ea5d4daacbb48b8a052eb0b94a0a46e_Out_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float);
|
|
float3 _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_fb80659c0b1d4ba2b93a9c269e0cc737_Out_1_Vector3, (_Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float.xxx), _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3);
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_R_1_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[0];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[1];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float = _Multiply_67f2ec6d64334332906d5c564d5bb7c5_Out_2_Vector3[2];
|
|
float _Split_e22879e6c4574322ab21f6261a21bced_A_4_Float = 0;
|
|
float4 _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4;
|
|
float3 _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3;
|
|
float2 _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_e22879e6c4574322ab21f6261a21bced_R_1_Float, _Split_e22879e6c4574322ab21f6261a21bced_G_2_Float, _Split_e22879e6c4574322ab21f6261a21bced_B_3_Float, _Lerp_b26221cb41884c75acf850b4f66b414b_Out_3_Float, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGB_5_Vector3, _Combine_872906644fc84c8c8286733edba75045_RG_6_Vector2);
|
|
float4 _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
Unity_Add_float4(_Add_e88334a2c6bf40e197a79d333645fdb2_Out_2_Vector4, _Combine_872906644fc84c8c8286733edba75045_RGBA_4_Vector4, _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4);
|
|
WindPoint_1 = _Add_710af6873aa744f6838904f22ad657e2_Out_2_Vector4;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Or_float(float A, float B, out float Out)
|
|
{
|
|
Out = A || B;
|
|
}
|
|
|
|
void Unity_Branch_float3(float Predicate, float3 True, float3 False, out float3 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Add_float(float A, float B, out float Out)
|
|
{
|
|
Out = A + B;
|
|
}
|
|
|
|
struct Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float
|
|
{
|
|
};
|
|
|
|
void SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(float3 Vector3_604F121F, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7F78DDD2, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float Vector1_5EFF6B1A, Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float IN, out float3 direction_1, out float strength_2)
|
|
{
|
|
float4 _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[0];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[1];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[2];
|
|
float _Split_f4f701329abd45808bbd6b61ce26dcc8_A_4_Float = _Property_8eece987bcee5a8681353e05121e2390_Out_0_Vector4[3];
|
|
float4 _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4;
|
|
float3 _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3;
|
|
float2 _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4f701329abd45808bbd6b61ce26dcc8_R_1_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_G_2_Float, _Split_f4f701329abd45808bbd6b61ce26dcc8_B_3_Float, float(0), _Combine_39060d5de038a58eb7462ba953e69739_RGBA_4_Vector4, _Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Combine_39060d5de038a58eb7462ba953e69739_RG_6_Vector2);
|
|
float3 _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Combine_39060d5de038a58eb7462ba953e69739_RGB_5_Vector3, _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3);
|
|
float4 _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_R_1_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[0];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_G_2_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[1];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_B_3_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[2];
|
|
float _Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float = _Property_2c43c4b554974085ab95cddc7214c1e2_Out_0_Vector4[3];
|
|
float3 _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, (_Split_aeb4c57f09db718e9e14c3afd38465ae_A_4_Float.xxx), _Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3);
|
|
float _Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float = Vector1_9365F438;
|
|
float _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_72aef364136bb683b08145ce7a1b59a1_Out_0_Float, float(0), _Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean);
|
|
UnityTexture2D _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float3 _Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3 = float3(float(1), float(0), float(0));
|
|
float _Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Property_e53ae21dcf87e286b67de750a59275e7_Out_0_Float.xxx), _Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3);
|
|
float _Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float = Vector1_5EFF6B1A;
|
|
float3 _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_ea451e1902009f82a8b8044a4344575e_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3);
|
|
float3 _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_f0ff7954720d018395b7da89e2e2d761_Out_0_Vector3, _Multiply_ae858d83e1cea885a9aa0a01a1eef954_Out_2_Vector3, _Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3);
|
|
float _Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float = Vector1_6803B355;
|
|
float3 _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b8786cc4ca501c8ba745007b3c25c479_Out_2_Vector3, (_Property_7f2599afa6fc5b8394c8fb0389031122_Out_0_Float.xxx), _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3);
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[0];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_G_2_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[1];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float = _Multiply_4cc0cd205c36b88aa0411aa274ed6066_Out_2_Vector3[2];
|
|
float _Split_f4466ebe24e7fa838f5735fb1210a3dd_A_4_Float = 0;
|
|
float4 _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4;
|
|
float3 _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3;
|
|
float2 _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_f4466ebe24e7fa838f5735fb1210a3dd_R_1_Float, _Split_f4466ebe24e7fa838f5735fb1210a3dd_B_3_Float, float(0), float(0), _Combine_0ac20ec517f076829f01b70d67c5af02_RGBA_4_Vector4, _Combine_0ac20ec517f076829f01b70d67c5af02_RGB_5_Vector3, _Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.tex, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.samplerstate, _Property_acc8b35c6330408c905387353b2a48e7_Out_0_Texture2D.GetTransformedUV(_Combine_0ac20ec517f076829f01b70d67c5af02_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_G_6_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_B_7_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_A_8_Float = _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_RGBA_0_Vector4.a;
|
|
float _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float;
|
|
Unity_Branch_float(_Comparison_30e6d1ed5d13ea88ac1c717b4cf7f8b6_Out_2_Boolean, _SampleTexture2DLOD_230c200055ef6a87bc7e6561e4cc94a8_R_5_Float, float(0), _Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float);
|
|
float _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float;
|
|
Unity_Power_float(_Branch_710124ae92f9d88bbca57ab4e6ca8632_Out_3_Float, float(2), _Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float);
|
|
float _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float = Vector1_F53C4B89;
|
|
float _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float;
|
|
Unity_Multiply_float_float(_Power_62722ebbb5d5b18cb4e41bb5612b4f78_Out_2_Float, _Property_9592cd5ab3f8628d995c1b79e8b0e51d_Out_0_Float, _Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float);
|
|
float3 _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3((_Multiply_a0cee471fa6b3f81a23110085b9f7901_Out_2_Float.xxx), _Normalize_a38510e5fae5478f897b4be58ae18930_Out_1_Vector3, _Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3);
|
|
float _Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float = Vector1_9365F438;
|
|
float3 _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_dbea21b5e949338ba29fe217546785bd_Out_2_Vector3, (_Property_7be270a4cb312f8ebbfba142f454b30d_Out_0_Float.xxx), _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3);
|
|
float3 _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_43c9dfe8713d4584b24b33530801a1b9_Out_2_Vector3, _Multiply_57f8f9285ea3698a9db9febf3bb09729_Out_2_Vector3, _Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3);
|
|
float4 _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Split_e719665c40324e89a536d165d0427a68_R_1_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[0];
|
|
float _Split_e719665c40324e89a536d165d0427a68_G_2_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[1];
|
|
float _Split_e719665c40324e89a536d165d0427a68_B_3_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[2];
|
|
float _Split_e719665c40324e89a536d165d0427a68_A_4_Float = _Property_d76b4059b7077987b51af415dfa9bf4a_Out_0_Vector4[3];
|
|
float _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Split_e719665c40324e89a536d165d0427a68_A_4_Float, float(0), _Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean);
|
|
float _Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float = Vector1_2EC6D670;
|
|
float _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_295a45d224dd35829c1fc35a5ac74847_Out_0_Float, float(0), _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean);
|
|
float _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean;
|
|
Unity_Or_float(_Comparison_0e3f11398ddedf898ab9dfc4afb01674_Out_2_Boolean, _Comparison_d11455e909bf08898f06c88542bc8c3c_Out_2_Boolean, _Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean);
|
|
UnityTexture2D _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
float3 _Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Vector3_a72856f64732461f9c308d03c9df6e06_Out_0_Vector3, (_Split_e719665c40324e89a536d165d0427a68_A_4_Float.xxx), _Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3);
|
|
float3 _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Multiply_aabee1c217095b809f71af0c1a159e17_Out_2_Vector3, (_Property_bad047c8692ad38e91118ad73dfde8a1_Out_0_Float.xxx), _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3);
|
|
float3 _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Property_c82f40aba4b7f08db9a97aaccbe0e096_Out_0_Vector3, _Multiply_dc69447dd485178f8993dfedd03528df_Out_2_Vector3, _Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3);
|
|
float _Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float = Vector1_B4470F9B;
|
|
float3 _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_994d0a10f1b53f89a06319a456a703cb_Out_2_Vector3, (_Property_1ab0df57959c6986a0602bb0abfeaf58_Out_0_Float.xxx), _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3);
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[0];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_G_2_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[1];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float = _Multiply_9653c173603c7f88bb186f1bf4699302_Out_2_Vector3[2];
|
|
float _Split_5ff678fef0fb61889da2a8288f7e7d15_A_4_Float = 0;
|
|
float4 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4;
|
|
float3 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3;
|
|
float2 _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2;
|
|
Unity_Combine_float(_Split_5ff678fef0fb61889da2a8288f7e7d15_R_1_Float, _Split_5ff678fef0fb61889da2a8288f7e7d15_B_3_Float, float(0), float(0), _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGBA_4_Vector4, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RGB_5_Vector3, _Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2);
|
|
float4 _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4 = SAMPLE_TEXTURE2D_LOD(_Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.tex, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.samplerstate, _Property_0c5a125604df6a8c882ffd08d9ab1eb1_Out_0_Texture2D.GetTransformedUV(_Combine_c6371d3dd2e6e588b17d15becfd9f41f_RG_6_Vector2), float(3));
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.r;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.g;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.b;
|
|
float _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_A_8_Float = _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_RGBA_0_Vector4.a;
|
|
float4 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4;
|
|
float3 _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3;
|
|
float2 _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2;
|
|
Unity_Combine_float(_SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_R_5_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_G_6_Float, _SampleTexture2DLOD_f9da942482343b84b60697d06f23721c_B_7_Float, float(0), _Combine_3136fa3d24c46087969f5a3828ccbb98_RGBA_4_Vector4, _Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, _Combine_3136fa3d24c46087969f5a3828ccbb98_RG_6_Vector2);
|
|
float3 _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3;
|
|
Unity_Add_float3(_Combine_3136fa3d24c46087969f5a3828ccbb98_RGB_5_Vector3, float3(-0.5, -0.5, -0.5), _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3);
|
|
float3 _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3;
|
|
Unity_Branch_float3(_Or_4341a0900c08ad87bd6a2225f3fa0566_Out_2_Boolean, _Add_ef7a0ab366477c878fbb735a918f7344_Out_2_Vector3, float3(0, 0, 0), _Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3);
|
|
float _Property_9946d066804cc584a96830f8d35269cc_Out_0_Float = Vector1_2EC6D670;
|
|
float3 _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Branch_740c68545077da8f8307f27b8c42ae4a_Out_3_Vector3, (_Property_9946d066804cc584a96830f8d35269cc_Out_0_Float.xxx), _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3);
|
|
float3 _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_02d5dc0d629dcd8f97caf80b6afb884c_Out_2_Vector3, _Multiply_96523fbe5cf67789a958918945aae4af_Out_2_Vector3, _Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3);
|
|
float _Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float = Vector1_A2C4B4F4;
|
|
float3 _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Add_36ab0a2baacbf685bfc47193bdd9ede0_Out_2_Vector3, (_Property_4ffb3356bdb9c78c815a6e7da47e7a34_Out_0_Float.xxx), _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3);
|
|
float _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float;
|
|
Unity_Length_float3(_Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3, _Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float);
|
|
float _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float = Vector1_7F78DDD2;
|
|
float _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float;
|
|
Unity_Add_float(_Length_5a5f71c3d2510f898359c583d75db21b_Out_1_Float, _Property_51d6736452f5938caf6f83cdfc7df682_Out_0_Float, _Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float);
|
|
float _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
Unity_Multiply_float_float(_Add_8b1ff99f4209848e94b032b984c39e3d_Out_2_Float, 0.001, _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float);
|
|
direction_1 = _Multiply_5c06c9a8640ee88fa0516a7a341a0ea9_Out_2_Vector3;
|
|
strength_2 = _Multiply_5a6d4212aae61b828d149e491e799600_Out_2_Float;
|
|
}
|
|
|
|
void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = cross(A, B);
|
|
}
|
|
|
|
void Unity_Comparison_Equal_float(float A, float B, out float Out)
|
|
{
|
|
Out = A == B ? 1 : 0;
|
|
}
|
|
|
|
void Unity_DotProduct_float3(float3 A, float3 B, out float Out)
|
|
{
|
|
Out = dot(A, B);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Maximum_float(float A, float B, out float Out)
|
|
{
|
|
Out = max(A, B);
|
|
}
|
|
|
|
void Unity_Cosine_float(float In, out float Out)
|
|
{
|
|
Out = cos(In);
|
|
}
|
|
|
|
void Unity_Sine_float(float In, out float Out)
|
|
{
|
|
Out = sin(In);
|
|
}
|
|
|
|
void Unity_Comparison_NotEqual_float(float A, float B, out float Out)
|
|
{
|
|
Out = A != B ? 1 : 0;
|
|
}
|
|
|
|
struct Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float4 VertexColor;
|
|
};
|
|
|
|
void SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(float Vector1_BCB03E1A, float3 Vector3_C30D997B, float Vector1_A2C4B4F4, float Vector1_7EE0F94A, float Boolean_527CB26E, float Vector1_DE1BF63A, float Vector1_7F78DDD2, float3 Vector3_DE8CC74D, UnityTexture2D Texture2D_5BAC276D, UnityTexture2D Texture2D_A3874DB9, float4 Vector4_EBFF8CDE, float Vector1_B4470F9B, float Vector1_2EC6D670, float Vector1_9365F438, float Vector1_F53C4B89, float Vector1_6803B355, float4x4 Matrix4_0617b0bd42fc46ff90b1d55303a5477f, float4 Vector4_b44806ec67ca461fbcdf009dc6092cc3, Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float IN, out float3 vertex_1, out float3 normal_2)
|
|
{
|
|
float4 _Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3;
|
|
{
|
|
// Converting Position from Object to AbsoluteWorld via world space
|
|
float3 world;
|
|
world = TransformObjectToWorld((_Vector4_991bdf9badea4b2bb70edc71a7338c1d_Out_0_Vector4.xyz).xyz);
|
|
_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3 = GetAbsolutePositionWS(world);
|
|
}
|
|
float _Distance_343883e4e5444664abed46100940f24f_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_e3860e53bada42a3ab41609e093dcd30_Out_1_Vector3, float3(0, 0, 0), _Distance_343883e4e5444664abed46100940f24f_Out_2_Float);
|
|
float _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Distance_343883e4e5444664abed46100940f24f_Out_2_Float, float(0.001), _Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean);
|
|
float3 _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3 = Vector3_C30D997B;
|
|
float4 _Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4 = float4(float(0), float(0), float(0), float(1));
|
|
float3 _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3;
|
|
_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3 = TransformObjectToWorld((_Vector4_d213eb2790b34988809a251ff9c74c6b_Out_0_Vector4.xyz).xyz);
|
|
float3 _Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3 = Vector3_C30D997B;
|
|
float3 _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3;
|
|
_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3 = TransformObjectToWorld(_Property_4a88ff8e6e6b2b84bb2818cf73a0af30_Out_0_Vector3.xyz);
|
|
float _Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean = Boolean_527CB26E;
|
|
float _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float = Vector1_7EE0F94A;
|
|
float _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, float(0), _Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean);
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_R_1_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[0];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[1];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_B_3_Float = _Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3[2];
|
|
float _Split_05e55a8c1b8cf88f93cbafc67103b677_A_4_Float = 0;
|
|
float _Split_7a634ef857769683b2100876a36535a2_R_1_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[0];
|
|
float _Split_7a634ef857769683b2100876a36535a2_G_2_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[1];
|
|
float _Split_7a634ef857769683b2100876a36535a2_B_3_Float = _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3[2];
|
|
float _Split_7a634ef857769683b2100876a36535a2_A_4_Float = 0;
|
|
float _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float;
|
|
Unity_Subtract_float(_Split_05e55a8c1b8cf88f93cbafc67103b677_G_2_Float, _Split_7a634ef857769683b2100876a36535a2_G_2_Float, _Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float);
|
|
float _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean;
|
|
Unity_Comparison_Less_float(_Subtract_1a45a2cfb2029a85a28951578a3fde32_Out_2_Float, _Property_d2b118dbe85e878e9fec6b0b9baa39c4_Out_0_Float, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean);
|
|
float _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean;
|
|
Unity_And_float(_Comparison_5cee8efb01c62783a5e7b747d356c826_Out_2_Boolean, _Comparison_010cc8a451c9dc83967dac44b371c4df_Out_2_Boolean, _And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean);
|
|
float _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float = Vector1_A2C4B4F4;
|
|
float _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float;
|
|
Unity_Branch_float(_And_555aa962b30d6f8fa39e7b48a39aed28_Out_2_Boolean, float(1E-05), _Property_e5e59fcc565a8b80ac239ba87d1bcf74_Out_0_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float);
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_R_1_Float = IN.VertexColor[0];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_G_2_Float = IN.VertexColor[1];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_B_3_Float = IN.VertexColor[2];
|
|
float _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float = IN.VertexColor[3];
|
|
float _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Split_43013162a81fc4889a1944f2a2b75f66_A_4_Float, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float);
|
|
float _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float;
|
|
Unity_Branch_float(_Property_dfda12e25f42bd808e65c99db447e176_Out_0_Boolean, _Multiply_9c96a1fd35427788a3d19f08eaffffef_Out_2_Float, _Branch_24dc0e5d7442ff84b33e0e63f143d905_Out_3_Float, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float);
|
|
float _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float = Vector1_7F78DDD2;
|
|
UnityTexture2D _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D = Texture2D_5BAC276D;
|
|
UnityTexture2D _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D = Texture2D_A3874DB9;
|
|
float4 _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4 = Vector4_EBFF8CDE;
|
|
float _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float;
|
|
Unity_Length_float4(_Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, _Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float);
|
|
float _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean;
|
|
Unity_Comparison_Greater_float(_Length_2deb60e58108481bbea09c2abd4f6360_Out_1_Float, float(0), _Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean);
|
|
float4 _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4;
|
|
Unity_Branch_float4(_Comparison_e709f727d2ea465cb4118f3949b53fe3_Out_2_Boolean, _Property_deadd39786d94cb381d4d15213801177_Out_0_Vector4, float4(0, 0, 1, 1), _Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4);
|
|
float4x4 _Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4 = Matrix4_0617b0bd42fc46ff90b1d55303a5477f;
|
|
float4 _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4 = Vector4_b44806ec67ca461fbcdf009dc6092cc3;
|
|
Bindings_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float _WindNMPoints_071e9370484b4168b560a27fbea64a52;
|
|
float4 _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4;
|
|
SG_WindNMPoints_eafc4540c9670c64fbeda2f043314cec_float(_Property_cb03cb298f0a47d4ae24d85f3c47db75_Out_0_Matrix4, SHADERGRAPH_OBJECT_POSITION, _Property_844e35a56a864617b521872c1cee398d_Out_0_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4);
|
|
float4 _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4;
|
|
Unity_Add_float4(_Branch_2e6bb4148fd446a993140d85024ed2fd_Out_3_Vector4, _WindNMPoints_071e9370484b4168b560a27fbea64a52_WindPoint_1_Vector4, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4);
|
|
float _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float = Vector1_B4470F9B;
|
|
float _Property_6b508d48a081548385021b27896c0622_Out_0_Float = Vector1_2EC6D670;
|
|
float _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float = Vector1_9365F438;
|
|
float _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float = Vector1_F53C4B89;
|
|
float _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float = Vector1_6803B355;
|
|
float _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float = Vector1_BCB03E1A;
|
|
Bindings_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba;
|
|
float3 _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3;
|
|
float _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float;
|
|
SG_WindNMCalculateNoShiver_eb6e21ce3f0928341b88e73dd9c62c10_float(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Branch_61b7d28e5f7d2981b63f0054ac12d71a_Out_3_Float, _Property_eaab26f57a13988a8a813ad0813c8570_Out_0_Float, _Property_0f02225ebee993849ea6be48328c0958_Out_0_Texture2D, _Property_fce16cc7b4fcf48097b94eb2d5f1b596_Out_0_Texture2D, _Add_a113107313614631a97405d9184f98a3_Out_2_Vector4, _Property_02c51f4c8a859f8f88433b435d4452f6_Out_0_Float, _Property_6b508d48a081548385021b27896c0622_Out_0_Float, _Property_d73fed4fb3c7b58d892364765a30498b_Out_0_Float, _Property_c3101a1b656cac858bfa11dbe7ebd268_Out_0_Float, _Property_c82c2ac458938d86bcc1aae3a58cc1dc_Out_0_Float, _Property_3f5330d8bec7c681ab9563aad03c7b89_Out_0_Float, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float);
|
|
float3 _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3;
|
|
Unity_CrossProduct_float(float3 (0, 1, 0), _WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_direction_1_Vector3, _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3);
|
|
float _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean;
|
|
Unity_Comparison_Equal_float((_CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3).x, float(0), _Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean);
|
|
float3 _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_0f5ed7667cdf4578afbecdf1b475e950_Out_2_Boolean, float3(1E-06, 1E-06, 1E-06), _CrossProduct_968274de232ac28180b15962e0cd7d4b_Out_2_Vector3, _Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3);
|
|
float3 _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3;
|
|
Unity_Normalize_float3(_Branch_c8dd300f10fc4f43be96bb48a7829077_Out_3_Vector3, _Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3);
|
|
float3 _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3);
|
|
float _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float;
|
|
Unity_DotProduct_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_669f1473ae7e6e8595e30c93528623a2_Out_2_Vector3, _DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float);
|
|
float3 _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, (_DotProduct_4ef6847a2d36df8cac2bf956cc3d32e0_Out_2_Float.xxx), _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3);
|
|
float3 _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3;
|
|
Unity_Add_float3(_Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Multiply_cde444a0de597b8282b544296776bd35_Out_2_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3);
|
|
float3 _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3;
|
|
Unity_Subtract_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3);
|
|
float _Distance_702b068f612c7289a99272879da274ed_Out_2_Float;
|
|
Unity_Distance_float3(_Transform_d324a56361d94f80935dd05df051490e_Out_1_Vector3, _Transform_4acbe76287b06c88a7e8fd7bf234e885_Out_1_Vector3, _Distance_702b068f612c7289a99272879da274ed_Out_2_Float);
|
|
float _Property_f5c255b0f666358291012b78132d6593_Out_0_Float = Vector1_DE1BF63A;
|
|
float _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float;
|
|
Unity_Divide_float(_Distance_702b068f612c7289a99272879da274ed_Out_2_Float, _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float);
|
|
float _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float;
|
|
Unity_Absolute_float(_Divide_86ba32ec2efb64888f1b432782289403_Out_2_Float, _Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float);
|
|
float _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float = float(1E-07);
|
|
float _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float;
|
|
Unity_Maximum_float(_Absolute_b490a8463d40078e9f49eb1f255aba57_Out_1_Float, _Float_96534b09fc72da8da7bad6ebdb2b01ab_Out_0_Float, _Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float);
|
|
float _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float;
|
|
Unity_Divide_float(float(1), _Property_f5c255b0f666358291012b78132d6593_Out_0_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float);
|
|
float _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float;
|
|
Unity_Power_float(_Maximum_433c7134dae10d83ad9da03f0d30c4a0_Out_2_Float, _Divide_c45d79d6b2beea8293614db9809045fa_Out_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float);
|
|
float _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float;
|
|
Unity_Multiply_float_float(_WindNMCalculateNoShiver_ed5866aa196e188893da1307437132ba_strength_2_Float, _Power_aae331b5fcc0168da1590dbbc62504a4_Out_2_Float, _Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float);
|
|
float _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float;
|
|
Unity_Cosine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float);
|
|
float3 _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, (_Cosine_210f67c5c8fb6c8aa417007f6255e22d_Out_1_Float.xxx), _Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3);
|
|
float3 _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3;
|
|
Unity_CrossProduct_float(_Normalize_9fd167d60aa1d1809fce8233690a3c5c_Out_1_Vector3, _Subtract_b285d42464e22a80adba2a34d1e89a02_Out_2_Vector3, _CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3);
|
|
float _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float;
|
|
Unity_Sine_float(_Multiply_13e65c7c3e1e8282bd06a4e2746f709f_Out_2_Float, _Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float);
|
|
float3 _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_CrossProduct_f5f50ca0805f7080b7fd20844a78afc1_Out_2_Vector3, (_Sine_419aece79cb6a485a9c3dec0b5b09f8c_Out_1_Float.xxx), _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3);
|
|
float3 _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3;
|
|
Unity_Add_float3(_Multiply_2f6dc881c414ee89a8fbbf0a5e0014eb_Out_2_Vector3, _Multiply_df4686bd34ab88839180248e49a9f266_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3);
|
|
float3 _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3;
|
|
Unity_Add_float3(_Add_148ed50f060f2a859e921addaad435fd_Out_2_Vector3, _Add_c14d4bcfa1ccf486a133715f088d8cf7_Out_2_Vector3, _Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3);
|
|
float3 _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3;
|
|
_Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3 = TransformWorldToObject(_Add_d48375b91f961f89b468b522221fb6ee_Out_2_Vector3.xyz);
|
|
float3 _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_6cf8be06421545a08bdb1356deefd1b9_Out_2_Boolean, _Property_2a4ab46b1d7c45918978aae50bd32b6f_Out_0_Vector3, _Transform_224c24cf5953f18a87e2088380250252_Out_1_Vector3, _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3);
|
|
float3 _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3 = Vector3_DE8CC74D;
|
|
float _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float;
|
|
Unity_Length_float3(_Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float);
|
|
float _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean;
|
|
Unity_Comparison_NotEqual_float(_Length_8fac716cbfa5b983ba3cf14312642ac5_Out_1_Float, float(0), _Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean);
|
|
float3 _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(IN.WorldSpaceNormal, _Property_c5f622c3918154808caa04a0cff875eb_Out_0_Vector3, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3);
|
|
float3 _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
Unity_Branch_float3(_Comparison_17ad34828cc8b986ac7beaf8f6f2b799_Out_2_Boolean, _Multiply_d5e536621795b68bbc95bb5cc341dfcf_Out_2_Vector3, IN.WorldSpaceNormal, _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3);
|
|
vertex_1 = _Branch_bb3f6dc3a34c46ccae98ed5d67676c93_Out_3_Vector3;
|
|
normal_2 = _Branch_e504c7d39baa3084852f5cd5fd3d9d94_Out_3_Vector3;
|
|
}
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
float3 _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3;
|
|
Unity_Add_float3(IN.ObjectSpacePosition, float3(1E-07, 1E-07, 1E-07), _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3);
|
|
float _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float = _Drag;
|
|
float _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float = _HeightDrag;
|
|
float _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float = _Stiffness;
|
|
float _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float = _InitialBend;
|
|
float4 _Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4 = _NewNormal;
|
|
UnityTexture2D _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexNoise);
|
|
UnityTexture2D _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(WIND_SETTINGS_TexGust);
|
|
float4 _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4 = WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float = WIND_SETTINGS_FlexNoiseScale;
|
|
float _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float = WIND_SETTINGS_Turbulence;
|
|
float _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float = WIND_SETTINGS_GustSpeed;
|
|
float _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float = WIND_SETTINGS_GustScale;
|
|
float _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float = WIND_SETTINGS_GustWorldScale;
|
|
float4x4 _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4 = WIND_SETTINGS_Points;
|
|
float4 _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4 = WIND_SETTINGS_Points_Radius;
|
|
Bindings_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.WorldSpaceNormal = IN.WorldSpaceNormal;
|
|
_WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877.VertexColor = IN.VertexColor;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
float3 _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3;
|
|
SG_WindNMNoShiver_76b4d01171ac5564a83e72b2b046c0cf_float(IN.TimeParameters.x, _Add_31f3b375c692426fa7510cf09a574bf8_Out_2_Vector3, _Property_832591c570c5ef8ca5aa7883847e6ce5_Out_0_Float, _Property_f8de1ebb334d2982bd04750be5001905_Out_0_Float, 0, _Property_35bda80cbd3a028db9019184e3f1d473_Out_0_Float, _Property_54574a47e8d007869c723d2707702a4d_Out_0_Float, (_Property_4b5462bbe2f2a58cb20edd072d0fba83_Out_0_Vector4.xyz), _Property_5d5096b3b86b248081565f41cc9435c0_Out_0_Texture2D, _Property_20ddd6416c61b789aa44ae2385c9dd81_Out_0_Texture2D, _Property_db0b3709282a888087ca0b325602fcf7_Out_0_Vector4, _Property_4fbb56052a534d8db23c5137b143c46c_Out_0_Float, _Property_4fafa760ceb17e8f997de1b0fa01db06_Out_0_Float, _Property_6fd72dee87449887ae0effd08ad9ee0c_Out_0_Float, _Property_709ee29eb18bf28488afa8d130799898_Out_0_Float, _Property_ce2d025b3c6c078e9009049f6fe6fbf2_Out_0_Float, _Property_91a99faf2fd044ceaf10d2c6d9142ded_Out_0_Matrix4, _Property_1313ba3c59f24489b442d9cf411a23a7_Out_0_Vector4, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3, _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_normal_2_Vector3);
|
|
description.Position = _WindNMNoShiver_e0925fdd15a66f8faa6049241dc54877_vertex_1_Vector3;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
|
|
VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.WorldSpaceNormal = TransformObjectToWorldNormal(input.normalOS);
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
output.VertexColor = input.color;
|
|
output.TimeParameters = _TimeParameters.xyz; // Note: in case of animation this will be overwrite (allow to handle motion vector)
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
return output;
|
|
}
|
|
|
|
VertexDescription GetVertexDescription(AttributesMesh input, float3 timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
// build graph inputs
|
|
VertexDescriptionInputs vertexDescriptionInputs = AttributesMeshToVertexDescriptionInputs(input);
|
|
// Override time parameters with used one (This is required to correctly handle motion vectors for vertex animation based on time)
|
|
vertexDescriptionInputs.TimeParameters = timeParameters;
|
|
|
|
// evaluate vertex graph
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
// Fetch the vertex graph properties for the particle instance.
|
|
GetElementVertexProperties(element, properties);
|
|
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs, properties);
|
|
#else
|
|
VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs);
|
|
#endif
|
|
return vertexDescription;
|
|
|
|
}
|
|
|
|
AttributesMesh ApplyMeshModification(AttributesMesh input, float3 timeParameters
|
|
#ifdef USE_CUSTOMINTERP_SUBSTRUCT
|
|
#ifdef TESSELLATION_ON
|
|
, inout VaryingsMeshToDS varyings
|
|
#else
|
|
, inout VaryingsMeshToPS varyings
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, timeParameters
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
|
|
// copy graph output to the results
|
|
input.positionOS = vertexDescription.Position;
|
|
input.normalOS = vertexDescription.Normal;
|
|
input.tangentOS.xyz = vertexDescription.Tangent;
|
|
|
|
|
|
|
|
return input;
|
|
}
|
|
|
|
#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
|
|
// Return precomputed Velocity in object space
|
|
float3 GetCustomVelocity(AttributesMesh input
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, AttributesElement element
|
|
#endif
|
|
)
|
|
{
|
|
VertexDescription vertexDescription = GetVertexDescription(input, _TimeParameters.xyz
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
, element
|
|
#endif
|
|
);
|
|
return vertexDescription.CustomVelocity;
|
|
}
|
|
#endif
|
|
|
|
FragInputs BuildFragInputs(VaryingsMeshToPS input)
|
|
{
|
|
FragInputs output;
|
|
ZERO_INITIALIZE(FragInputs, output);
|
|
|
|
// Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used).
|
|
// TODO: this is a really poor workaround, but the variable is used in a bunch of places
|
|
// to compute normals which are then passed on elsewhere to compute other values...
|
|
output.tangentToWorld = k_identity3x3;
|
|
output.positionSS = input.positionCS; // input.positionCS is SV_Position
|
|
|
|
output.positionRWS = input.positionRWS;
|
|
output.tangentToWorld = BuildTangentToWorld(input.tangentWS, input.normalWS);
|
|
output.texCoord0 = input.texCoord0;
|
|
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
#else
|
|
#endif
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
#if VFX_USE_GRAPH_VALUES
|
|
uint instanceActiveIndex = asuint(UNITY_ACCESS_INSTANCED_PROP(PerInstance, _InstanceActiveIndex));
|
|
/* WARNING: $splice Could not find named fragment 'VFXLoadGraphValues' */
|
|
#endif
|
|
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
// splice point to copy custom interpolator fields from varyings to frag inputs
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// existing HDRP code uses the combined function to go directly from packed to frag inputs
|
|
FragInputs UnpackVaryingsMeshToFragInputs(PackedVaryingsMeshToPS input)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
#if defined(HAVE_VFX_MODIFICATION) && defined(UNITY_INSTANCING_ENABLED)
|
|
unity_InstanceID = input.instanceID;
|
|
#endif
|
|
VaryingsMeshToPS unpacked = UnpackVaryingsMeshToPS(input);
|
|
return BuildFragInputs(unpacked);
|
|
}
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassConstant.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
SubShader
|
|
{
|
|
Tags
|
|
{
|
|
"RenderPipeline"="HDRenderPipeline"
|
|
"RenderType"="HDLitShader"
|
|
"Queue"="AlphaTest+25"
|
|
"DisableBatching"="LODFading"
|
|
"ShaderGraphShader"="true"
|
|
"ShaderGraphTargetId"="HDLitSubTarget"
|
|
}
|
|
Pass
|
|
{
|
|
Name "IndirectDXR"
|
|
Tags
|
|
{
|
|
"LightMode" = "IndirectDXR"
|
|
}
|
|
|
|
// Render State
|
|
// RenderState: <None>
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 5.0
|
|
#pragma raytracing surface_shader
|
|
#pragma only_renderers d3d11 xboxseries ps5
|
|
|
|
// Keywords
|
|
#pragma multi_compile _ MULTI_BOUNCE_INDIRECT
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ DEBUG_DISPLAY
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile_raytracing _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile_raytracing DECALS_OFF DECALS_3RT DECALS_4RT
|
|
#pragma multi_compile_raytracing _ DECAL_SURFACE_GRADIENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_RAYTRACING_INDIRECT
|
|
#define PUNCTUAL_SHADOW_LOW
|
|
#define DIRECTIONAL_SHADOW_LOW
|
|
#define RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define LIGHTLOOP_DISABLE_TILE_AND_CLUSTER 1
|
|
#define PATH_TRACING_CLUSTERED_DECALS 1
|
|
#define HAS_LIGHTLOOP 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreInclude' */
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define ATTRIBUTES_NEED_TEXCOORD2
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_TEXCOORD2
|
|
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
#define FRAG_INPUTS_USE_TEXCOORD1
|
|
#define FRAG_INPUTS_USE_TEXCOORD2
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingMacros.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracingLightLoop.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingIntersection.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRayTracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingLightLoop.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingCommon.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
|
|
//Interpolator Packs: <None>
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
// Graph Vertex
|
|
// GraphVertex: <None>
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorCopyToSDI' */
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingIndirect.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "VisibilityDXR"
|
|
Tags
|
|
{
|
|
"LightMode" = "VisibilityDXR"
|
|
}
|
|
|
|
// Render State
|
|
// RenderState: <None>
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 5.0
|
|
#pragma raytracing surface_shader
|
|
#pragma only_renderers d3d11 xboxseries ps5
|
|
|
|
// Keywords
|
|
#pragma multi_compile _ TRANSPARENT_COLOR_SHADOW
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_RAYTRACING_VISIBILITY
|
|
#define RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreInclude' */
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingMacros.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracingLightLoop.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingIntersection.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRayTracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingCommon.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
|
|
//Interpolator Packs: <None>
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
// Graph Vertex
|
|
// GraphVertex: <None>
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorCopyToSDI' */
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
alphaCutoff = _UseShadowThreshold ? surfaceDescription.AlphaClipThresholdShadow : alphaCutoff;
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingVisibility.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "ForwardDXR"
|
|
Tags
|
|
{
|
|
"LightMode" = "ForwardDXR"
|
|
}
|
|
|
|
// Render State
|
|
// RenderState: <None>
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 5.0
|
|
#pragma raytracing surface_shader
|
|
#pragma only_renderers d3d11 xboxseries ps5
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ DEBUG_DISPLAY
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile_raytracing _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_RAYTRACING_FORWARD
|
|
#define PUNCTUAL_SHADOW_LOW
|
|
#define DIRECTIONAL_SHADOW_LOW
|
|
#define RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define HAS_LIGHTLOOP 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreInclude' */
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define ATTRIBUTES_NEED_TEXCOORD2
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_TEXCOORD2
|
|
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
#define FRAG_INPUTS_USE_TEXCOORD1
|
|
#define FRAG_INPUTS_USE_TEXCOORD2
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingMacros.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracingLightLoop.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingIntersection.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRayTracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingLightLoop.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingCommon.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
|
|
//Interpolator Packs: <None>
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
// Graph Vertex
|
|
// GraphVertex: <None>
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorCopyToSDI' */
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingForward.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "GBufferDXR"
|
|
Tags
|
|
{
|
|
"LightMode" = "GBufferDXR"
|
|
}
|
|
|
|
// Render State
|
|
// RenderState: <None>
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 5.0
|
|
#pragma raytracing surface_shader
|
|
#pragma only_renderers d3d11 xboxseries ps5
|
|
|
|
// Keywords
|
|
#pragma multi_compile _ MINIMAL_GBUFFER
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ DEBUG_DISPLAY
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile_raytracing _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile_raytracing DECALS_OFF DECALS_3RT DECALS_4RT
|
|
#pragma multi_compile_raytracing _ DECAL_SURFACE_GRADIENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_RAYTRACING_GBUFFER
|
|
#define PUNCTUAL_SHADOW_LOW
|
|
#define DIRECTIONAL_SHADOW_LOW
|
|
#define RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define LIGHTLOOP_DISABLE_TILE_AND_CLUSTER 1
|
|
#define PATH_TRACING_CLUSTERED_DECALS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreInclude' */
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define ATTRIBUTES_NEED_TEXCOORD2
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_TEXCOORD2
|
|
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
#define FRAG_INPUTS_USE_TEXCOORD1
|
|
#define FRAG_INPUTS_USE_TEXCOORD2
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingMacros.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracingLightLoop.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Deferred/RaytracingIntersectonGBuffer.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/StandardLit/StandardLit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRayTracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingCommon.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
|
|
//Interpolator Packs: <None>
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
// Graph Vertex
|
|
// GraphVertex: <None>
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorCopyToSDI' */
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingGBuffer.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "DebugDXR"
|
|
Tags
|
|
{
|
|
"LightMode" = "DebugDXR"
|
|
}
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 5.0
|
|
#pragma raytracing surface_shader
|
|
#pragma only_renderers d3d11 xboxseries ps5
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingMacros.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingIntersection.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingCommon.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRayTracingDebug.hlsl"
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "PathTracingDXR"
|
|
Tags
|
|
{
|
|
"LightMode" = "PathTracingDXR"
|
|
}
|
|
|
|
// Render State
|
|
// RenderState: <None>
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 5.0
|
|
#pragma raytracing surface_shader
|
|
#pragma only_renderers d3d11 xboxseries ps5
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local _ _ALPHATEST_ON
|
|
#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local _ _DOUBLESIDED_ON
|
|
#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY
|
|
#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC _TRANSPARENT_REFRACTIVE_SORT
|
|
#pragma shader_feature_local_fragment _ _ENABLE_FOG_ON_TRANSPARENT
|
|
#pragma multi_compile _ DEBUG_DISPLAY
|
|
#pragma shader_feature_local_fragment _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_DECALS
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR
|
|
#pragma shader_feature_local_fragment _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma shader_feature_local_raytracing _ _DISABLE_SSR_TRANSPARENT
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile_fragment _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile_raytracing _ PROBE_VOLUMES_L1 PROBE_VOLUMES_L2
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile_raytracing DECALS_OFF DECALS_3RT DECALS_4RT
|
|
#pragma multi_compile_raytracing _ DECAL_SURFACE_GRADIENT
|
|
#pragma shader_feature_local _ _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_TRANSMISSION
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_ANISOTROPY
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_IRIDESCENCE
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
#pragma shader_feature_local_fragment _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
#pragma shader_feature_local_raytracing _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
#define SHADERPASS SHADERPASS_PATH_TRACING
|
|
#define PUNCTUAL_SHADOW_LOW
|
|
#define DIRECTIONAL_SHADOW_LOW
|
|
#define RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define LIGHTLOOP_DISABLE_TILE_AND_CLUSTER 1
|
|
#define PATH_TRACING_CLUSTERED_DECALS 1
|
|
#define HAS_LIGHTLOOP 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
#define SUPPORT_GLOBAL_MIP_BIAS 1
|
|
|
|
// For custom interpolators to inject a substruct definition before FragInputs definition,
|
|
// allowing for FragInputs to capture CI's intended for ShaderGraph's SDI.
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreInclude' */
|
|
|
|
|
|
// TODO: Merge FragInputsVFX substruct with CustomInterpolators.
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
struct FragInputsVFX
|
|
{
|
|
/* WARNING: $splice Could not find named fragment 'FragInputsVFX' */
|
|
};
|
|
#endif
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS
|
|
// Always include Shader Graph version
|
|
// Always include last to avoid double macros
|
|
#include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition
|
|
|
|
// --------------------------------------------------
|
|
// Defines
|
|
|
|
// Attribute
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define ATTRIBUTES_NEED_TEXCOORD2
|
|
#define VARYINGS_NEED_POSITION_WS
|
|
#define VARYINGS_NEED_TANGENT_TO_WORLD
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_TEXCOORD2
|
|
|
|
|
|
//Strip down the FragInputs.hlsl (on graphics), so we can only optimize the interpolators we use.
|
|
//if by accident something requests contents of FragInputs.hlsl, it will be caught as a compiler error
|
|
//Frag inputs stripping is only enabled when FRAG_INPUTS_ENABLE_STRIPPING is set
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && SHADERPASS != SHADERPASS_RAYTRACING_GBUFFER && SHADERPASS != SHADERPASS_FULL_SCREEN_DEBUG
|
|
#define FRAG_INPUTS_ENABLE_STRIPPING
|
|
#endif
|
|
#define FRAG_INPUTS_USE_TEXCOORD0
|
|
#define FRAG_INPUTS_USE_TEXCOORD1
|
|
#define FRAG_INPUTS_USE_TEXCOORD2
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl"
|
|
|
|
|
|
|
|
|
|
// Following two define are a workaround introduce in 10.1.x for RaytracingQualityNode
|
|
// The ShaderGraph don't support correctly migration of this node as it serialize all the node data
|
|
// in the json file making it impossible to uprgrade. Until we get a fix, we do a workaround here
|
|
// to still allow us to rename the field and keyword of this node without breaking existing code.
|
|
#ifdef RAYTRACING_SHADER_GRAPH_DEFAULT
|
|
#define RAYTRACING_SHADER_GRAPH_HIGH
|
|
#endif
|
|
|
|
#ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED
|
|
#define RAYTRACING_SHADER_GRAPH_LOW
|
|
#endif
|
|
// end
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// We need isFrontFace when using double sided - it is not required for unlit as in case of unlit double sided only drive the cullmode
|
|
// VARYINGS_NEED_CULLFACE can be define by VaryingsMeshToPS.FaceSign input if a IsFrontFace Node is included in the shader graph.
|
|
#if defined(_DOUBLESIDED_ON) && !defined(VARYINGS_NEED_CULLFACE)
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#endif
|
|
#endif
|
|
|
|
// Specific Material Define
|
|
#define _AMBIENT_OCCLUSION 1
|
|
#define _SPECULAR_OCCLUSION_FROM_AO 1
|
|
#define _ENERGY_CONSERVING_SPECULAR 1
|
|
|
|
#if _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
// Colored Transmission doesn't support clear coat
|
|
#undef _MATERIAL_FEATURE_CLEAR_COAT
|
|
#endif
|
|
|
|
// If we use subsurface scattering, enable output split lighting (for forward pass)
|
|
#if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define OUTPUT_SPLIT_LIGHTING
|
|
#endif
|
|
|
|
// This shader support recursive rendering for raytracing
|
|
#define HAVE_RECURSIVE_RENDERING
|
|
|
|
// In Path Tracing, For all single-sided, refractive materials, we want to force a thin refraction model
|
|
#if (SHADERPASS == SHADERPASS_PATH_TRACING) && !defined(_DOUBLESIDED_ON) && (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
|
|
#undef _REFRACTION_PLANE
|
|
#undef _REFRACTION_SPHERE
|
|
#define _REFRACTION_THIN
|
|
#endif
|
|
// Caution: we can use the define SHADER_UNLIT onlit after the above Material include as it is the Unlit template who define it
|
|
|
|
// To handle SSR on transparent correctly with a possibility to enable/disable it per framesettings
|
|
// we should have a code like this:
|
|
// if !defined(_DISABLE_SSR_TRANSPARENT)
|
|
// pragma multi_compile _ WRITE_NORMAL_BUFFER
|
|
// endif
|
|
// i.e we enable the multicompile only if we can receive SSR or not, and then C# code drive
|
|
// it based on if SSR transparent in frame settings and not (and stripper can strip it).
|
|
// this is currently not possible with our current preprocessor as _DISABLE_SSR_TRANSPARENT is a keyword not a define
|
|
// so instead we used this and chose to pay the extra cost of normal write even if SSR transaprent is disabled.
|
|
// Ideally the shader graph generator should handle it but condition below can't be handle correctly for now.
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
#if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT)
|
|
#define WRITE_NORMAL_BUFFER
|
|
#endif
|
|
#endif
|
|
|
|
// See Lit.shader
|
|
#if SHADERPASS == SHADERPASS_MOTION_VECTORS && defined(WRITE_DECAL_BUFFER_AND_RENDERING_LAYER)
|
|
#define WRITE_DECAL_BUFFER
|
|
#endif
|
|
|
|
#ifndef DEBUG_DISPLAY
|
|
// In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI)
|
|
// Don't do it with debug display mode as it is possible there is no depth prepass in this case
|
|
#if !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#if SHADERPASS == SHADERPASS_FORWARD
|
|
#define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST
|
|
#elif SHADERPASS == SHADERPASS_GBUFFER
|
|
#define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
// Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass
|
|
#if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _DEFERRED_CAPABLE_MATERIAL
|
|
#endif
|
|
|
|
// Translate transparent motion vector define
|
|
#if (defined(_TRANSPARENT_WRITES_MOTION_VEC) || defined(_TRANSPARENT_REFRACTIVE_SORT)) && defined(_SURFACE_TYPE_TRANSPARENT)
|
|
#define _WRITE_TRANSPARENT_MOTION_VECTOR
|
|
#endif
|
|
|
|
// -- Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _DiffusionProfileAsset;
|
|
float _DiffusionProfileHash;
|
|
float _AlphaCutoff;
|
|
float _AlphaShadowThreshold;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _TilingOffset;
|
|
float4 _HealthyColor;
|
|
float4 _DryColor;
|
|
float _ColorNoiseSpread;
|
|
float4 _NormalMap_TexelSize;
|
|
float _NormalScale;
|
|
float _AORemapMax;
|
|
float _SmoothnessRemapMax;
|
|
float4 _ThicknessMap_TexelSize;
|
|
float _Thickness;
|
|
float _Snow_Amount;
|
|
float4 _SnowBaseColor;
|
|
float3 _SnowColorAdjustment;
|
|
float4 _SnowMaskA_TexelSize;
|
|
float _SnowMaskTreshold;
|
|
float _InvertSnowMask;
|
|
float4 _SnowBaseColorMap_TexelSize;
|
|
float4 _SnowTilingOffset;
|
|
float _SnowBlendHardness;
|
|
float _SnowAORemapMax;
|
|
float _SnowSmoothnessRemapMax;
|
|
float _SnowThickness;
|
|
float _Stiffness;
|
|
float _InitialBend;
|
|
float _Drag;
|
|
float _HeightDrag;
|
|
float4 _NewNormal;
|
|
float4 _EmissionColor;
|
|
float _UseShadowThreshold;
|
|
float4 _DoubleSidedConstants;
|
|
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
|
|
float _BlendMode;
|
|
float _EnableBlendModePreserveSpecularLighting;
|
|
float _RayTracing;
|
|
float _RefractionModel;
|
|
float _MaterialID;
|
|
float _MaterialTypeMask;
|
|
CBUFFER_END
|
|
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat);
|
|
float4x4 WIND_SETTINGS_Points;
|
|
float4 WIND_SETTINGS_Points_Radius;
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_NormalMap);
|
|
SAMPLER(sampler_NormalMap);
|
|
TEXTURE2D(_ThicknessMap);
|
|
SAMPLER(sampler_ThicknessMap);
|
|
TEXTURE2D(_SnowMaskA);
|
|
SAMPLER(sampler_SnowMaskA);
|
|
TEXTURE2D(_SnowBaseColorMap);
|
|
SAMPLER(sampler_SnowBaseColorMap);
|
|
TEXTURE2D(WIND_SETTINGS_TexNoise);
|
|
SAMPLER(samplerWIND_SETTINGS_TexNoise);
|
|
float4 WIND_SETTINGS_TexNoise_TexelSize;
|
|
TEXTURE2D(WIND_SETTINGS_TexGust);
|
|
SAMPLER(samplerWIND_SETTINGS_TexGust);
|
|
float4 WIND_SETTINGS_TexGust_TexelSize;
|
|
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
|
|
float WIND_SETTINGS_FlexNoiseScale;
|
|
float WIND_SETTINGS_ShiverNoiseScale;
|
|
float WIND_SETTINGS_Turbulence;
|
|
float WIND_SETTINGS_GustSpeed;
|
|
float WIND_SETTINGS_GustScale;
|
|
float WIND_SETTINGS_GustWorldScale;
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingMacros.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracingLightLoop.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingIntersection.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingLightCluster.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitPathTracing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingCommon.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 WorldSpaceNormal;
|
|
float3 TangentSpaceNormal;
|
|
float3 AbsoluteWorldSpacePosition;
|
|
float4 uv0;
|
|
};
|
|
|
|
//Interpolator Packs: <None>
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out float2 Out)
|
|
{
|
|
Out = UV * Tiling + Offset;
|
|
}
|
|
|
|
float Unity_SimpleNoise_ValueNoise_LegacySine_float (float2 uv)
|
|
{
|
|
float2 i = floor(uv);
|
|
float2 f = frac(uv);
|
|
f = f * f * (3.0 - 2.0 * f);
|
|
uv = abs(frac(uv) - 0.5);
|
|
float2 c0 = i + float2(0.0, 0.0);
|
|
float2 c1 = i + float2(1.0, 0.0);
|
|
float2 c2 = i + float2(0.0, 1.0);
|
|
float2 c3 = i + float2(1.0, 1.0);
|
|
float r0; Hash_LegacySine_2_1_float(c0, r0);
|
|
float r1; Hash_LegacySine_2_1_float(c1, r1);
|
|
float r2; Hash_LegacySine_2_1_float(c2, r2);
|
|
float r3; Hash_LegacySine_2_1_float(c3, r3);
|
|
float bottomOfGrid = lerp(r0, r1, f.x);
|
|
float topOfGrid = lerp(r2, r3, f.x);
|
|
float t = lerp(bottomOfGrid, topOfGrid, f.y);
|
|
return t;
|
|
}
|
|
|
|
void Unity_SimpleNoise_LegacySine_float(float2 UV, float Scale, out float Out)
|
|
{
|
|
float freq, amp;
|
|
Out = 0.0f;
|
|
freq = pow(2.0, float(0));
|
|
amp = pow(0.5, float(3-0));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(1));
|
|
amp = pow(0.5, float(3-1));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
freq = pow(2.0, float(2));
|
|
amp = pow(0.5, float(3-2));
|
|
Out += Unity_SimpleNoise_ValueNoise_LegacySine_float(float2(UV.xy*(Scale/freq)))*amp;
|
|
}
|
|
|
|
void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Multiply_float3_float3(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_NormalBlend_float(float3 A, float3 B, out float3 Out)
|
|
{
|
|
Out = SafeNormalize(float3(A.rg + B.rg, A.b * B.b));
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Saturate_float(float In, out float Out)
|
|
{
|
|
Out = saturate(In);
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Branch_float(float Predicate, float True, float False, out float Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_Lerp_float(float A, float B, float T, out float Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Absolute_float(float In, out float Out)
|
|
{
|
|
Out = abs(In);
|
|
}
|
|
|
|
void Unity_Divide_float(float A, float B, out float Out)
|
|
{
|
|
Out = A / B;
|
|
}
|
|
|
|
void Unity_Power_float(float A, float B, out float Out)
|
|
{
|
|
Out = pow(A, B);
|
|
}
|
|
|
|
void Unity_Lerp_float3(float3 A, float3 B, float3 T, out float3 Out)
|
|
{
|
|
Out = lerp(A, B, T);
|
|
}
|
|
|
|
void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, out float3 RGB, out float2 RG)
|
|
{
|
|
RGBA = float4(R, G, B, A);
|
|
RGB = float3(R, G, B);
|
|
RG = float2(R, G);
|
|
}
|
|
|
|
// Graph Vertex
|
|
// GraphVertex: <None>
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
float AlphaClipThresholdShadow;
|
|
float3 BentNormal;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float3 NormalTS;
|
|
float TransmissionMask;
|
|
float Thickness;
|
|
float DiffusionProfileHash;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_BaseColorMap);
|
|
float4 _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4 = _TilingOffset;
|
|
float _Split_60538633130155809820b3185c81057f_R_1_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[0];
|
|
float _Split_60538633130155809820b3185c81057f_G_2_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[1];
|
|
float _Split_60538633130155809820b3185c81057f_B_3_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[2];
|
|
float _Split_60538633130155809820b3185c81057f_A_4_Float = _Property_8ec0d512145619859d288abab740e3bf_Out_0_Vector4[3];
|
|
float2 _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_R_1_Float, _Split_60538633130155809820b3185c81057f_G_2_Float);
|
|
float2 _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2 = float2(_Split_60538633130155809820b3185c81057f_B_3_Float, _Split_60538633130155809820b3185c81057f_A_4_Float);
|
|
float2 _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_d05cf9ff645083819bfe42bb3110993f_Out_0_Vector2, _Vector2_b825adf0744b8683b0b84289b95ae6a3_Out_0_Vector2, _TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2);
|
|
float4 _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.tex, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.samplerstate, _Property_821e07b38fd0a08d85c4dd6e5b6bbac9_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_R_4_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_G_5_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_B_6_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4.a;
|
|
float4 _Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4 = _DryColor;
|
|
float4 _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4 = _HealthyColor;
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float = IN.AbsoluteWorldSpacePosition[0];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_G_2_Float = IN.AbsoluteWorldSpacePosition[1];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float = IN.AbsoluteWorldSpacePosition[2];
|
|
float _Split_4d2d8949f64f4488bd87f8f404a2e214_A_4_Float = 0;
|
|
float2 _Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2 = float2(_Split_4d2d8949f64f4488bd87f8f404a2e214_R_1_Float, _Split_4d2d8949f64f4488bd87f8f404a2e214_B_3_Float);
|
|
float _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float = _ColorNoiseSpread;
|
|
float _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float;
|
|
Unity_SimpleNoise_LegacySine_float(_Vector2_e2d43ac72512bc868a7e069ee0b5de54_Out_0_Vector2, _Property_8ec4e0bf2128f880850a04d1e101bd89_Out_0_Float, _SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float);
|
|
float4 _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4;
|
|
Unity_Lerp_float4(_Property_0adfbadb393cd98e8873fd0c7df0232c_Out_0_Vector4, _Property_a69a130cee4be981800e93392cf44f91_Out_0_Vector4, (_SimpleNoise_96327065e2b0428f83e25f93c7e5a748_Out_2_Float.xxxx), _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4);
|
|
float4 _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_RGBA_0_Vector4, _Lerp_b995ffde83d24283ac272745617fa60c_Out_3_Vector4, _Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4);
|
|
float3 _Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3 = _SnowColorAdjustment;
|
|
UnityTexture2D _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowBaseColorMap);
|
|
float4 _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4 = _SnowTilingOffset;
|
|
float _Split_001d1c5245baf58ebe90614002964d26_R_1_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[0];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_G_2_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[1];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_B_3_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[2];
|
|
float _Split_001d1c5245baf58ebe90614002964d26_A_4_Float = _Property_59b77ed09687698c9df9fb89f035d486_Out_0_Vector4[3];
|
|
float2 _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_R_1_Float, _Split_001d1c5245baf58ebe90614002964d26_G_2_Float);
|
|
float2 _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2 = float2(_Split_001d1c5245baf58ebe90614002964d26_B_3_Float, _Split_001d1c5245baf58ebe90614002964d26_A_4_Float);
|
|
float2 _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2;
|
|
Unity_TilingAndOffset_float(IN.uv0.xy, _Vector2_5efb68e6e5d25f86996699d19d486b09_Out_0_Vector2, _Vector2_6d15ade060711b8f8e0aa3c8bc8cc205_Out_0_Vector2, _TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2);
|
|
float4 _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.tex, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.samplerstate, _Property_61165f3fb64b9581936755d1859a63d1_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_R_4_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_G_5_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_B_6_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_39203901ccf89a86a08fec99a110876a_A_7_Float = _SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4.a;
|
|
float4 _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4 = _SnowBaseColor;
|
|
float4 _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_39203901ccf89a86a08fec99a110876a_RGBA_0_Vector4, _Property_32d68d2fddf38587ba1ce61370606b2e_Out_0_Vector4, _Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4);
|
|
float3 _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3;
|
|
Unity_Multiply_float3_float3(_Property_3fadc14b36b4d78e8d366caa2edfd856_Out_0_Vector3, (_Multiply_92829d5521f28b8aa224d7e561fb811f_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3);
|
|
float _Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float = _Snow_Amount;
|
|
UnityTexture2D _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_NormalMap);
|
|
float4 _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.tex, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.samplerstate, _Property_147b07430832c98eb0a470557ee61c5e_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.rgb = UnpackNormal(_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4);
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_R_4_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_G_5_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_B_6_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_A_7_Float = _SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.a;
|
|
float _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float = _NormalScale;
|
|
float3 _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
Unity_NormalStrength_float((_SampleTexture2D_3a56330a29e2f58a96a29a2135b19cbc_RGBA_0_Vector4.xyz), _Property_72e436a108ad64868e46d548c585c5f3_Out_0_Float, _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3);
|
|
float _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float = _SnowBlendHardness;
|
|
float3 _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3;
|
|
Unity_NormalStrength_float(_NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3, _Property_8816f396674c0186b60e01f66f969b50_Out_0_Float, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3);
|
|
float3 _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3;
|
|
Unity_NormalBlend_float(IN.WorldSpaceNormal, _NormalStrength_9d8ca9195919c888a9c9051e0f1cd4ac_Out_2_Vector3, _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3);
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_R_1_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[0];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[1];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_B_3_Float = _NormalBlend_314889913d199882b8681f97bd38bb33_Out_2_Vector3[2];
|
|
float _Split_2c136f8fce898c8482a32f761d44af70_A_4_Float = 0;
|
|
float _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float;
|
|
Unity_Multiply_float_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, _Split_2c136f8fce898c8482a32f761d44af70_G_2_Float, _Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float);
|
|
float _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_ccab4241c9d12e8b80045e08a204ff3c_Out_2_Float, float(0), float(1), _Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float);
|
|
float _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float;
|
|
Unity_Saturate_float(_Clamp_f4f623e9a4faf28b95511b2f4f43ce90_Out_3_Float, _Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float);
|
|
float _Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean = _InvertSnowMask;
|
|
UnityTexture2D _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_SnowMaskA);
|
|
float4 _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.tex, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.samplerstate, _Property_7b2af7ae4c97ad87944be7cd2bc4eb43_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_e2cf64d8eaaf738db00378287f7940a2_Out_3_Vector2) );
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_R_4_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_G_5_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_B_6_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float = _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_RGBA_0_Vector4.a;
|
|
float _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float;
|
|
Unity_OneMinus_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float);
|
|
float _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float;
|
|
Unity_Branch_float(_Property_0c96ceeb762fe089b37cd048c24b4bd4_Out_0_Boolean, _OneMinus_33210d21f565548892db3c5d99fa493c_Out_1_Float, _SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float);
|
|
float _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float = _SnowMaskTreshold;
|
|
float _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float;
|
|
Unity_Multiply_float_float(_Branch_a79d343ee9439b85ad127ecff1e9eeeb_Out_3_Float, _Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float);
|
|
float _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float;
|
|
Unity_Clamp_float(_Multiply_8ea05ee505b473879cc3d428aa5fa068_Out_2_Float, float(0), float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float);
|
|
float _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float;
|
|
Unity_Lerp_float(_Saturate_0fab541eaa360a858b7c7604461dda3b_Out_1_Float, float(1), _Clamp_1ab2de835f37858a976e4112bf0508d8_Out_3_Float, _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float);
|
|
float _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float;
|
|
Unity_Absolute_float(_SampleTexture2D_4471b6e8ae6601848c2a53c7b80cec02_A_7_Float, _Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float);
|
|
float _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float;
|
|
Unity_Clamp_float(_Property_3d7ab7848156fd84909edbfb21817a22_Out_0_Float, float(0.1), float(2), _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float);
|
|
float _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float;
|
|
Unity_Divide_float(_Property_eb2225b08d958e8e9e7300781864539e_Out_0_Float, _Clamp_f433cc74576f1d8890d846f1166270ec_Out_3_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float);
|
|
float _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float;
|
|
Unity_Power_float(_Absolute_1a6a4f45ee322484b000148d3af417ff_Out_1_Float, _Divide_e3927f8e1e0b4b83baccb9bb1cc0e752_Out_2_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float);
|
|
float _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float;
|
|
Unity_Lerp_float(float(0), _Lerp_a5e9aa1fb6bab9849b7130615a95a612_Out_3_Float, _Power_0ae03a3181d57f83ab44688acf9929b1_Out_2_Float, _Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float);
|
|
float3 _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
Unity_Lerp_float3((_Multiply_7440911fa0e24984a93265bf47ed64a5_Out_2_Vector4.xyz), _Multiply_2af8ddf0df570c83b5ed98d2970bef73_Out_2_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3);
|
|
float _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float = _AlphaCutoff;
|
|
float _Property_eb89e776222246569c6855424ed37253_Out_0_Float = _AlphaShadowThreshold;
|
|
UnityTexture2D _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D = UnityBuildTexture2DStructNoScale(_ThicknessMap);
|
|
float4 _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(_Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.tex, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.samplerstate, _Property_034553de686b128785dfbe264a0d7e8d_Out_0_Texture2D.GetTransformedUV(_TilingAndOffset_a2e0bda8e800d280b7064fc016a7e6cd_Out_3_Vector2) );
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_R_4_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.r;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_G_5_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.g;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_B_6_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.b;
|
|
float _SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float = _SampleTexture2D_d3479e9137803c8196660d7321b54d04_RGBA_0_Vector4.a;
|
|
float _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float = _Thickness;
|
|
float _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float;
|
|
Unity_Multiply_float_float(_SampleTexture2D_d3479e9137803c8196660d7321b54d04_A_7_Float, _Property_2fa2ab76399ae48aaf1180768279e6b9_Out_0_Float, _Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float);
|
|
float _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float = _SmoothnessRemapMax;
|
|
float _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float = _AORemapMax;
|
|
float4 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4;
|
|
float3 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3;
|
|
float2 _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2;
|
|
Unity_Combine_float(_Multiply_fd4defbd3562bb8cb6ca05f427c76103_Out_2_Float, _Property_0edea7916ed7a189a62b0faf2c274601_Out_0_Float, _Property_48e1c5285b48c78e8af19e38f4bd77f9_Out_0_Float, float(0), _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGBA_4_Vector4, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_dbef3617e5e47d8181221fd59c92bd9f_RG_6_Vector2);
|
|
float _Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float = _SnowThickness;
|
|
float _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float = _SnowSmoothnessRemapMax;
|
|
float _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float = _SnowAORemapMax;
|
|
float4 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4;
|
|
float3 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3;
|
|
float2 _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2;
|
|
Unity_Combine_float(_Property_3050dd4c95fdb7868e07ef46726a04f5_Out_0_Float, _Property_770aedf7f9661284be3b795bc1f86a09_Out_0_Float, _Property_867b470c8ff2f88fa7afc5a970d457bb_Out_0_Float, float(0), _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGBA_4_Vector4, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RG_6_Vector2);
|
|
float3 _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3;
|
|
Unity_Lerp_float3(_Combine_dbef3617e5e47d8181221fd59c92bd9f_RGB_5_Vector3, _Combine_f9e06f6dadcf4689885c2dac9ec9a391_RGB_5_Vector3, (_Lerp_d1a5aa42847f468aa1b8c51a7700a6a5_Out_3_Float.xxx), _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3);
|
|
float _Split_67a5184356745d8588547536b16bda51_R_1_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[0];
|
|
float _Split_67a5184356745d8588547536b16bda51_G_2_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[1];
|
|
float _Split_67a5184356745d8588547536b16bda51_B_3_Float = _Lerp_62372f9acf66ad8e8d692cbed236d551_Out_3_Vector3[2];
|
|
float _Split_67a5184356745d8588547536b16bda51_A_4_Float = 0;
|
|
surface.BaseColor = _Lerp_22f4cecc800e5c8485a02259bfeb34ea_Out_3_Vector3;
|
|
surface.Emission = float3(0, 0, 0);
|
|
surface.Alpha = _SampleTexture2D_91f1784012cdb683a2ab7a12fc14c94d_A_7_Float;
|
|
surface.AlphaClipThreshold = _Property_067d68a770a25e8f978ca090306a96d8_Out_0_Float;
|
|
surface.AlphaClipThresholdShadow = _Property_eb89e776222246569c6855424ed37253_Out_0_Float;
|
|
surface.BentNormal = IN.TangentSpaceNormal;
|
|
surface.Smoothness = _Split_67a5184356745d8588547536b16bda51_G_2_Float;
|
|
surface.Occlusion = _Split_67a5184356745d8588547536b16bda51_B_3_Float;
|
|
surface.NormalTS = _NormalStrength_366affc5c8b42482a633d201ef52b9d6_Out_2_Vector3;
|
|
surface.TransmissionMask = float(1);
|
|
surface.Thickness = _Split_67a5184356745d8588547536b16bda51_R_1_Float;
|
|
surface.DiffusionProfileHash = _DiffusionProfileHash;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES AttributesMesh
|
|
#define VaryingsMeshType VaryingsMeshToPS
|
|
#define VFX_SRP_VARYINGS VaryingsMeshType
|
|
#define VFX_SRP_SURFACE_INPUTS FragInputs
|
|
#endif
|
|
SurfaceDescriptionInputs FragInputsToSurfaceDescriptionInputs(FragInputs input, float3 viewWS)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
output.WorldSpaceNormal = normalize(input.tangentToWorld[2].xyz);
|
|
#if defined(SHADER_STAGE_RAY_TRACING)
|
|
#else
|
|
#endif
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
output.AbsoluteWorldSpacePosition = GetAbsolutePositionWS(input.positionRWS);
|
|
|
|
#if UNITY_UV_STARTS_AT_TOP
|
|
#else
|
|
#endif
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
|
|
// splice point to copy frag inputs custom interpolator pack into the SDI
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorCopyToSDI' */
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Surface Data (Specific Material)
|
|
|
|
void ApplyDecalToSurfaceDataNoNormal(DecalSurfaceData decalSurfaceData, inout SurfaceData surfaceData);
|
|
|
|
void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, SurfaceDescription surfaceDescription,
|
|
inout SurfaceData surfaceData)
|
|
{
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
#ifdef DECAL_NORMAL_BLENDING
|
|
// SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert
|
|
// the normal to gradient before applying the decal. We then have to resolve the gradient back to world space
|
|
float3 normalTS;
|
|
|
|
normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(surfaceDescription.NormalTS,
|
|
fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]);
|
|
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
|
|
GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
#else
|
|
// normal delivered to master node
|
|
GetNormalWS(fragInputs, surfaceDescription.NormalTS, surfaceData.normalWS, doubleSidedConstants);
|
|
|
|
#if HAVE_DECALS
|
|
if (_EnableDecals)
|
|
{
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Both uses and modifies 'surfaceData.normalWS'.
|
|
DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha);
|
|
ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz);
|
|
ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
void BuildSurfaceData(FragInputs fragInputs, inout SurfaceDescription surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS)
|
|
{
|
|
ZERO_INITIALIZE(SurfaceData, surfaceData);
|
|
|
|
// specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct
|
|
// however specularOcclusion can come from the graph, so need to be init here so it can be override.
|
|
surfaceData.specularOcclusion = 1.0;
|
|
surfaceData.thickness = 0.0;
|
|
|
|
surfaceData.baseColor = surfaceDescription.BaseColor;
|
|
surfaceData.perceptualSmoothness = surfaceDescription.Smoothness;
|
|
surfaceData.ambientOcclusion = surfaceDescription.Occlusion;
|
|
surfaceData.transmissionMask = surfaceDescription.TransmissionMask.xxx;
|
|
surfaceData.thickness = surfaceDescription.Thickness;
|
|
surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash);
|
|
|
|
#if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN)
|
|
if (_EnableSSRefraction)
|
|
{
|
|
|
|
surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha);
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
else
|
|
{
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
surfaceDescription.Alpha = 1.0;
|
|
}
|
|
#else
|
|
surfaceData.ior = 1.0;
|
|
surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0);
|
|
surfaceData.atDistance = 1.0;
|
|
surfaceData.transmittanceMask = 0.0;
|
|
#endif
|
|
|
|
// These static material feature allow compile time optimization
|
|
surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD;
|
|
#ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_COLORED_TRANSMISSION
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION;
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_COLORED_TRANSMISSION;
|
|
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_ANISOTROPY
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY;
|
|
|
|
// Initialize the normal to something non-zero to avoid a div-zero warning for anisotropy.
|
|
surfaceData.normalWS = float3(0, 1, 0);
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_IRIDESCENCE
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_SPECULAR_COLOR
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR;
|
|
#endif
|
|
|
|
#ifdef _MATERIAL_FEATURE_CLEAR_COAT
|
|
surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT;
|
|
#endif
|
|
|
|
#if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR)
|
|
// Require to have setup baseColor
|
|
// Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it
|
|
surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b));
|
|
#endif
|
|
|
|
float3 doubleSidedConstants = GetDoubleSidedConstants();
|
|
|
|
ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, surfaceData);
|
|
|
|
surfaceData.geomNormalWS = fragInputs.tangentToWorld[2];
|
|
|
|
surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT
|
|
|
|
|
|
bentNormalWS = surfaceData.normalWS;
|
|
|
|
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
// Mipmap mode debugging isn't supported with ray tracing as it relies on derivatives
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD0
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG(posInput.positionSS, fragInputs.texCoord0);
|
|
#else
|
|
surfaceData.baseColor = GET_TEXTURE_STREAMING_DEBUG_NO_UV(posInput.positionSS);
|
|
#endif
|
|
surfaceData.metallic = 0;
|
|
}
|
|
#endif
|
|
|
|
// We need to call ApplyDebugToSurfaceData after filling the surfaceData and before filling builtinData
|
|
// as it can modify attribute use for static lighting
|
|
ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData);
|
|
#endif
|
|
|
|
// By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion.
|
|
// If user provide bent normal then we process a better term
|
|
#if defined(_SPECULAR_OCCLUSION_CUSTOM)
|
|
// Just use the value passed through via the slot (not active otherwise)
|
|
#elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL)
|
|
// If we have bent normal and ambient occlusion, process a specular occlusion
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness));
|
|
#elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO)
|
|
surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness));
|
|
#endif
|
|
|
|
#if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING)
|
|
surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold);
|
|
#endif
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Get Surface And BuiltinData
|
|
|
|
void GetSurfaceAndBuiltinData(FragInputs fragInputs, float3 V, inout PositionInputs posInput, out SurfaceData surfaceData, out BuiltinData builtinData RAY_TRACING_OPTIONAL_PARAMETERS)
|
|
{
|
|
// Don't dither if displaced tessellation (we're fading out the displacement instead to match the next LOD)
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT)
|
|
#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group
|
|
LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
#ifdef _DOUBLESIDED_ON
|
|
float3 doubleSidedConstants = _DoubleSidedConstants.xyz;
|
|
#else
|
|
float3 doubleSidedConstants = float3(1.0, 1.0, 1.0);
|
|
#endif
|
|
|
|
ApplyDoubleSidedFlipOrMirror(fragInputs, doubleSidedConstants); // Apply double sided flip on the vertex normal
|
|
#endif // SHADER_UNLIT
|
|
|
|
SurfaceDescriptionInputs surfaceDescriptionInputs = FragInputsToSurfaceDescriptionInputs(fragInputs, V);
|
|
|
|
#if defined(HAVE_VFX_MODIFICATION)
|
|
GraphProperties properties;
|
|
ZERO_INITIALIZE(GraphProperties, properties);
|
|
|
|
GetElementPixelProperties(fragInputs, properties);
|
|
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs, properties);
|
|
#else
|
|
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
|
|
#endif
|
|
|
|
#ifdef DEBUG_DISPLAY
|
|
if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE)
|
|
{
|
|
surfaceDescription.Alpha = 1.0f;
|
|
}
|
|
#endif
|
|
|
|
// Perform alpha test very early to save performance (a killed pixel will not sample textures)
|
|
// TODO: split graph evaluation to grab just alpha dependencies first? tricky..
|
|
#ifdef _ALPHATEST_ON
|
|
float alphaCutoff = surfaceDescription.AlphaClipThreshold;
|
|
#if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS
|
|
// The TransparentDepthPrepass is also used with SSR transparent.
|
|
// If an artists enable transaprent SSR but not the TransparentDepthPrepass itself, then we use AlphaClipThreshold
|
|
// otherwise if TransparentDepthPrepass is enabled we use AlphaClipThresholdDepthPrepass
|
|
#elif SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_POSTPASS
|
|
// DepthPostpass always use its own alpha threshold
|
|
alphaCutoff = surfaceDescription.AlphaClipThresholdDepthPostpass;
|
|
#elif (SHADERPASS == SHADERPASS_SHADOWS) || (SHADERPASS == SHADERPASS_RAYTRACING_VISIBILITY)
|
|
// If use shadow threshold isn't enable we don't allow any test
|
|
#endif
|
|
|
|
GENERIC_ALPHA_TEST(surfaceDescription.Alpha, alphaCutoff);
|
|
#endif
|
|
|
|
#if !defined(SHADER_STAGE_RAY_TRACING) && _DEPTHOFFSET_ON
|
|
ApplyDepthOffsetPositionInput(V, surfaceDescription.DepthOffset, GetViewForwardDir(), GetWorldToHClipMatrix(), posInput);
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
float3 bentNormalWS;
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData, bentNormalWS);
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD1
|
|
float4 lightmapTexCoord1 = fragInputs.texCoord1;
|
|
#else
|
|
float4 lightmapTexCoord1 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
#ifdef FRAG_INPUTS_USE_TEXCOORD2
|
|
float4 lightmapTexCoord2 = fragInputs.texCoord2;
|
|
#else
|
|
float4 lightmapTexCoord2 = float4(0,0,0,0);
|
|
#endif
|
|
|
|
float alpha = 1.0;
|
|
alpha = surfaceDescription.Alpha;
|
|
|
|
// Builtin Data
|
|
// For back lighting we use the oposite vertex normal
|
|
InitBuiltinData(posInput, alpha, bentNormalWS, -fragInputs.tangentToWorld[2], lightmapTexCoord1, lightmapTexCoord2, builtinData);
|
|
|
|
#else
|
|
BuildSurfaceData(fragInputs, surfaceDescription, V, posInput, surfaceData);
|
|
|
|
ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting
|
|
builtinData.opacity = surfaceDescription.Alpha;
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
// Light Layers are currently not used for the Unlit shader (because it is not lit)
|
|
// But Unlit objects do cast shadows according to their rendering layer mask, which is what we want to
|
|
// display in the light layers visualization mode, therefore we need the renderingLayers
|
|
builtinData.renderingLayers = GetMeshRenderingLayerMask();
|
|
#endif
|
|
|
|
#endif // SHADER_UNLIT
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
// Used for sharpening by alpha to mask - Alpha to covertage is only used with depth only and forward pass (no shadow pass, no transparent pass)
|
|
builtinData.alphaClipTreshold = alphaCutoff;
|
|
#endif
|
|
|
|
// override sampleBakedGI - not used by Unlit
|
|
// When overriding GI, we need to force the isLightmap flag to make sure we don't add APV (sampled in the lightloop) on top of the overridden value (set at GBuffer stage)
|
|
|
|
builtinData.emissiveColor = surfaceDescription.Emission;
|
|
|
|
// Note this will not fully work on transparent surfaces (can check with _SURFACE_TYPE_TRANSPARENT define)
|
|
// We will always overwrite vt feeback with the nearest. So behind transparent surfaces vt will not be resolved
|
|
// This is a limitation of the current MRT approach.
|
|
#ifdef UNITY_VIRTUAL_TEXTURING
|
|
#endif
|
|
|
|
#if _DEPTHOFFSET_ON
|
|
builtinData.depthOffset = surfaceDescription.DepthOffset;
|
|
#endif
|
|
|
|
// TODO: We should generate distortion / distortionBlur for non distortion pass
|
|
#if (SHADERPASS == SHADERPASS_DISTORTION)
|
|
builtinData.distortion = surfaceDescription.Distortion;
|
|
builtinData.distortionBlur = surfaceDescription.DistortionBlur;
|
|
#endif
|
|
|
|
#ifndef SHADER_UNLIT
|
|
// PostInitBuiltinData call ApplyDebugToBuiltinData
|
|
PostInitBuiltinData(V, posInput, surfaceData, builtinData);
|
|
#else
|
|
ApplyDebugToBuiltinData(builtinData);
|
|
#endif
|
|
|
|
RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassPathTracing.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#if !defined(SHADER_STAGE_RAY_TRACING)
|
|
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#else
|
|
#endif
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
CustomEditor "UnityEditor.ShaderGraph.GenericShaderGraphMaterialGUI"
|
|
CustomEditorForRenderPipeline "Rendering.HighDefinition.LitShaderGraphGUI" "UnityEngine.Rendering.HighDefinition.HDRenderPipelineAsset"
|
|
FallBack "Hidden/Shader Graph/FallbackError"
|
|
} |