6609 lines
287 KiB
GLSL
6609 lines
287 KiB
GLSL
Shader "NatureManufacture/URP/Lit/Glass Simple"
|
|
{
|
|
Properties
|
|
{
|
|
_AlphaCutoff("Alpha Cutoff", Range(0, 1)) = 0
|
|
_BaseColor("Base Color", Color) = (1, 1, 1, 0)
|
|
_BaseColorMap("Base Map", 2D) = "white" {}
|
|
_BaseTilingOffset("Base Tiling and Offset", Vector) = (1, 1, 0, 0)
|
|
[Normal]_BaseNormalMap("Base Normal Map", 2D) = "bump" {}
|
|
_BaseNormalScale("Base Normal Scale", Range(0, 8)) = 1
|
|
_BaseMaskMap("Base Mask Map MT(R) AO(G) SM(A)", 2D) = "white" {}
|
|
_BaseMetallic("Base Metallic", Range(0, 1)) = 1
|
|
_BaseAORemapMin("Base AO Remap Min", Range(0, 1)) = 0
|
|
_BaseAORemapMax("Base AO Remap Max", Range(0, 1)) = 1
|
|
_BaseSmoothnessRemapMin("Base Smoothness Remap Min", Range(0, 1)) = 0
|
|
_BaseSmoothnessRemapMax("Base Smoothness Remap Max", Range(0, 1)) = 1
|
|
_Thickness_R("Thickness (R)", 2D) = "white" {}
|
|
_ThicknessRemapMin("Thickness Remap Min", Float) = 0
|
|
_ThicknessRemapMax("Thickness Remap Max", Float) = 1
|
|
[HDR]_ThicknessEmission("Thickness Emission", Color) = (0, 0, 0, 0)
|
|
[HideInInspector]_WorkflowMode("_WorkflowMode", Float) = 1
|
|
[HideInInspector]_CastShadows("_CastShadows", Float) = 1
|
|
[HideInInspector]_ReceiveShadows("_ReceiveShadows", Float) = 1
|
|
[HideInInspector]_Surface("_Surface", Float) = 0
|
|
[HideInInspector]_Blend("_Blend", Float) = 0
|
|
[HideInInspector]_AlphaClip("_AlphaClip", Float) = 1
|
|
[HideInInspector]_SrcBlend("_SrcBlend", Float) = 1
|
|
[HideInInspector]_DstBlend("_DstBlend", Float) = 0
|
|
[HideInInspector][ToggleUI]_ZWrite("_ZWrite", Float) = 1
|
|
[HideInInspector]_ZWriteControl("_ZWriteControl", Float) = 0
|
|
[HideInInspector]_ZTest("_ZTest", Float) = 4
|
|
[HideInInspector]_Cull("_Cull", Float) = 2
|
|
[HideInInspector]_QueueOffset("_QueueOffset", Float) = 0
|
|
[HideInInspector]_QueueControl("_QueueControl", 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"="UniversalPipeline"
|
|
"RenderType"="Opaque"
|
|
"UniversalMaterialType" = "Lit"
|
|
"Queue"="AlphaTest"
|
|
"ShaderGraphShader"="true"
|
|
"ShaderGraphTargetId"="UniversalLitSubTarget"
|
|
}
|
|
Pass
|
|
{
|
|
Name "Universal Forward"
|
|
Tags
|
|
{
|
|
"LightMode" = "UniversalForward"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
Blend [_SrcBlend] [_DstBlend]
|
|
ZTest [_ZTest]
|
|
ZWrite [_ZWrite]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 4.5
|
|
#pragma exclude_renderers gles gles3 glcore
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile_fog
|
|
#pragma instancing_options renderinglayer
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
|
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
|
|
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
|
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
|
|
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
|
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT
|
|
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
|
|
#pragma multi_compile _ SHADOWS_SHADOWMASK
|
|
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
|
|
#pragma multi_compile_fragment _ _LIGHT_LAYERS
|
|
#pragma multi_compile_fragment _ DEBUG_DISPLAY
|
|
#pragma multi_compile_fragment _ _LIGHT_COOKIES
|
|
#pragma multi_compile _ _CLUSTERED_RENDERING
|
|
#pragma shader_feature_fragment _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local_fragment _ _ALPHAPREMULTIPLY_ON
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
#pragma shader_feature_local_fragment _ _SPECULAR_SETUP
|
|
#pragma shader_feature_local _ _RECEIVE_SHADOWS_OFF
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#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_NORMAL_WS
|
|
#define VARYINGS_NEED_TANGENT_WS
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_VIEWDIRECTION_WS
|
|
#define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT
|
|
#define VARYINGS_NEED_SHADOW_COORD
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_FORWARD
|
|
#define _FOG_FRAGMENT 1
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 uv1 : TEXCOORD1;
|
|
float4 uv2 : TEXCOORD2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float3 positionWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
float3 viewDirectionWS;
|
|
#if defined(LIGHTMAP_ON)
|
|
float2 staticLightmapUV;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
float2 dynamicLightmapUV;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
float3 sh;
|
|
#endif
|
|
float4 fogFactorAndVertexLight;
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
float4 shadowCoord;
|
|
#endif
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 TangentSpaceNormal;
|
|
float4 uv0;
|
|
float FaceSign;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
#if defined(LIGHTMAP_ON)
|
|
float2 staticLightmapUV : INTERP0;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
float2 dynamicLightmapUV : INTERP1;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
float3 sh : INTERP2;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
float4 shadowCoord : INTERP3;
|
|
#endif
|
|
float4 tangentWS : INTERP4;
|
|
float4 texCoord0 : INTERP5;
|
|
float4 fogFactorAndVertexLight : INTERP6;
|
|
float3 positionWS : INTERP7;
|
|
float3 normalWS : INTERP8;
|
|
float3 viewDirectionWS : INTERP9;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
#if defined(LIGHTMAP_ON)
|
|
output.staticLightmapUV = input.staticLightmapUV;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
output.dynamicLightmapUV = input.dynamicLightmapUV;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
output.sh = input.sh;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
output.shadowCoord = input.shadowCoord;
|
|
#endif
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.fogFactorAndVertexLight.xyzw = input.fogFactorAndVertexLight;
|
|
output.positionWS.xyz = input.positionWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
output.viewDirectionWS.xyz = input.viewDirectionWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
#if defined(LIGHTMAP_ON)
|
|
output.staticLightmapUV = input.staticLightmapUV;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
output.dynamicLightmapUV = input.dynamicLightmapUV;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
output.sh = input.sh;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
output.shadowCoord = input.shadowCoord;
|
|
#endif
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.fogFactorAndVertexLight = input.fogFactorAndVertexLight.xyzw;
|
|
output.positionWS = input.positionWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
output.viewDirectionWS = input.viewDirectionWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Flip_float4(float4 In, float4 Flip, out float4 Out)
|
|
{
|
|
Out = (Flip * -2 + 1) * In;
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Remap_float(float In, float2 InMinMax, float2 OutMinMax, out float Out)
|
|
{
|
|
Out = OutMinMax.x + (In - InMinMax.x) * (OutMinMax.y - OutMinMax.x) / (InMinMax.y - InMinMax.x);
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 NormalTS;
|
|
float3 Emission;
|
|
float Metallic;
|
|
float3 Specular;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float4 _Property_13c79aaf332e20868551d934a2cb7112_Out_0 = _BaseColor;
|
|
float4 _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Property_13c79aaf332e20868551d934a2cb7112_Out_0, _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2);
|
|
float _IsFrontFace_d1836594a20c48b6800447231077d6d1_Out_0 = max(0, IN.FaceSign.x);
|
|
UnityTexture2D _Property_2cc39234d3d334899f94126a216a50fc_Out_0 = UnityBuildTexture2DStruct(_BaseNormalMap);
|
|
float4 _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0 = SAMPLE_TEXTURE2D(_Property_2cc39234d3d334899f94126a216a50fc_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_2cc39234d3d334899f94126a216a50fc_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.rgb = UnpackNormal(_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0);
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_R_4 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.r;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_G_5 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.g;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_B_6 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.b;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_A_7 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.a;
|
|
float4 _Flip_ad2e81eb126b4980b556fe6096221327_Out_1;
|
|
float4 _Flip_ad2e81eb126b4980b556fe6096221327_Flip = float4 (0, 0, 1, 0);
|
|
Unity_Flip_float4(_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0, _Flip_ad2e81eb126b4980b556fe6096221327_Flip, _Flip_ad2e81eb126b4980b556fe6096221327_Out_1);
|
|
float4 _Branch_bbac7b39053c4c458462473fe9b2547c_Out_3;
|
|
Unity_Branch_float4(_IsFrontFace_d1836594a20c48b6800447231077d6d1_Out_0, _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0, _Flip_ad2e81eb126b4980b556fe6096221327_Out_1, _Branch_bbac7b39053c4c458462473fe9b2547c_Out_3);
|
|
float _Property_020d569f63e9a2849e23988ff74eb005_Out_0 = _BaseNormalScale;
|
|
float3 _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2;
|
|
Unity_NormalStrength_float((_Branch_bbac7b39053c4c458462473fe9b2547c_Out_3.xyz), _Property_020d569f63e9a2849e23988ff74eb005_Out_0, _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2);
|
|
UnityTexture2D _Property_c21bbe1e3db54c649a486b8387c29596_Out_0 = UnityBuildTexture2DStruct(_Thickness_R);
|
|
float4 _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0 = SAMPLE_TEXTURE2D(_Property_c21bbe1e3db54c649a486b8387c29596_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_c21bbe1e3db54c649a486b8387c29596_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_R_4 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.r;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_G_5 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.g;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_B_6 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.b;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_A_7 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.a;
|
|
float _OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1;
|
|
Unity_OneMinus_float(_SampleTexture2D_d87c1205d6154680b17a62917b983db1_R_4, _OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1);
|
|
float _Property_6624e4d17da343f4a8d3a35d8e2ebdd7_Out_0 = _ThicknessRemapMin;
|
|
float _Property_d949f8475c904fc1bc96971c0cf89327_Out_0 = _ThicknessRemapMax;
|
|
float2 _Vector2_a9da78da855f4aa191367996e4d5149b_Out_0 = float2(_Property_6624e4d17da343f4a8d3a35d8e2ebdd7_Out_0, _Property_d949f8475c904fc1bc96971c0cf89327_Out_0);
|
|
float _Remap_f4a9fca065054bffb86029e2dfb67271_Out_3;
|
|
Unity_Remap_float(_OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1, float2 (0, 1), _Vector2_a9da78da855f4aa191367996e4d5149b_Out_0, _Remap_f4a9fca065054bffb86029e2dfb67271_Out_3);
|
|
float _Clamp_79d501cf18b549c3bea0719045cead9a_Out_3;
|
|
Unity_Clamp_float(_Remap_f4a9fca065054bffb86029e2dfb67271_Out_3, 0, 1, _Clamp_79d501cf18b549c3bea0719045cead9a_Out_3);
|
|
float4 _Property_073a7da1f931476aa698dadb5e286d1c_Out_0 = IsGammaSpace() ? LinearToSRGB(_ThicknessEmission) : _ThicknessEmission;
|
|
float4 _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2;
|
|
Unity_Multiply_float4_float4((_Clamp_79d501cf18b549c3bea0719045cead9a_Out_3.xxxx), _Property_073a7da1f931476aa698dadb5e286d1c_Out_0, _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2);
|
|
float4 _Multiply_3087173cba0b465ab00f35541d643281_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2, _Multiply_3087173cba0b465ab00f35541d643281_Out_2);
|
|
UnityTexture2D _Property_a1adaaa2a22b0e829756ccb08eab9146_Out_0 = UnityBuildTexture2DStruct(_BaseMaskMap);
|
|
float4 _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0 = SAMPLE_TEXTURE2D(_Property_a1adaaa2a22b0e829756ccb08eab9146_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_a1adaaa2a22b0e829756ccb08eab9146_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_R_4 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.r;
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_G_5 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.g;
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_B_6 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.b;
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_A_7 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.a;
|
|
float _Property_06c41396a31ba582877d3a10387f69e6_Out_0 = _BaseMetallic;
|
|
float _Multiply_1e8010b400ec9689a4d8570c8fb2dd6e_Out_2;
|
|
Unity_Multiply_float_float(_SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_R_4, _Property_06c41396a31ba582877d3a10387f69e6_Out_0, _Multiply_1e8010b400ec9689a4d8570c8fb2dd6e_Out_2);
|
|
float _Property_2dbdbebc756fb1819344efcc68c07d00_Out_0 = _BaseAORemapMin;
|
|
float _Property_bdc878630dfca586bff66e5b4bfffe30_Out_0 = _BaseAORemapMax;
|
|
float2 _Vector2_7f058afa3dd186869dd0f2d889a637bb_Out_0 = float2(_Property_2dbdbebc756fb1819344efcc68c07d00_Out_0, _Property_bdc878630dfca586bff66e5b4bfffe30_Out_0);
|
|
float _Remap_736c05b9e06ff78597a5b300523c5e04_Out_3;
|
|
Unity_Remap_float(_SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_G_5, float2 (0, 1), _Vector2_7f058afa3dd186869dd0f2d889a637bb_Out_0, _Remap_736c05b9e06ff78597a5b300523c5e04_Out_3);
|
|
float _Property_dbfeaf948b34478090dd8f1a3d0e2440_Out_0 = _BaseSmoothnessRemapMin;
|
|
float _Property_d7d9704f0497d58ea30c73507241d8e4_Out_0 = _BaseSmoothnessRemapMax;
|
|
float2 _Vector2_03bee8a712eb848f9058c9ca67139ff0_Out_0 = float2(_Property_dbfeaf948b34478090dd8f1a3d0e2440_Out_0, _Property_d7d9704f0497d58ea30c73507241d8e4_Out_0);
|
|
float _Remap_9fa10d7f73353f8d98e7e00ad7887efd_Out_3;
|
|
Unity_Remap_float(_SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_A_7, float2 (0, 1), _Vector2_03bee8a712eb848f9058c9ca67139ff0_Out_0, _Remap_9fa10d7f73353f8d98e7e00ad7887efd_Out_3);
|
|
float3 _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0 = float3(_Multiply_1e8010b400ec9689a4d8570c8fb2dd6e_Out_2, _Remap_736c05b9e06ff78597a5b300523c5e04_Out_3, _Remap_9fa10d7f73353f8d98e7e00ad7887efd_Out_3);
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_R_1 = _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0[0];
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_G_2 = _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0[1];
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_B_3 = _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0[2];
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_A_4 = 0;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.BaseColor = (_Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2.xyz);
|
|
surface.NormalTS = _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2;
|
|
surface.Emission = (_Multiply_3087173cba0b465ab00f35541d643281_Out_2.xyz);
|
|
surface.Metallic = _Split_b9b4ede5ed4eaf82a5409e98b1310654_R_1;
|
|
surface.Specular = IsGammaSpace() ? float3(0.5, 0.5, 0.5) : SRGBToLinear(float3(0.5, 0.5, 0.5));
|
|
surface.Smoothness = _Split_b9b4ede5ed4eaf82a5409e98b1310654_B_3;
|
|
surface.Occlusion = _Split_b9b4ede5ed4eaf82a5409e98b1310654_G_2;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRForwardPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "GBuffer"
|
|
Tags
|
|
{
|
|
"LightMode" = "UniversalGBuffer"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
Blend [_SrcBlend] [_DstBlend]
|
|
ZTest [_ZTest]
|
|
ZWrite [_ZWrite]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 4.5
|
|
#pragma exclude_renderers gles gles3 glcore
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile_fog
|
|
#pragma instancing_options renderinglayer
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
|
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
|
|
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
|
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT
|
|
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
|
|
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
|
|
#pragma multi_compile _ SHADOWS_SHADOWMASK
|
|
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
|
|
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
|
|
#pragma multi_compile_fragment _ _LIGHT_LAYERS
|
|
#pragma multi_compile_fragment _ _RENDER_PASS_ENABLED
|
|
#pragma multi_compile_fragment _ DEBUG_DISPLAY
|
|
#pragma shader_feature_fragment _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local_fragment _ _ALPHAPREMULTIPLY_ON
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
#pragma shader_feature_local_fragment _ _SPECULAR_SETUP
|
|
#pragma shader_feature_local _ _RECEIVE_SHADOWS_OFF
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#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_NORMAL_WS
|
|
#define VARYINGS_NEED_TANGENT_WS
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_VIEWDIRECTION_WS
|
|
#define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT
|
|
#define VARYINGS_NEED_SHADOW_COORD
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_GBUFFER
|
|
#define _FOG_FRAGMENT 1
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 uv1 : TEXCOORD1;
|
|
float4 uv2 : TEXCOORD2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float3 positionWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
float3 viewDirectionWS;
|
|
#if defined(LIGHTMAP_ON)
|
|
float2 staticLightmapUV;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
float2 dynamicLightmapUV;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
float3 sh;
|
|
#endif
|
|
float4 fogFactorAndVertexLight;
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
float4 shadowCoord;
|
|
#endif
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 TangentSpaceNormal;
|
|
float4 uv0;
|
|
float FaceSign;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
#if defined(LIGHTMAP_ON)
|
|
float2 staticLightmapUV : INTERP0;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
float2 dynamicLightmapUV : INTERP1;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
float3 sh : INTERP2;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
float4 shadowCoord : INTERP3;
|
|
#endif
|
|
float4 tangentWS : INTERP4;
|
|
float4 texCoord0 : INTERP5;
|
|
float4 fogFactorAndVertexLight : INTERP6;
|
|
float3 positionWS : INTERP7;
|
|
float3 normalWS : INTERP8;
|
|
float3 viewDirectionWS : INTERP9;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
#if defined(LIGHTMAP_ON)
|
|
output.staticLightmapUV = input.staticLightmapUV;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
output.dynamicLightmapUV = input.dynamicLightmapUV;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
output.sh = input.sh;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
output.shadowCoord = input.shadowCoord;
|
|
#endif
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.fogFactorAndVertexLight.xyzw = input.fogFactorAndVertexLight;
|
|
output.positionWS.xyz = input.positionWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
output.viewDirectionWS.xyz = input.viewDirectionWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
#if defined(LIGHTMAP_ON)
|
|
output.staticLightmapUV = input.staticLightmapUV;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
output.dynamicLightmapUV = input.dynamicLightmapUV;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
output.sh = input.sh;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
output.shadowCoord = input.shadowCoord;
|
|
#endif
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.fogFactorAndVertexLight = input.fogFactorAndVertexLight.xyzw;
|
|
output.positionWS = input.positionWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
output.viewDirectionWS = input.viewDirectionWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Flip_float4(float4 In, float4 Flip, out float4 Out)
|
|
{
|
|
Out = (Flip * -2 + 1) * In;
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Remap_float(float In, float2 InMinMax, float2 OutMinMax, out float Out)
|
|
{
|
|
Out = OutMinMax.x + (In - InMinMax.x) * (OutMinMax.y - OutMinMax.x) / (InMinMax.y - InMinMax.x);
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 NormalTS;
|
|
float3 Emission;
|
|
float Metallic;
|
|
float3 Specular;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float4 _Property_13c79aaf332e20868551d934a2cb7112_Out_0 = _BaseColor;
|
|
float4 _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Property_13c79aaf332e20868551d934a2cb7112_Out_0, _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2);
|
|
float _IsFrontFace_d1836594a20c48b6800447231077d6d1_Out_0 = max(0, IN.FaceSign.x);
|
|
UnityTexture2D _Property_2cc39234d3d334899f94126a216a50fc_Out_0 = UnityBuildTexture2DStruct(_BaseNormalMap);
|
|
float4 _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0 = SAMPLE_TEXTURE2D(_Property_2cc39234d3d334899f94126a216a50fc_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_2cc39234d3d334899f94126a216a50fc_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.rgb = UnpackNormal(_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0);
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_R_4 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.r;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_G_5 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.g;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_B_6 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.b;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_A_7 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.a;
|
|
float4 _Flip_ad2e81eb126b4980b556fe6096221327_Out_1;
|
|
float4 _Flip_ad2e81eb126b4980b556fe6096221327_Flip = float4 (0, 0, 1, 0);
|
|
Unity_Flip_float4(_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0, _Flip_ad2e81eb126b4980b556fe6096221327_Flip, _Flip_ad2e81eb126b4980b556fe6096221327_Out_1);
|
|
float4 _Branch_bbac7b39053c4c458462473fe9b2547c_Out_3;
|
|
Unity_Branch_float4(_IsFrontFace_d1836594a20c48b6800447231077d6d1_Out_0, _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0, _Flip_ad2e81eb126b4980b556fe6096221327_Out_1, _Branch_bbac7b39053c4c458462473fe9b2547c_Out_3);
|
|
float _Property_020d569f63e9a2849e23988ff74eb005_Out_0 = _BaseNormalScale;
|
|
float3 _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2;
|
|
Unity_NormalStrength_float((_Branch_bbac7b39053c4c458462473fe9b2547c_Out_3.xyz), _Property_020d569f63e9a2849e23988ff74eb005_Out_0, _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2);
|
|
UnityTexture2D _Property_c21bbe1e3db54c649a486b8387c29596_Out_0 = UnityBuildTexture2DStruct(_Thickness_R);
|
|
float4 _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0 = SAMPLE_TEXTURE2D(_Property_c21bbe1e3db54c649a486b8387c29596_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_c21bbe1e3db54c649a486b8387c29596_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_R_4 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.r;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_G_5 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.g;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_B_6 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.b;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_A_7 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.a;
|
|
float _OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1;
|
|
Unity_OneMinus_float(_SampleTexture2D_d87c1205d6154680b17a62917b983db1_R_4, _OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1);
|
|
float _Property_6624e4d17da343f4a8d3a35d8e2ebdd7_Out_0 = _ThicknessRemapMin;
|
|
float _Property_d949f8475c904fc1bc96971c0cf89327_Out_0 = _ThicknessRemapMax;
|
|
float2 _Vector2_a9da78da855f4aa191367996e4d5149b_Out_0 = float2(_Property_6624e4d17da343f4a8d3a35d8e2ebdd7_Out_0, _Property_d949f8475c904fc1bc96971c0cf89327_Out_0);
|
|
float _Remap_f4a9fca065054bffb86029e2dfb67271_Out_3;
|
|
Unity_Remap_float(_OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1, float2 (0, 1), _Vector2_a9da78da855f4aa191367996e4d5149b_Out_0, _Remap_f4a9fca065054bffb86029e2dfb67271_Out_3);
|
|
float _Clamp_79d501cf18b549c3bea0719045cead9a_Out_3;
|
|
Unity_Clamp_float(_Remap_f4a9fca065054bffb86029e2dfb67271_Out_3, 0, 1, _Clamp_79d501cf18b549c3bea0719045cead9a_Out_3);
|
|
float4 _Property_073a7da1f931476aa698dadb5e286d1c_Out_0 = IsGammaSpace() ? LinearToSRGB(_ThicknessEmission) : _ThicknessEmission;
|
|
float4 _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2;
|
|
Unity_Multiply_float4_float4((_Clamp_79d501cf18b549c3bea0719045cead9a_Out_3.xxxx), _Property_073a7da1f931476aa698dadb5e286d1c_Out_0, _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2);
|
|
float4 _Multiply_3087173cba0b465ab00f35541d643281_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2, _Multiply_3087173cba0b465ab00f35541d643281_Out_2);
|
|
UnityTexture2D _Property_a1adaaa2a22b0e829756ccb08eab9146_Out_0 = UnityBuildTexture2DStruct(_BaseMaskMap);
|
|
float4 _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0 = SAMPLE_TEXTURE2D(_Property_a1adaaa2a22b0e829756ccb08eab9146_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_a1adaaa2a22b0e829756ccb08eab9146_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_R_4 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.r;
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_G_5 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.g;
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_B_6 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.b;
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_A_7 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.a;
|
|
float _Property_06c41396a31ba582877d3a10387f69e6_Out_0 = _BaseMetallic;
|
|
float _Multiply_1e8010b400ec9689a4d8570c8fb2dd6e_Out_2;
|
|
Unity_Multiply_float_float(_SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_R_4, _Property_06c41396a31ba582877d3a10387f69e6_Out_0, _Multiply_1e8010b400ec9689a4d8570c8fb2dd6e_Out_2);
|
|
float _Property_2dbdbebc756fb1819344efcc68c07d00_Out_0 = _BaseAORemapMin;
|
|
float _Property_bdc878630dfca586bff66e5b4bfffe30_Out_0 = _BaseAORemapMax;
|
|
float2 _Vector2_7f058afa3dd186869dd0f2d889a637bb_Out_0 = float2(_Property_2dbdbebc756fb1819344efcc68c07d00_Out_0, _Property_bdc878630dfca586bff66e5b4bfffe30_Out_0);
|
|
float _Remap_736c05b9e06ff78597a5b300523c5e04_Out_3;
|
|
Unity_Remap_float(_SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_G_5, float2 (0, 1), _Vector2_7f058afa3dd186869dd0f2d889a637bb_Out_0, _Remap_736c05b9e06ff78597a5b300523c5e04_Out_3);
|
|
float _Property_dbfeaf948b34478090dd8f1a3d0e2440_Out_0 = _BaseSmoothnessRemapMin;
|
|
float _Property_d7d9704f0497d58ea30c73507241d8e4_Out_0 = _BaseSmoothnessRemapMax;
|
|
float2 _Vector2_03bee8a712eb848f9058c9ca67139ff0_Out_0 = float2(_Property_dbfeaf948b34478090dd8f1a3d0e2440_Out_0, _Property_d7d9704f0497d58ea30c73507241d8e4_Out_0);
|
|
float _Remap_9fa10d7f73353f8d98e7e00ad7887efd_Out_3;
|
|
Unity_Remap_float(_SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_A_7, float2 (0, 1), _Vector2_03bee8a712eb848f9058c9ca67139ff0_Out_0, _Remap_9fa10d7f73353f8d98e7e00ad7887efd_Out_3);
|
|
float3 _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0 = float3(_Multiply_1e8010b400ec9689a4d8570c8fb2dd6e_Out_2, _Remap_736c05b9e06ff78597a5b300523c5e04_Out_3, _Remap_9fa10d7f73353f8d98e7e00ad7887efd_Out_3);
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_R_1 = _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0[0];
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_G_2 = _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0[1];
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_B_3 = _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0[2];
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_A_4 = 0;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.BaseColor = (_Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2.xyz);
|
|
surface.NormalTS = _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2;
|
|
surface.Emission = (_Multiply_3087173cba0b465ab00f35541d643281_Out_2.xyz);
|
|
surface.Metallic = _Split_b9b4ede5ed4eaf82a5409e98b1310654_R_1;
|
|
surface.Specular = IsGammaSpace() ? float3(0.5, 0.5, 0.5) : SRGBToLinear(float3(0.5, 0.5, 0.5));
|
|
surface.Smoothness = _Split_b9b4ede5ed4eaf82a5409e98b1310654_B_3;
|
|
surface.Occlusion = _Split_b9b4ede5ed4eaf82a5409e98b1310654_G_2;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRGBufferPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "ShadowCaster"
|
|
Tags
|
|
{
|
|
"LightMode" = "ShadowCaster"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
ZTest LEqual
|
|
ZWrite On
|
|
ColorMask 0
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 4.5
|
|
#pragma exclude_renderers gles gles3 glcore
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_NORMAL_WS
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_SHADOWCASTER
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float3 normalWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
float3 normalWS : INTERP1;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
// GraphFunctions: <None>
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShadowCasterPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "DepthOnly"
|
|
Tags
|
|
{
|
|
"LightMode" = "DepthOnly"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
ZTest LEqual
|
|
ZWrite On
|
|
ColorMask 0
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 4.5
|
|
#pragma exclude_renderers gles gles3 glcore
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_DEPTHONLY
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
// GraphFunctions: <None>
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/DepthOnlyPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "DepthNormals"
|
|
Tags
|
|
{
|
|
"LightMode" = "DepthNormals"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
ZTest LEqual
|
|
ZWrite On
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 4.5
|
|
#pragma exclude_renderers gles gles3 glcore
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ DOTS_INSTANCING_ON
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_NORMAL_WS
|
|
#define VARYINGS_NEED_TANGENT_WS
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_DEPTHNORMALS
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 uv1 : TEXCOORD1;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 TangentSpaceNormal;
|
|
float4 uv0;
|
|
float FaceSign;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float3 normalWS : INTERP2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, 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
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings 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
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Flip_float4(float4 In, float4 Flip, out float4 Out)
|
|
{
|
|
Out = (Flip * -2 + 1) * In;
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 NormalTS;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
float _IsFrontFace_d1836594a20c48b6800447231077d6d1_Out_0 = max(0, IN.FaceSign.x);
|
|
UnityTexture2D _Property_2cc39234d3d334899f94126a216a50fc_Out_0 = UnityBuildTexture2DStruct(_BaseNormalMap);
|
|
float4 _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0 = SAMPLE_TEXTURE2D(_Property_2cc39234d3d334899f94126a216a50fc_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_2cc39234d3d334899f94126a216a50fc_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.rgb = UnpackNormal(_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0);
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_R_4 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.r;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_G_5 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.g;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_B_6 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.b;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_A_7 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.a;
|
|
float4 _Flip_ad2e81eb126b4980b556fe6096221327_Out_1;
|
|
float4 _Flip_ad2e81eb126b4980b556fe6096221327_Flip = float4 (0, 0, 1, 0);
|
|
Unity_Flip_float4(_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0, _Flip_ad2e81eb126b4980b556fe6096221327_Flip, _Flip_ad2e81eb126b4980b556fe6096221327_Out_1);
|
|
float4 _Branch_bbac7b39053c4c458462473fe9b2547c_Out_3;
|
|
Unity_Branch_float4(_IsFrontFace_d1836594a20c48b6800447231077d6d1_Out_0, _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0, _Flip_ad2e81eb126b4980b556fe6096221327_Out_1, _Branch_bbac7b39053c4c458462473fe9b2547c_Out_3);
|
|
float _Property_020d569f63e9a2849e23988ff74eb005_Out_0 = _BaseNormalScale;
|
|
float3 _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2;
|
|
Unity_NormalStrength_float((_Branch_bbac7b39053c4c458462473fe9b2547c_Out_3.xyz), _Property_020d569f63e9a2849e23988ff74eb005_Out_0, _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2);
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.NormalTS = _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/DepthNormalsOnlyPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "Meta"
|
|
Tags
|
|
{
|
|
"LightMode" = "Meta"
|
|
}
|
|
|
|
// Render State
|
|
Cull Off
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 4.5
|
|
#pragma exclude_renderers gles gles3 glcore
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature _ EDITOR_VISUALIZATION
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define ATTRIBUTES_NEED_TEXCOORD2
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_TEXCOORD2
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_META
|
|
#define _FOG_FRAGMENT 1
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 uv1 : TEXCOORD1;
|
|
float4 uv2 : TEXCOORD2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
float4 texCoord1;
|
|
float4 texCoord2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
float4 texCoord1 : INTERP1;
|
|
float4 texCoord2 : INTERP2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.texCoord1.xyzw = input.texCoord1;
|
|
output.texCoord2.xyzw = input.texCoord2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.texCoord1 = input.texCoord1.xyzw;
|
|
output.texCoord2 = input.texCoord2.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Remap_float(float In, float2 InMinMax, float2 OutMinMax, out float Out)
|
|
{
|
|
Out = OutMinMax.x + (In - InMinMax.x) * (OutMinMax.y - OutMinMax.x) / (InMinMax.y - InMinMax.x);
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float4 _Property_13c79aaf332e20868551d934a2cb7112_Out_0 = _BaseColor;
|
|
float4 _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Property_13c79aaf332e20868551d934a2cb7112_Out_0, _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2);
|
|
UnityTexture2D _Property_c21bbe1e3db54c649a486b8387c29596_Out_0 = UnityBuildTexture2DStruct(_Thickness_R);
|
|
float4 _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0 = SAMPLE_TEXTURE2D(_Property_c21bbe1e3db54c649a486b8387c29596_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_c21bbe1e3db54c649a486b8387c29596_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_R_4 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.r;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_G_5 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.g;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_B_6 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.b;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_A_7 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.a;
|
|
float _OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1;
|
|
Unity_OneMinus_float(_SampleTexture2D_d87c1205d6154680b17a62917b983db1_R_4, _OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1);
|
|
float _Property_6624e4d17da343f4a8d3a35d8e2ebdd7_Out_0 = _ThicknessRemapMin;
|
|
float _Property_d949f8475c904fc1bc96971c0cf89327_Out_0 = _ThicknessRemapMax;
|
|
float2 _Vector2_a9da78da855f4aa191367996e4d5149b_Out_0 = float2(_Property_6624e4d17da343f4a8d3a35d8e2ebdd7_Out_0, _Property_d949f8475c904fc1bc96971c0cf89327_Out_0);
|
|
float _Remap_f4a9fca065054bffb86029e2dfb67271_Out_3;
|
|
Unity_Remap_float(_OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1, float2 (0, 1), _Vector2_a9da78da855f4aa191367996e4d5149b_Out_0, _Remap_f4a9fca065054bffb86029e2dfb67271_Out_3);
|
|
float _Clamp_79d501cf18b549c3bea0719045cead9a_Out_3;
|
|
Unity_Clamp_float(_Remap_f4a9fca065054bffb86029e2dfb67271_Out_3, 0, 1, _Clamp_79d501cf18b549c3bea0719045cead9a_Out_3);
|
|
float4 _Property_073a7da1f931476aa698dadb5e286d1c_Out_0 = IsGammaSpace() ? LinearToSRGB(_ThicknessEmission) : _ThicknessEmission;
|
|
float4 _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2;
|
|
Unity_Multiply_float4_float4((_Clamp_79d501cf18b549c3bea0719045cead9a_Out_3.xxxx), _Property_073a7da1f931476aa698dadb5e286d1c_Out_0, _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2);
|
|
float4 _Multiply_3087173cba0b465ab00f35541d643281_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2, _Multiply_3087173cba0b465ab00f35541d643281_Out_2);
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.BaseColor = (_Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2.xyz);
|
|
surface.Emission = (_Multiply_3087173cba0b465ab00f35541d643281_Out_2.xyz);
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/LightingMetaPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "SceneSelectionPass"
|
|
Tags
|
|
{
|
|
"LightMode" = "SceneSelectionPass"
|
|
}
|
|
|
|
// Render State
|
|
Cull Off
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 4.5
|
|
#pragma exclude_renderers gles gles3 glcore
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_DEPTHONLY
|
|
#define SCENESELECTIONPASS 1
|
|
#define ALPHA_CLIP_THRESHOLD 1
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
// GraphFunctions: <None>
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/SelectionPickingPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "ScenePickingPass"
|
|
Tags
|
|
{
|
|
"LightMode" = "Picking"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 4.5
|
|
#pragma exclude_renderers gles gles3 glcore
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_DEPTHONLY
|
|
#define SCENEPICKINGPASS 1
|
|
#define ALPHA_CLIP_THRESHOLD 1
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
// GraphFunctions: <None>
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/SelectionPickingPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
// Name: <None>
|
|
Tags
|
|
{
|
|
"LightMode" = "Universal2D"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
Blend [_SrcBlend] [_DstBlend]
|
|
ZTest [_ZTest]
|
|
ZWrite [_ZWrite]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 4.5
|
|
#pragma exclude_renderers gles gles3 glcore
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_2D
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float4 _Property_13c79aaf332e20868551d934a2cb7112_Out_0 = _BaseColor;
|
|
float4 _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Property_13c79aaf332e20868551d934a2cb7112_Out_0, _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2);
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.BaseColor = (_Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2.xyz);
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBR2DPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
SubShader
|
|
{
|
|
Tags
|
|
{
|
|
"RenderPipeline"="UniversalPipeline"
|
|
"RenderType"="Opaque"
|
|
"UniversalMaterialType" = "Lit"
|
|
"Queue"="AlphaTest"
|
|
"ShaderGraphShader"="true"
|
|
"ShaderGraphTargetId"="UniversalLitSubTarget"
|
|
}
|
|
Pass
|
|
{
|
|
Name "Universal Forward"
|
|
Tags
|
|
{
|
|
"LightMode" = "UniversalForward"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
Blend [_SrcBlend] [_DstBlend]
|
|
ZTest [_ZTest]
|
|
ZWrite [_ZWrite]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 2.0
|
|
#pragma only_renderers gles gles3 glcore d3d11
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile_fog
|
|
#pragma instancing_options renderinglayer
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
|
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
|
|
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
|
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
|
|
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
|
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT
|
|
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
|
|
#pragma multi_compile _ SHADOWS_SHADOWMASK
|
|
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
|
|
#pragma multi_compile_fragment _ _LIGHT_LAYERS
|
|
#pragma multi_compile_fragment _ DEBUG_DISPLAY
|
|
#pragma multi_compile_fragment _ _LIGHT_COOKIES
|
|
#pragma multi_compile _ _CLUSTERED_RENDERING
|
|
#pragma shader_feature_fragment _ _SURFACE_TYPE_TRANSPARENT
|
|
#pragma shader_feature_local_fragment _ _ALPHAPREMULTIPLY_ON
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
#pragma shader_feature_local_fragment _ _SPECULAR_SETUP
|
|
#pragma shader_feature_local _ _RECEIVE_SHADOWS_OFF
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#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_NORMAL_WS
|
|
#define VARYINGS_NEED_TANGENT_WS
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_VIEWDIRECTION_WS
|
|
#define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT
|
|
#define VARYINGS_NEED_SHADOW_COORD
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_FORWARD
|
|
#define _FOG_FRAGMENT 1
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 uv1 : TEXCOORD1;
|
|
float4 uv2 : TEXCOORD2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float3 positionWS;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
float3 viewDirectionWS;
|
|
#if defined(LIGHTMAP_ON)
|
|
float2 staticLightmapUV;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
float2 dynamicLightmapUV;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
float3 sh;
|
|
#endif
|
|
float4 fogFactorAndVertexLight;
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
float4 shadowCoord;
|
|
#endif
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 TangentSpaceNormal;
|
|
float4 uv0;
|
|
float FaceSign;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
#if defined(LIGHTMAP_ON)
|
|
float2 staticLightmapUV : INTERP0;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
float2 dynamicLightmapUV : INTERP1;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
float3 sh : INTERP2;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
float4 shadowCoord : INTERP3;
|
|
#endif
|
|
float4 tangentWS : INTERP4;
|
|
float4 texCoord0 : INTERP5;
|
|
float4 fogFactorAndVertexLight : INTERP6;
|
|
float3 positionWS : INTERP7;
|
|
float3 normalWS : INTERP8;
|
|
float3 viewDirectionWS : INTERP9;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
#if defined(LIGHTMAP_ON)
|
|
output.staticLightmapUV = input.staticLightmapUV;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
output.dynamicLightmapUV = input.dynamicLightmapUV;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
output.sh = input.sh;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
output.shadowCoord = input.shadowCoord;
|
|
#endif
|
|
output.tangentWS.xyzw = input.tangentWS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.fogFactorAndVertexLight.xyzw = input.fogFactorAndVertexLight;
|
|
output.positionWS.xyz = input.positionWS;
|
|
output.normalWS.xyz = input.normalWS;
|
|
output.viewDirectionWS.xyz = input.viewDirectionWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
#if defined(LIGHTMAP_ON)
|
|
output.staticLightmapUV = input.staticLightmapUV;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
output.dynamicLightmapUV = input.dynamicLightmapUV;
|
|
#endif
|
|
#if !defined(LIGHTMAP_ON)
|
|
output.sh = input.sh;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
output.shadowCoord = input.shadowCoord;
|
|
#endif
|
|
output.tangentWS = input.tangentWS.xyzw;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.fogFactorAndVertexLight = input.fogFactorAndVertexLight.xyzw;
|
|
output.positionWS = input.positionWS.xyz;
|
|
output.normalWS = input.normalWS.xyz;
|
|
output.viewDirectionWS = input.viewDirectionWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_Flip_float4(float4 In, float4 Flip, out float4 Out)
|
|
{
|
|
Out = (Flip * -2 + 1) * In;
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Remap_float(float In, float2 InMinMax, float2 OutMinMax, out float Out)
|
|
{
|
|
Out = OutMinMax.x + (In - InMinMax.x) * (OutMinMax.y - OutMinMax.x) / (InMinMax.y - InMinMax.x);
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
void Unity_Multiply_float_float(float A, float B, out float Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 NormalTS;
|
|
float3 Emission;
|
|
float Metallic;
|
|
float3 Specular;
|
|
float Smoothness;
|
|
float Occlusion;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float4 _Property_13c79aaf332e20868551d934a2cb7112_Out_0 = _BaseColor;
|
|
float4 _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Property_13c79aaf332e20868551d934a2cb7112_Out_0, _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2);
|
|
float _IsFrontFace_d1836594a20c48b6800447231077d6d1_Out_0 = max(0, IN.FaceSign.x);
|
|
UnityTexture2D _Property_2cc39234d3d334899f94126a216a50fc_Out_0 = UnityBuildTexture2DStruct(_BaseNormalMap);
|
|
float4 _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0 = SAMPLE_TEXTURE2D(_Property_2cc39234d3d334899f94126a216a50fc_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_2cc39234d3d334899f94126a216a50fc_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.rgb = UnpackNormal(_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0);
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_R_4 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.r;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_G_5 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.g;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_B_6 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.b;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_A_7 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.a;
|
|
float4 _Flip_ad2e81eb126b4980b556fe6096221327_Out_1;
|
|
float4 _Flip_ad2e81eb126b4980b556fe6096221327_Flip = float4 (0, 0, 1, 0);
|
|
Unity_Flip_float4(_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0, _Flip_ad2e81eb126b4980b556fe6096221327_Flip, _Flip_ad2e81eb126b4980b556fe6096221327_Out_1);
|
|
float4 _Branch_bbac7b39053c4c458462473fe9b2547c_Out_3;
|
|
Unity_Branch_float4(_IsFrontFace_d1836594a20c48b6800447231077d6d1_Out_0, _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0, _Flip_ad2e81eb126b4980b556fe6096221327_Out_1, _Branch_bbac7b39053c4c458462473fe9b2547c_Out_3);
|
|
float _Property_020d569f63e9a2849e23988ff74eb005_Out_0 = _BaseNormalScale;
|
|
float3 _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2;
|
|
Unity_NormalStrength_float((_Branch_bbac7b39053c4c458462473fe9b2547c_Out_3.xyz), _Property_020d569f63e9a2849e23988ff74eb005_Out_0, _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2);
|
|
UnityTexture2D _Property_c21bbe1e3db54c649a486b8387c29596_Out_0 = UnityBuildTexture2DStruct(_Thickness_R);
|
|
float4 _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0 = SAMPLE_TEXTURE2D(_Property_c21bbe1e3db54c649a486b8387c29596_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_c21bbe1e3db54c649a486b8387c29596_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_R_4 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.r;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_G_5 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.g;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_B_6 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.b;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_A_7 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.a;
|
|
float _OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1;
|
|
Unity_OneMinus_float(_SampleTexture2D_d87c1205d6154680b17a62917b983db1_R_4, _OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1);
|
|
float _Property_6624e4d17da343f4a8d3a35d8e2ebdd7_Out_0 = _ThicknessRemapMin;
|
|
float _Property_d949f8475c904fc1bc96971c0cf89327_Out_0 = _ThicknessRemapMax;
|
|
float2 _Vector2_a9da78da855f4aa191367996e4d5149b_Out_0 = float2(_Property_6624e4d17da343f4a8d3a35d8e2ebdd7_Out_0, _Property_d949f8475c904fc1bc96971c0cf89327_Out_0);
|
|
float _Remap_f4a9fca065054bffb86029e2dfb67271_Out_3;
|
|
Unity_Remap_float(_OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1, float2 (0, 1), _Vector2_a9da78da855f4aa191367996e4d5149b_Out_0, _Remap_f4a9fca065054bffb86029e2dfb67271_Out_3);
|
|
float _Clamp_79d501cf18b549c3bea0719045cead9a_Out_3;
|
|
Unity_Clamp_float(_Remap_f4a9fca065054bffb86029e2dfb67271_Out_3, 0, 1, _Clamp_79d501cf18b549c3bea0719045cead9a_Out_3);
|
|
float4 _Property_073a7da1f931476aa698dadb5e286d1c_Out_0 = IsGammaSpace() ? LinearToSRGB(_ThicknessEmission) : _ThicknessEmission;
|
|
float4 _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2;
|
|
Unity_Multiply_float4_float4((_Clamp_79d501cf18b549c3bea0719045cead9a_Out_3.xxxx), _Property_073a7da1f931476aa698dadb5e286d1c_Out_0, _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2);
|
|
float4 _Multiply_3087173cba0b465ab00f35541d643281_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2, _Multiply_3087173cba0b465ab00f35541d643281_Out_2);
|
|
UnityTexture2D _Property_a1adaaa2a22b0e829756ccb08eab9146_Out_0 = UnityBuildTexture2DStruct(_BaseMaskMap);
|
|
float4 _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0 = SAMPLE_TEXTURE2D(_Property_a1adaaa2a22b0e829756ccb08eab9146_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_a1adaaa2a22b0e829756ccb08eab9146_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_R_4 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.r;
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_G_5 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.g;
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_B_6 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.b;
|
|
float _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_A_7 = _SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_RGBA_0.a;
|
|
float _Property_06c41396a31ba582877d3a10387f69e6_Out_0 = _BaseMetallic;
|
|
float _Multiply_1e8010b400ec9689a4d8570c8fb2dd6e_Out_2;
|
|
Unity_Multiply_float_float(_SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_R_4, _Property_06c41396a31ba582877d3a10387f69e6_Out_0, _Multiply_1e8010b400ec9689a4d8570c8fb2dd6e_Out_2);
|
|
float _Property_2dbdbebc756fb1819344efcc68c07d00_Out_0 = _BaseAORemapMin;
|
|
float _Property_bdc878630dfca586bff66e5b4bfffe30_Out_0 = _BaseAORemapMax;
|
|
float2 _Vector2_7f058afa3dd186869dd0f2d889a637bb_Out_0 = float2(_Property_2dbdbebc756fb1819344efcc68c07d00_Out_0, _Property_bdc878630dfca586bff66e5b4bfffe30_Out_0);
|
|
float _Remap_736c05b9e06ff78597a5b300523c5e04_Out_3;
|
|
Unity_Remap_float(_SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_G_5, float2 (0, 1), _Vector2_7f058afa3dd186869dd0f2d889a637bb_Out_0, _Remap_736c05b9e06ff78597a5b300523c5e04_Out_3);
|
|
float _Property_dbfeaf948b34478090dd8f1a3d0e2440_Out_0 = _BaseSmoothnessRemapMin;
|
|
float _Property_d7d9704f0497d58ea30c73507241d8e4_Out_0 = _BaseSmoothnessRemapMax;
|
|
float2 _Vector2_03bee8a712eb848f9058c9ca67139ff0_Out_0 = float2(_Property_dbfeaf948b34478090dd8f1a3d0e2440_Out_0, _Property_d7d9704f0497d58ea30c73507241d8e4_Out_0);
|
|
float _Remap_9fa10d7f73353f8d98e7e00ad7887efd_Out_3;
|
|
Unity_Remap_float(_SampleTexture2D_5d4063b2d3804067b9d72042ca08e94e_A_7, float2 (0, 1), _Vector2_03bee8a712eb848f9058c9ca67139ff0_Out_0, _Remap_9fa10d7f73353f8d98e7e00ad7887efd_Out_3);
|
|
float3 _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0 = float3(_Multiply_1e8010b400ec9689a4d8570c8fb2dd6e_Out_2, _Remap_736c05b9e06ff78597a5b300523c5e04_Out_3, _Remap_9fa10d7f73353f8d98e7e00ad7887efd_Out_3);
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_R_1 = _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0[0];
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_G_2 = _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0[1];
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_B_3 = _Vector3_b34af5a5e4b21588a99ba5eb5358a84d_Out_0[2];
|
|
float _Split_b9b4ede5ed4eaf82a5409e98b1310654_A_4 = 0;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.BaseColor = (_Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2.xyz);
|
|
surface.NormalTS = _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2;
|
|
surface.Emission = (_Multiply_3087173cba0b465ab00f35541d643281_Out_2.xyz);
|
|
surface.Metallic = _Split_b9b4ede5ed4eaf82a5409e98b1310654_R_1;
|
|
surface.Specular = IsGammaSpace() ? float3(0.5, 0.5, 0.5) : SRGBToLinear(float3(0.5, 0.5, 0.5));
|
|
surface.Smoothness = _Split_b9b4ede5ed4eaf82a5409e98b1310654_B_3;
|
|
surface.Occlusion = _Split_b9b4ede5ed4eaf82a5409e98b1310654_G_2;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBRForwardPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "ShadowCaster"
|
|
Tags
|
|
{
|
|
"LightMode" = "ShadowCaster"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
ZTest LEqual
|
|
ZWrite On
|
|
ColorMask 0
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 2.0
|
|
#pragma only_renderers gles gles3 glcore d3d11
|
|
#pragma multi_compile_instancing
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_NORMAL_WS
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_SHADOWCASTER
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float3 normalWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
float3 normalWS : INTERP1;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.normalWS.xyz = input.normalWS;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.normalWS = input.normalWS.xyz;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
// GraphFunctions: <None>
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShadowCasterPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "DepthOnly"
|
|
Tags
|
|
{
|
|
"LightMode" = "DepthOnly"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
ZTest LEqual
|
|
ZWrite On
|
|
ColorMask 0
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 2.0
|
|
#pragma only_renderers gles gles3 glcore d3d11
|
|
#pragma multi_compile_instancing
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_DEPTHONLY
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
// GraphFunctions: <None>
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/DepthOnlyPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "DepthNormals"
|
|
Tags
|
|
{
|
|
"LightMode" = "DepthNormals"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
ZTest LEqual
|
|
ZWrite On
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 2.0
|
|
#pragma only_renderers gles gles3 glcore d3d11
|
|
#pragma multi_compile_instancing
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_NORMAL_WS
|
|
#define VARYINGS_NEED_TANGENT_WS
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_CULLFACE
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_DEPTHNORMALS
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 uv1 : TEXCOORD1;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float3 normalWS;
|
|
float4 tangentWS;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float3 TangentSpaceNormal;
|
|
float4 uv0;
|
|
float FaceSign;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 tangentWS : INTERP0;
|
|
float4 texCoord0 : INTERP1;
|
|
float3 normalWS : INTERP2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, 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
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings 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
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Flip_float4(float4 In, float4 Flip, out float4 Out)
|
|
{
|
|
Out = (Flip * -2 + 1) * In;
|
|
}
|
|
|
|
void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out)
|
|
{
|
|
Out = Predicate ? True : False;
|
|
}
|
|
|
|
void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out)
|
|
{
|
|
Out = float3(In.rg * Strength, lerp(1, In.b, saturate(Strength)));
|
|
}
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 NormalTS;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
float _IsFrontFace_d1836594a20c48b6800447231077d6d1_Out_0 = max(0, IN.FaceSign.x);
|
|
UnityTexture2D _Property_2cc39234d3d334899f94126a216a50fc_Out_0 = UnityBuildTexture2DStruct(_BaseNormalMap);
|
|
float4 _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0 = SAMPLE_TEXTURE2D(_Property_2cc39234d3d334899f94126a216a50fc_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_2cc39234d3d334899f94126a216a50fc_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.rgb = UnpackNormal(_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0);
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_R_4 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.r;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_G_5 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.g;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_B_6 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.b;
|
|
float _SampleTexture2D_c29f2556cc324e979d19de2da772221d_A_7 = _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0.a;
|
|
float4 _Flip_ad2e81eb126b4980b556fe6096221327_Out_1;
|
|
float4 _Flip_ad2e81eb126b4980b556fe6096221327_Flip = float4 (0, 0, 1, 0);
|
|
Unity_Flip_float4(_SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0, _Flip_ad2e81eb126b4980b556fe6096221327_Flip, _Flip_ad2e81eb126b4980b556fe6096221327_Out_1);
|
|
float4 _Branch_bbac7b39053c4c458462473fe9b2547c_Out_3;
|
|
Unity_Branch_float4(_IsFrontFace_d1836594a20c48b6800447231077d6d1_Out_0, _SampleTexture2D_c29f2556cc324e979d19de2da772221d_RGBA_0, _Flip_ad2e81eb126b4980b556fe6096221327_Out_1, _Branch_bbac7b39053c4c458462473fe9b2547c_Out_3);
|
|
float _Property_020d569f63e9a2849e23988ff74eb005_Out_0 = _BaseNormalScale;
|
|
float3 _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2;
|
|
Unity_NormalStrength_float((_Branch_bbac7b39053c4c458462473fe9b2547c_Out_3.xyz), _Property_020d569f63e9a2849e23988ff74eb005_Out_0, _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2);
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.NormalTS = _NormalStrength_0c71fb166ae841839a0a12ecc5afa6fe_Out_2;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
output.TangentSpaceNormal = float3(0.0f, 0.0f, 1.0f);
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/DepthNormalsOnlyPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "Meta"
|
|
Tags
|
|
{
|
|
"LightMode" = "Meta"
|
|
}
|
|
|
|
// Render State
|
|
Cull Off
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 2.0
|
|
#pragma only_renderers gles gles3 glcore d3d11
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature _ EDITOR_VISUALIZATION
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define ATTRIBUTES_NEED_TEXCOORD1
|
|
#define ATTRIBUTES_NEED_TEXCOORD2
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD1
|
|
#define VARYINGS_NEED_TEXCOORD2
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_META
|
|
#define _FOG_FRAGMENT 1
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
float4 uv1 : TEXCOORD1;
|
|
float4 uv2 : TEXCOORD2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
float4 texCoord1;
|
|
float4 texCoord2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
float4 texCoord1 : INTERP1;
|
|
float4 texCoord2 : INTERP2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
output.texCoord1.xyzw = input.texCoord1;
|
|
output.texCoord2.xyzw = input.texCoord2;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
output.texCoord1 = input.texCoord1.xyzw;
|
|
output.texCoord2 = input.texCoord2.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
void Unity_OneMinus_float(float In, out float Out)
|
|
{
|
|
Out = 1 - In;
|
|
}
|
|
|
|
void Unity_Remap_float(float In, float2 InMinMax, float2 OutMinMax, out float Out)
|
|
{
|
|
Out = OutMinMax.x + (In - InMinMax.x) * (OutMinMax.y - OutMinMax.x) / (InMinMax.y - InMinMax.x);
|
|
}
|
|
|
|
void Unity_Clamp_float(float In, float Min, float Max, out float Out)
|
|
{
|
|
Out = clamp(In, Min, Max);
|
|
}
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float3 Emission;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float4 _Property_13c79aaf332e20868551d934a2cb7112_Out_0 = _BaseColor;
|
|
float4 _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Property_13c79aaf332e20868551d934a2cb7112_Out_0, _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2);
|
|
UnityTexture2D _Property_c21bbe1e3db54c649a486b8387c29596_Out_0 = UnityBuildTexture2DStruct(_Thickness_R);
|
|
float4 _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0 = SAMPLE_TEXTURE2D(_Property_c21bbe1e3db54c649a486b8387c29596_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_c21bbe1e3db54c649a486b8387c29596_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_R_4 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.r;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_G_5 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.g;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_B_6 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.b;
|
|
float _SampleTexture2D_d87c1205d6154680b17a62917b983db1_A_7 = _SampleTexture2D_d87c1205d6154680b17a62917b983db1_RGBA_0.a;
|
|
float _OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1;
|
|
Unity_OneMinus_float(_SampleTexture2D_d87c1205d6154680b17a62917b983db1_R_4, _OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1);
|
|
float _Property_6624e4d17da343f4a8d3a35d8e2ebdd7_Out_0 = _ThicknessRemapMin;
|
|
float _Property_d949f8475c904fc1bc96971c0cf89327_Out_0 = _ThicknessRemapMax;
|
|
float2 _Vector2_a9da78da855f4aa191367996e4d5149b_Out_0 = float2(_Property_6624e4d17da343f4a8d3a35d8e2ebdd7_Out_0, _Property_d949f8475c904fc1bc96971c0cf89327_Out_0);
|
|
float _Remap_f4a9fca065054bffb86029e2dfb67271_Out_3;
|
|
Unity_Remap_float(_OneMinus_92eadd1b90c842ae9a88c78d49b6c3d3_Out_1, float2 (0, 1), _Vector2_a9da78da855f4aa191367996e4d5149b_Out_0, _Remap_f4a9fca065054bffb86029e2dfb67271_Out_3);
|
|
float _Clamp_79d501cf18b549c3bea0719045cead9a_Out_3;
|
|
Unity_Clamp_float(_Remap_f4a9fca065054bffb86029e2dfb67271_Out_3, 0, 1, _Clamp_79d501cf18b549c3bea0719045cead9a_Out_3);
|
|
float4 _Property_073a7da1f931476aa698dadb5e286d1c_Out_0 = IsGammaSpace() ? LinearToSRGB(_ThicknessEmission) : _ThicknessEmission;
|
|
float4 _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2;
|
|
Unity_Multiply_float4_float4((_Clamp_79d501cf18b549c3bea0719045cead9a_Out_3.xxxx), _Property_073a7da1f931476aa698dadb5e286d1c_Out_0, _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2);
|
|
float4 _Multiply_3087173cba0b465ab00f35541d643281_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Multiply_296f2bd7c2524ae4a39e30001ef47289_Out_2, _Multiply_3087173cba0b465ab00f35541d643281_Out_2);
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.BaseColor = (_Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2.xyz);
|
|
surface.Emission = (_Multiply_3087173cba0b465ab00f35541d643281_Out_2.xyz);
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/LightingMetaPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "SceneSelectionPass"
|
|
Tags
|
|
{
|
|
"LightMode" = "SceneSelectionPass"
|
|
}
|
|
|
|
// Render State
|
|
Cull Off
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 2.0
|
|
#pragma only_renderers gles gles3 glcore d3d11
|
|
#pragma multi_compile_instancing
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_DEPTHONLY
|
|
#define SCENESELECTIONPASS 1
|
|
#define ALPHA_CLIP_THRESHOLD 1
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
// GraphFunctions: <None>
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/SelectionPickingPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
Name "ScenePickingPass"
|
|
Tags
|
|
{
|
|
"LightMode" = "Picking"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 2.0
|
|
#pragma only_renderers gles gles3 glcore d3d11
|
|
#pragma multi_compile_instancing
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_DEPTHONLY
|
|
#define SCENEPICKINGPASS 1
|
|
#define ALPHA_CLIP_THRESHOLD 1
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
// GraphFunctions: <None>
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/SelectionPickingPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
Pass
|
|
{
|
|
// Name: <None>
|
|
Tags
|
|
{
|
|
"LightMode" = "Universal2D"
|
|
}
|
|
|
|
// Render State
|
|
Cull [_Cull]
|
|
Blend [_SrcBlend] [_DstBlend]
|
|
ZTest [_ZTest]
|
|
ZWrite [_ZWrite]
|
|
|
|
// Debug
|
|
// <None>
|
|
|
|
// --------------------------------------------------
|
|
// Pass
|
|
|
|
HLSLPROGRAM
|
|
|
|
// Pragmas
|
|
#pragma target 2.0
|
|
#pragma only_renderers gles gles3 glcore d3d11
|
|
#pragma multi_compile_instancing
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// DotsInstancingOptions: <None>
|
|
// HybridV1InjectedBuiltinProperties: <None>
|
|
|
|
// Keywords
|
|
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
|
// GraphKeywords: <None>
|
|
|
|
// Defines
|
|
|
|
#define _NORMALMAP 1
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define ATTRIBUTES_NEED_TEXCOORD0
|
|
#define VARYINGS_NEED_TEXCOORD0
|
|
#define FEATURES_GRAPH_VERTEX
|
|
/* WARNING: $splice Could not find named fragment 'PassInstancing' */
|
|
#define SHADERPASS SHADERPASS_2D
|
|
/* WARNING: $splice Could not find named fragment 'DotsInstancingVars' */
|
|
|
|
|
|
// custom interpolator pre-include
|
|
/* WARNING: $splice Could not find named fragment 'sgci_CustomInterpolatorPreInclude' */
|
|
|
|
// Includes
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Structs and Packing
|
|
|
|
// custom interpolators pre packing
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPrePacking' */
|
|
|
|
struct Attributes
|
|
{
|
|
float3 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 uv0 : TEXCOORD0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : INSTANCEID_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct Varyings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
struct SurfaceDescriptionInputs
|
|
{
|
|
float4 uv0;
|
|
};
|
|
struct VertexDescriptionInputs
|
|
{
|
|
float3 ObjectSpaceNormal;
|
|
float3 ObjectSpaceTangent;
|
|
float3 ObjectSpacePosition;
|
|
};
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texCoord0 : INTERP0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
uint instanceID : CUSTOM_INSTANCE_ID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC;
|
|
#endif
|
|
};
|
|
|
|
PackedVaryings PackVaryings (Varyings input)
|
|
{
|
|
PackedVaryings output;
|
|
ZERO_INITIALIZE(PackedVaryings, output);
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0.xyzw = input.texCoord0;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
Varyings UnpackVaryings (PackedVaryings input)
|
|
{
|
|
Varyings output;
|
|
output.positionCS = input.positionCS;
|
|
output.texCoord0 = input.texCoord0.xyzw;
|
|
#if UNITY_ANY_INSTANCING_ENABLED
|
|
output.instanceID = input.instanceID;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))
|
|
output.stereoTargetEyeIndexAsBlendIdx0 = input.stereoTargetEyeIndexAsBlendIdx0;
|
|
#endif
|
|
#if (defined(UNITY_STEREO_INSTANCING_ENABLED))
|
|
output.stereoTargetEyeIndexAsRTArrayIdx = input.stereoTargetEyeIndexAsRTArrayIdx;
|
|
#endif
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
output.cullFace = input.cullFace;
|
|
#endif
|
|
return output;
|
|
}
|
|
|
|
|
|
// --------------------------------------------------
|
|
// Graph
|
|
|
|
// Graph Properties
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float _AlphaCutoff;
|
|
float4 _BaseColor;
|
|
float4 _BaseColorMap_TexelSize;
|
|
float4 _BaseColorMap_ST;
|
|
float4 _BaseTilingOffset;
|
|
float4 _BaseNormalMap_TexelSize;
|
|
float4 _BaseNormalMap_ST;
|
|
float _BaseNormalScale;
|
|
float4 _BaseMaskMap_TexelSize;
|
|
float4 _BaseMaskMap_ST;
|
|
float _BaseMetallic;
|
|
float _BaseAORemapMin;
|
|
float _BaseAORemapMax;
|
|
float _BaseSmoothnessRemapMin;
|
|
float _BaseSmoothnessRemapMax;
|
|
float4 _Thickness_R_TexelSize;
|
|
float4 _Thickness_R_ST;
|
|
float _ThicknessRemapMin;
|
|
float _ThicknessRemapMax;
|
|
float4 _ThicknessEmission;
|
|
CBUFFER_END
|
|
|
|
// Object and Global properties
|
|
SAMPLER(SamplerState_Linear_Repeat_Aniso8);
|
|
TEXTURE2D(_BaseColorMap);
|
|
SAMPLER(sampler_BaseColorMap);
|
|
TEXTURE2D(_BaseNormalMap);
|
|
SAMPLER(sampler_BaseNormalMap);
|
|
TEXTURE2D(_BaseMaskMap);
|
|
SAMPLER(sampler_BaseMaskMap);
|
|
TEXTURE2D(_Thickness_R);
|
|
SAMPLER(sampler_Thickness_R);
|
|
|
|
// Graph Includes
|
|
// GraphIncludes: <None>
|
|
|
|
// -- Property used by ScenePickingPass
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
// -- Properties used by SceneSelectionPass
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
// Graph Functions
|
|
|
|
void Unity_Multiply_float4_float4(float4 A, float4 B, out float4 Out)
|
|
{
|
|
Out = A * B;
|
|
}
|
|
|
|
// Custom interpolators pre vertex
|
|
/* WARNING: $splice Could not find named fragment 'CustomInterpolatorPreVertex' */
|
|
|
|
// Graph Vertex
|
|
struct VertexDescription
|
|
{
|
|
float3 Position;
|
|
float3 Normal;
|
|
float3 Tangent;
|
|
};
|
|
|
|
VertexDescription VertexDescriptionFunction(VertexDescriptionInputs IN)
|
|
{
|
|
VertexDescription description = (VertexDescription)0;
|
|
description.Position = IN.ObjectSpacePosition;
|
|
description.Normal = IN.ObjectSpaceNormal;
|
|
description.Tangent = IN.ObjectSpaceTangent;
|
|
return description;
|
|
}
|
|
|
|
// Custom interpolators, pre surface
|
|
#ifdef FEATURES_GRAPH_VERTEX
|
|
Varyings CustomInterpolatorPassThroughFunc(inout Varyings output, VertexDescription input)
|
|
{
|
|
return output;
|
|
}
|
|
#define CUSTOMINTERPOLATOR_VARYPASSTHROUGH_FUNC
|
|
#endif
|
|
|
|
// Graph Pixel
|
|
struct SurfaceDescription
|
|
{
|
|
float3 BaseColor;
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
|
|
{
|
|
SurfaceDescription surface = (SurfaceDescription)0;
|
|
UnityTexture2D _Property_e4c53213449c7682b60df6ae54f219f0_Out_0 = UnityBuildTexture2DStruct(_BaseColorMap);
|
|
float4 _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0 = SAMPLE_TEXTURE2D(_Property_e4c53213449c7682b60df6ae54f219f0_Out_0.tex, UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat_Aniso8).samplerstate, _Property_e4c53213449c7682b60df6ae54f219f0_Out_0.GetTransformedUV(IN.uv0.xy));
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_R_4 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.r;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_G_5 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.g;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_B_6 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.b;
|
|
float _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7 = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0.a;
|
|
float4 _Property_13c79aaf332e20868551d934a2cb7112_Out_0 = _BaseColor;
|
|
float4 _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2;
|
|
Unity_Multiply_float4_float4(_SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_RGBA_0, _Property_13c79aaf332e20868551d934a2cb7112_Out_0, _Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2);
|
|
float _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0 = _AlphaCutoff;
|
|
surface.BaseColor = (_Multiply_3d0c2fda612cfe87aa84bc17ad099a61_Out_2.xyz);
|
|
surface.Alpha = _SampleTexture2D_0979a3599ab54293b59df4fc607ddd93_A_7;
|
|
surface.AlphaClipThreshold = _Property_881c341218ea2d81819695b0c7ddc4cb_Out_0;
|
|
return surface;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Build Graph Inputs
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#define VFX_SRP_ATTRIBUTES Attributes
|
|
#define VFX_SRP_VARYINGS Varyings
|
|
#define VFX_SRP_SURFACE_INPUTS SurfaceDescriptionInputs
|
|
#endif
|
|
VertexDescriptionInputs BuildVertexDescriptionInputs(Attributes input)
|
|
{
|
|
VertexDescriptionInputs output;
|
|
ZERO_INITIALIZE(VertexDescriptionInputs, output);
|
|
|
|
output.ObjectSpaceNormal = input.normalOS;
|
|
output.ObjectSpaceTangent = input.tangentOS.xyz;
|
|
output.ObjectSpacePosition = input.positionOS;
|
|
|
|
return output;
|
|
}
|
|
SurfaceDescriptionInputs BuildSurfaceDescriptionInputs(Varyings input)
|
|
{
|
|
SurfaceDescriptionInputs output;
|
|
ZERO_INITIALIZE(SurfaceDescriptionInputs, output);
|
|
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
// FragInputs from VFX come from two places: Interpolator or CBuffer.
|
|
/* WARNING: $splice Could not find named fragment 'VFXSetFragInputs' */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.uv0 = input.texCoord0;
|
|
#if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE)
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN output.FaceSign = IS_FRONT_VFACE(input.cullFace, true, false);
|
|
#else
|
|
#define BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
#endif
|
|
#undef BUILD_SURFACE_DESCRIPTION_INPUTS_OUTPUT_FACESIGN
|
|
|
|
return output;
|
|
}
|
|
|
|
// --------------------------------------------------
|
|
// Main
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/Varyings.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/PBR2DPass.hlsl"
|
|
|
|
// --------------------------------------------------
|
|
// Visual Effect Vertex Invocations
|
|
#ifdef HAVE_VFX_MODIFICATION
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/VisualEffectVertex.hlsl"
|
|
#endif
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
CustomEditorForRenderPipeline "UnityEditor.ShaderGraphLitGUI" "UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset"
|
|
CustomEditor "UnityEditor.ShaderGraph.GenericShaderGraphMaterialGUI"
|
|
FallBack "Hidden/Shader Graph/FallbackError"
|
|
} |