- 영어 폴더명 → 한글로 변경: - Basketball → [공용]농구장 - Cathedral_medieval_Fantastic → [공용]중세 성당 - cherry blossom road → [공용]벚꽃길 - Chogeumbi Room → [초금비]방 - Christmas room → [공용]크리스마스 방 - Class Background → [공용]교실 - Cruise Ship → [공용]크루즈 - Dance Practice Room - 아이시아 → [아이시아]연습실 - Greenhouse Garden → [공용]온실 정원 - Horizon Studio - 아이시아 → [아이시아]호라이즌 스튜디오 - Photo Studio → [공용]포토 스튜디오 - Rooftop Cafe → [공용]루프탑 카페 - School Classroom → [공용]학교 교실 - Skate_Park → [공용]스케이트 파크 - Skate_Park_NoBake → [공용]스케이트 파크(노베이크) - White Horizon → [공용]화이트 호라이즌 - YAMO_Concert_01 → [야모]콘서트 - Yamo_Edu_Stage → [야모]교육 스테이지 - 250504_HololiveConcert → [공용]홀로라이브 콘서트 - 하위 폴더 오타 수정: - Sence → Scene 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1116 lines
42 KiB
Plaintext
1116 lines
42 KiB
Plaintext
// Made with Amplify Shader Editor v1.9.9.4
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "Mingle/Floor/White Horizon"
|
|
{
|
|
Properties
|
|
{
|
|
[HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
|
|
[HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
|
|
_BaseTexture( "BaseTexture", 2D ) = "white" {}
|
|
_Radius( "Radius", Range( 0, 1 ) ) = 1
|
|
_Smoothness( "Smoothness", Range( 0.01, 1 ) ) = 0.5
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
|
|
|
|
[ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
|
|
[ToggleOff] _EnvironmentReflections("Environment Reflections", Float) = 1.0
|
|
[ToggleUI] _ReceiveShadows("Receive Shadows", Float) = 1.0
|
|
|
|
[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) = "" {}
|
|
|
|
// Surface type (0 = Opaque, 1 = Transparent) - required for DBuffer decals
|
|
[HideInInspector] _Surface("__surface", Float) = 0.0
|
|
|
|
// NiloToon Screen Space Outline
|
|
_ScreenSpaceOutlineIntensity("Screen Space Outline Intensity", Range(0,1)) = 1
|
|
[HDR]_ScreenSpaceOutlineColor("Screen Space Outline Color", Color) = (1,1,1,1)
|
|
_ScreenSpaceOutlineWidth("Screen Space Outline Width", Float) = 1
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
|
|
|
|
Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Opaque" "UniversalMaterialType"="ComplexLit" "IgnoreProjector"="True" }
|
|
|
|
Cull Back
|
|
ZWrite On
|
|
ZTest LEqual
|
|
Offset 0 , 0
|
|
AlphaToMask Off
|
|
|
|
LOD 300
|
|
|
|
HLSLINCLUDE
|
|
#pragma target 3.0
|
|
#pragma prefer_hlslcc gles
|
|
ENDHLSL
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "Forward"
|
|
Tags { "LightMode"="UniversalForwardOnly" }
|
|
|
|
Blend One Zero, One Zero
|
|
ZWrite On
|
|
ZTest LEqual
|
|
Offset 0 , 0
|
|
ColorMask RGBA
|
|
|
|
|
|
|
|
HLSLPROGRAM
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma shader_feature_local_fragment _RECEIVE_SHADOWS_OFF
|
|
#pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF
|
|
#pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF
|
|
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#define ASE_VERSION 19904
|
|
#define ASE_SRP_VERSION 170200
|
|
|
|
#pragma target 2.0
|
|
|
|
// -------------------------------------
|
|
// Shader Stages
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
// -------------------------------------
|
|
// Material Keywords
|
|
#pragma shader_feature_local _NORMALMAP
|
|
#pragma shader_feature_local _PARALLAXMAP
|
|
#pragma shader_feature_local _RECEIVE_SHADOWS_OFF
|
|
#pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED
|
|
#pragma shader_feature_local_fragment _SURFACE_TYPE_TRANSPARENT
|
|
//#pragma shader_feature_local_fragment _ALPHATEST_ON
|
|
#pragma shader_feature_local_fragment _ _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
|
|
#pragma shader_feature_local_fragment _EMISSION
|
|
#pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP
|
|
#pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
|
#pragma shader_feature_local_fragment _OCCLUSIONMAP
|
|
#pragma shader_feature_local_fragment _ _CLEARCOAT _CLEARCOATMAP
|
|
#pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF
|
|
#pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF
|
|
#pragma shader_feature_local_fragment _SPECULAR_SETUP
|
|
|
|
// -------------------------------------
|
|
// Universal Pipeline keywords
|
|
#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 _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX
|
|
#pragma multi_compile _ _LIGHT_LAYERS
|
|
#pragma multi_compile _ _CLUSTER_LIGHT_LOOP
|
|
#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 _ _REFLECTION_PROBE_ATLAS
|
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT
|
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
|
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
|
|
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
|
|
#pragma multi_compile_fragment _ _LIGHT_COOKIES
|
|
|
|
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
|
|
#pragma multi_compile _ SHADOWS_SHADOWMASK
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ LIGHTMAP_BICUBIC_SAMPLING
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile _ USE_LEGACY_LIGHTMAPS
|
|
|
|
#define SHADERPASS SHADERPASS_FORWARD
|
|
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
|
|
#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.universal/ShaderLibrary/Input.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.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"
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
|
|
#endif
|
|
|
|
// NiloToon Screen Space Outline Support
|
|
#if defined(_NILOTOON_GLOBAL_ENABLE_SCREENSPACE_OUTLINE)
|
|
#include "Assets/NiloToonURP/ShaderLibrary/NiloUtilityHLSL/NiloAllUtilIncludes.hlsl"
|
|
#endif
|
|
|
|
// NOTE: _DBUFFER is automatically defined in DBuffer.hlsl when _DBUFFER_MRT variants are active
|
|
// and _SURFACE_TYPE_TRANSPARENT is not defined. No manual define needed.
|
|
|
|
#define ASE_NEEDS_TEXTURE_COORDINATES0
|
|
#define ASE_NEEDS_FRAG_TEXTURE_COORDINATES0
|
|
|
|
|
|
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
|
|
#define ASE_SV_DEPTH SV_DepthLessEqual
|
|
#define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
|
|
#else
|
|
#define ASE_SV_DEPTH SV_Depth
|
|
#define ASE_SV_POSITION_QUALIFIERS
|
|
#endif
|
|
|
|
struct Attributes
|
|
{
|
|
float4 positionOS : POSITION;
|
|
half3 normalOS : NORMAL;
|
|
half4 tangentOS : TANGENT;
|
|
float4 texcoord : TEXCOORD0;
|
|
#if defined(LIGHTMAP_ON) || defined(ASE_NEEDS_TEXTURE_COORDINATES1)
|
|
float4 texcoord1 : TEXCOORD1;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON) || defined(ASE_NEEDS_TEXTURE_COORDINATES2)
|
|
float4 texcoord2 : TEXCOORD2;
|
|
#endif
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct PackedVaryings
|
|
{
|
|
ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float3 positionWS : TEXCOORD0;
|
|
half3 normalWS : TEXCOORD1;
|
|
float4 tangentWS : TEXCOORD2;
|
|
float4 lightmapUVOrVertexSH : TEXCOORD3;
|
|
half4 fogFactorAndVertexLight : TEXCOORD4;
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
float2 dynamicLightmapUV : TEXCOORD5;
|
|
#endif
|
|
#if defined(USE_APV_PROBE_OCCLUSION)
|
|
float4 probeOcclusion : TEXCOORD6;
|
|
#endif
|
|
float4 screenPos : TEXCOORD11; // NiloToon screen pos
|
|
float4 ase_texcoord7 : TEXCOORD7;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BaseTexture_ST;
|
|
float _Smoothness;
|
|
float _Radius;
|
|
// NiloToon Screen Space Outline
|
|
float _ScreenSpaceOutlineIntensity;
|
|
half3 _ScreenSpaceOutlineColor;
|
|
float _ScreenSpaceOutlineWidth;
|
|
float _Surface;
|
|
/*ase_srp_batcher*/
|
|
CBUFFER_END
|
|
|
|
// NiloToon Global Uniforms
|
|
float _NiloToonGlobalEnviMinimumShader;
|
|
float4 _NiloToonGlobalEnviShadowBorderTintColor;
|
|
float3 _NiloToonGlobalEnviGITintColor;
|
|
float3 _NiloToonGlobalEnviGIAddColor;
|
|
float4 _NiloToonGlobalEnviGIOverride;
|
|
float4 _NiloToonGlobalEnviAlbedoOverrideColor;
|
|
float4 _NiloToonGlobalEnviSurfaceColorResultOverrideColor;
|
|
float _GlobalScreenSpaceOutlineIntensityForEnvi;
|
|
float _GlobalScreenSpaceOutlineWidthMultiplierForEnvi;
|
|
float _GlobalScreenSpaceOutlineNormalsSensitivityOffsetForEnvi;
|
|
float _GlobalScreenSpaceOutlineDepthSensitivityOffsetForEnvi;
|
|
float _GlobalScreenSpaceOutlineDepthSensitivityDistanceFadeoutStrengthForEnvi;
|
|
half3 _GlobalScreenSpaceOutlineTintColorForEnvi;
|
|
float _CurrentCameraFOV;
|
|
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
sampler2D _BaseTexture;
|
|
|
|
|
|
|
|
PackedVaryings VertexFunction( Attributes input )
|
|
{
|
|
PackedVaryings output = (PackedVaryings)0;
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
UNITY_TRANSFER_INSTANCE_ID(input, output);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
|
|
|
|
output.ase_texcoord7.xy = input.texcoord.xy;
|
|
|
|
//setting value to unused interpolator channels and avoid initialization warnings
|
|
output.ase_texcoord7.zw = 0;
|
|
|
|
VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
|
|
VertexNormalInputs normalInput = GetVertexNormalInputs( input.normalOS, input.tangentOS );
|
|
|
|
output.positionCS = vertexInput.positionCS;
|
|
output.positionWS = vertexInput.positionWS;
|
|
output.normalWS = normalInput.normalWS;
|
|
|
|
real sign = input.tangentOS.w * GetOddNegativeScale();
|
|
half4 tangentWS = half4(normalInput.tangentWS.xyz, sign);
|
|
output.tangentWS = tangentWS;
|
|
|
|
OUTPUT_LIGHTMAP_UV( input.texcoord1, unity_LightmapST, output.lightmapUVOrVertexSH.xy );
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
output.dynamicLightmapUV = input.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
|
|
#endif
|
|
|
|
OUTPUT_SH4(vertexInput.positionWS, output.normalWS.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), output.lightmapUVOrVertexSH.xyz, output.probeOcclusion);
|
|
|
|
half3 vertexLight = VertexLighting( vertexInput.positionWS, normalInput.normalWS );
|
|
half fogFactor = 0;
|
|
#if !defined(_FOG_FRAGMENT)
|
|
fogFactor = ComputeFogFactor( vertexInput.positionCS.z );
|
|
#endif
|
|
|
|
output.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
|
|
|
|
// NiloToon screen pos
|
|
output.screenPos = ComputeScreenPos(output.positionCS);
|
|
|
|
return output;
|
|
}
|
|
|
|
PackedVaryings vert ( Attributes input )
|
|
{
|
|
return VertexFunction( input );
|
|
}
|
|
|
|
half4 frag ( PackedVaryings input
|
|
#if defined( ASE_DEPTH_WRITE_ON )
|
|
,out float outputDepth : ASE_SV_DEPTH
|
|
#endif
|
|
#ifdef _WRITE_RENDERING_LAYERS
|
|
, out uint outRenderingLayers : SV_Target1
|
|
#endif
|
|
) : SV_Target
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
|
|
|
#if defined( _SURFACE_TYPE_TRANSPARENT )
|
|
const bool isTransparent = true;
|
|
#else
|
|
const bool isTransparent = false;
|
|
#endif
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
LODFadeCrossFade( input.positionCS );
|
|
#endif
|
|
|
|
#if defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
float4 shadowCoord = TransformWorldToShadowCoord( input.positionWS );
|
|
#else
|
|
float4 shadowCoord = float4(0, 0, 0, 0);
|
|
#endif
|
|
|
|
float renormFactor = 1.0 / max( FLT_MIN, length( input.normalWS ) );
|
|
|
|
float3 PositionWS = input.positionWS;
|
|
float3 ViewDirWS = GetWorldSpaceNormalizeViewDir( PositionWS );
|
|
float4 ShadowCoord = shadowCoord;
|
|
float4 ScreenPosNorm = float4( GetNormalizedScreenSpaceUV( input.positionCS ), input.positionCS.zw );
|
|
float4 ClipPos = ComputeClipSpacePosition( ScreenPosNorm.xy, input.positionCS.z ) * input.positionCS.w;
|
|
float4 ScreenPos = ComputeScreenPos( ClipPos );
|
|
float3 TangentWS = input.tangentWS.xyz * renormFactor;
|
|
float3 BitangentWS = cross( input.normalWS, input.tangentWS.xyz ) * input.tangentWS.w * renormFactor;
|
|
float3 NormalWS = input.normalWS * renormFactor;
|
|
|
|
float2 temp_cast_0 = (2.0).xx;
|
|
float2 temp_cast_1 = (-1.0).xx;
|
|
float2 texCoord12 = input.ase_texcoord7.xy * temp_cast_0 + temp_cast_1;
|
|
float smoothstepResult13 = smoothstep( _Radius , ( _Radius - _Smoothness ) , length( texCoord12 ));
|
|
float2 uv_BaseTexture = input.ase_texcoord7.xy * _BaseTexture_ST.xy + _BaseTexture_ST.zw;
|
|
float layeredBlendVar18 = smoothstepResult13;
|
|
float4 layeredBlend18 = ( lerp( float4( 1,1,1,1 ),tex2D( _BaseTexture, uv_BaseTexture ) , layeredBlendVar18 ) );
|
|
|
|
|
|
float3 BaseColor = layeredBlend18.rgb;
|
|
float3 Normal = float3(0, 0, 1);
|
|
float3 Specular = 0.5;
|
|
float Metallic = 0.0;
|
|
float Smoothness = 0.0;
|
|
float Occlusion = 1;
|
|
float3 Emission = 0;
|
|
float Alpha = 1;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#if defined( ASE_DEPTH_WRITE_ON )
|
|
float DeviceDepth = ClipPos.z;
|
|
#endif
|
|
|
|
#if defined( _ALPHATEST_ON )
|
|
AlphaDiscard( Alpha, AlphaClipThreshold );
|
|
#endif
|
|
|
|
#if defined(MAIN_LIGHT_CALCULATE_SHADOWS) && defined(ASE_CHANGES_WORLD_POS)
|
|
ShadowCoord = TransformWorldToShadowCoord( PositionWS );
|
|
#endif
|
|
|
|
// NiloToon: albedo override
|
|
BaseColor = lerp(BaseColor, _NiloToonGlobalEnviAlbedoOverrideColor.rgb, _NiloToonGlobalEnviAlbedoOverrideColor.a);
|
|
|
|
InputData inputData = (InputData)0;
|
|
inputData.positionWS = PositionWS;
|
|
inputData.positionCS = float4( input.positionCS.xy, ClipPos.zw / ClipPos.w );
|
|
inputData.normalizedScreenSpaceUV = ScreenPosNorm.xy;
|
|
inputData.viewDirectionWS = ViewDirWS;
|
|
inputData.shadowCoord = ShadowCoord;
|
|
|
|
#ifdef _NORMALMAP
|
|
#if _NORMAL_DROPOFF_TS
|
|
inputData.normalWS = TransformTangentToWorld(Normal, half3x3(TangentWS, BitangentWS, NormalWS));
|
|
#elif _NORMAL_DROPOFF_OS
|
|
inputData.normalWS = TransformObjectToWorldNormal(Normal);
|
|
#elif _NORMAL_DROPOFF_WS
|
|
inputData.normalWS = Normal;
|
|
#endif
|
|
inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
|
|
#else
|
|
inputData.normalWS = NormalWS;
|
|
#endif
|
|
|
|
#ifdef ASE_FOG
|
|
inputData.fogCoord = InitializeInputDataFog(float4(inputData.positionWS, 1.0), input.fogFactorAndVertexLight.x);
|
|
#endif
|
|
#ifdef _ADDITIONAL_LIGHTS_VERTEX
|
|
inputData.vertexLighting = input.fogFactorAndVertexLight.yzw;
|
|
#endif
|
|
|
|
// Sample baked GI (same order as Amplify Lit template)
|
|
float3 SH = input.lightmapUVOrVertexSH.xyz;
|
|
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, input.dynamicLightmapUV.xy, SH, inputData.normalWS);
|
|
inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy);
|
|
#elif !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
|
|
inputData.bakedGI = SAMPLE_GI( SH, GetAbsolutePositionWS(inputData.positionWS),
|
|
inputData.normalWS,
|
|
inputData.viewDirectionWS,
|
|
input.positionCS.xy,
|
|
input.probeOcclusion,
|
|
inputData.shadowMask );
|
|
#else
|
|
inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, SH, inputData.normalWS);
|
|
inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy);
|
|
#endif
|
|
|
|
// NiloToon: GI edit and override
|
|
inputData.bakedGI = inputData.bakedGI * _NiloToonGlobalEnviGITintColor + _NiloToonGlobalEnviGIAddColor;
|
|
inputData.bakedGI = lerp(inputData.bakedGI, _NiloToonGlobalEnviGIOverride.rgb, _NiloToonGlobalEnviGIOverride.a);
|
|
|
|
// Setup SurfaceData
|
|
SurfaceData surfaceData;
|
|
surfaceData.albedo = BaseColor;
|
|
surfaceData.metallic = saturate(Metallic);
|
|
surfaceData.specular = Specular;
|
|
surfaceData.smoothness = saturate(Smoothness),
|
|
surfaceData.occlusion = Occlusion,
|
|
surfaceData.emission = Emission,
|
|
surfaceData.alpha = saturate(Alpha);
|
|
surfaceData.normalTS = Normal;
|
|
surfaceData.clearCoatMask = 0;
|
|
surfaceData.clearCoatSmoothness = 1;
|
|
|
|
// Apply DBuffer Decal (same order as Amplify Lit template)
|
|
#if defined(_DBUFFER)
|
|
ApplyDecalToSurfaceData(input.positionCS, surfaceData, inputData);
|
|
#endif
|
|
|
|
half4 color = UniversalFragmentPBR( inputData, surfaceData);
|
|
|
|
// NiloToon: Shadow border tint color
|
|
#if defined(SHADOWS_SHADOWMASK) && defined(LIGHTMAP_ON)
|
|
half4 nilotoonShadowMask = inputData.shadowMask;
|
|
#elif !defined (LIGHTMAP_ON)
|
|
half4 nilotoonShadowMask = unity_ProbesOcclusion;
|
|
#else
|
|
half4 nilotoonShadowMask = half4(1, 1, 1, 1);
|
|
#endif
|
|
|
|
Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, nilotoonShadowMask);
|
|
float isShadowEdge = 1-abs(mainLight.shadowAttenuation-0.5)*2;
|
|
color.rgb = lerp(color.rgb, color.rgb * _NiloToonGlobalEnviShadowBorderTintColor.rgb, isShadowEdge * _NiloToonGlobalEnviShadowBorderTintColor.a);
|
|
|
|
// NiloToon: global surface color result override
|
|
color.rgb = lerp(color.rgb, _NiloToonGlobalEnviSurfaceColorResultOverrideColor.rgb, _NiloToonGlobalEnviSurfaceColorResultOverrideColor.a);
|
|
|
|
// NiloToon: Screen space outline
|
|
#if _NILOTOON_GLOBAL_ENABLE_SCREENSPACE_OUTLINE
|
|
if(_Surface == 0)
|
|
{
|
|
float2 SV_POSITIONxy = input.positionCS.xy;
|
|
float finalOutlineWidth = _ScreenSpaceOutlineWidth * _GlobalScreenSpaceOutlineWidthMultiplierForEnvi;
|
|
float finalNormalsSensitivity = max(0,1 + _GlobalScreenSpaceOutlineNormalsSensitivityOffsetForEnvi);
|
|
float finalDepthSensitivity = max(0,1 + _GlobalScreenSpaceOutlineDepthSensitivityOffsetForEnvi);
|
|
float selfLinearDepth = abs(mul(UNITY_MATRIX_V, float4(input.positionWS,1)).z);
|
|
|
|
finalDepthSensitivity *= 0.35;
|
|
|
|
float isScreenSpaceOutlineArea = IsScreenSpaceOutline(
|
|
SV_POSITIONxy,
|
|
finalOutlineWidth,
|
|
finalDepthSensitivity,
|
|
finalNormalsSensitivity,
|
|
selfLinearDepth,
|
|
_GlobalScreenSpaceOutlineDepthSensitivityDistanceFadeoutStrengthForEnvi,
|
|
_CurrentCameraFOV,
|
|
inputData.viewDirectionWS);
|
|
|
|
isScreenSpaceOutlineArea *= _GlobalScreenSpaceOutlineIntensityForEnvi * _ScreenSpaceOutlineIntensity;
|
|
color.rgb = lerp(color.rgb, color.rgb * _GlobalScreenSpaceOutlineTintColorForEnvi * _ScreenSpaceOutlineColor.rgb, isScreenSpaceOutlineArea);
|
|
}
|
|
#endif
|
|
|
|
#ifdef ASE_FOG
|
|
color.rgb = MixFog(color.rgb, inputData.fogCoord);
|
|
#endif
|
|
|
|
color.a = OutputAlpha(color.a, IsSurfaceTypeTransparent(_Surface));
|
|
|
|
#if defined( ASE_DEPTH_WRITE_ON )
|
|
outputDepth = DeviceDepth;
|
|
#endif
|
|
|
|
#ifdef _WRITE_RENDERING_LAYERS
|
|
outRenderingLayers = GetMeshRenderingLayer();
|
|
#endif
|
|
|
|
return color;
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
Name "ShadowCaster"
|
|
Tags { "LightMode"="ShadowCaster" }
|
|
|
|
ZWrite On
|
|
ZTest LEqual
|
|
AlphaToMask Off
|
|
ColorMask 0
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#define ASE_VERSION 19904
|
|
#define ASE_SRP_VERSION 170200
|
|
|
|
|
|
#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS SHADERPASS_SHADOWCASTER
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
struct Attributes
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 clipPosV : TEXCOORD0;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 positionWS : TEXCOORD1;
|
|
#endif
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BaseTexture_ST;
|
|
float _Smoothness;
|
|
float _Radius;
|
|
float _ScreenSpaceOutlineIntensity;
|
|
half3 _ScreenSpaceOutlineColor;
|
|
float _ScreenSpaceOutlineWidth;
|
|
float _Surface;
|
|
/*ase_srp_batcher*/
|
|
CBUFFER_END
|
|
|
|
|
|
|
|
|
|
float3 _LightDirection;
|
|
float3 _LightPosition;
|
|
|
|
PackedVaryings VertexFunction( Attributes input )
|
|
{
|
|
PackedVaryings output;
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
UNITY_TRANSFER_INSTANCE_ID(input, output);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( output );
|
|
|
|
|
|
|
|
float3 positionWS = TransformObjectToWorld( input.positionOS.xyz );
|
|
float3 normalWS = TransformObjectToWorldNormal( input.normalOS );
|
|
|
|
#if _CASTING_PUNCTUAL_LIGHT_SHADOW
|
|
float3 lightDirectionWS = normalize(_LightPosition - positionWS);
|
|
#else
|
|
float3 lightDirectionWS = _LightDirection;
|
|
#endif
|
|
|
|
float4 positionCS = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS));
|
|
|
|
#if UNITY_REVERSED_Z
|
|
positionCS.z = min(positionCS.z, UNITY_NEAR_CLIP_VALUE);
|
|
#else
|
|
positionCS.z = max(positionCS.z, UNITY_NEAR_CLIP_VALUE);
|
|
#endif
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
output.positionWS = positionWS;
|
|
#endif
|
|
|
|
output.positionCS = positionCS;
|
|
output.clipPosV = positionCS;
|
|
return output;
|
|
}
|
|
|
|
PackedVaryings vert ( Attributes input )
|
|
{
|
|
return VertexFunction( input );
|
|
}
|
|
|
|
half4 frag(PackedVaryings input ) : SV_TARGET
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID( input );
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
LODFadeCrossFade( input.positionCS );
|
|
#endif
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 PositionWS = input.positionWS;
|
|
#endif
|
|
|
|
float4 ShadowCoord = float4( 0, 0, 0, 0 );
|
|
float4 ClipPos = input.clipPosV;
|
|
float4 ScreenPos = ComputeScreenPos( input.clipPosV );
|
|
|
|
|
|
|
|
float Alpha = 1;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#if defined(_ALPHATEST_ON)
|
|
AlphaDiscard( Alpha, AlphaClipThreshold );
|
|
#endif
|
|
|
|
return 0;
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
Name "DepthOnly"
|
|
Tags { "LightMode"="DepthOnly" }
|
|
|
|
ZWrite On
|
|
ColorMask R
|
|
AlphaToMask Off
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#define ASE_VERSION 19904
|
|
#define ASE_SRP_VERSION 170200
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS SHADERPASS_DEPTHONLY
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
struct Attributes
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 clipPosV : TEXCOORD0;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 positionWS : TEXCOORD1;
|
|
#endif
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BaseTexture_ST;
|
|
float _Smoothness;
|
|
float _Radius;
|
|
float _ScreenSpaceOutlineIntensity;
|
|
half3 _ScreenSpaceOutlineColor;
|
|
float _ScreenSpaceOutlineWidth;
|
|
float _Surface;
|
|
/*ase_srp_batcher*/
|
|
CBUFFER_END
|
|
|
|
|
|
|
|
|
|
PackedVaryings VertexFunction( Attributes input )
|
|
{
|
|
PackedVaryings output;
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
UNITY_TRANSFER_INSTANCE_ID(input, output);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
|
|
|
|
|
|
|
|
float3 positionWS = TransformObjectToWorld( input.positionOS.xyz );
|
|
float4 positionCS = TransformWorldToHClip( positionWS );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
output.positionWS = positionWS;
|
|
#endif
|
|
|
|
output.positionCS = positionCS;
|
|
output.clipPosV = positionCS;
|
|
return output;
|
|
}
|
|
|
|
PackedVaryings vert ( Attributes input )
|
|
{
|
|
return VertexFunction( input );
|
|
}
|
|
|
|
half4 frag(PackedVaryings input ) : SV_TARGET
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
LODFadeCrossFade( input.positionCS );
|
|
#endif
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 PositionWS = input.positionWS;
|
|
#endif
|
|
|
|
float4 ShadowCoord = float4( 0, 0, 0, 0 );
|
|
float4 ClipPos = input.clipPosV;
|
|
float4 ScreenPos = ComputeScreenPos( input.clipPosV );
|
|
|
|
|
|
|
|
float Alpha = 1;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#if defined(_ALPHATEST_ON)
|
|
AlphaDiscard( Alpha, AlphaClipThreshold );
|
|
#endif
|
|
|
|
return 0;
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
Name "DepthNormalsOnly"
|
|
Tags { "LightMode"="DepthNormalsOnly" }
|
|
|
|
ZWrite On
|
|
ZTest LEqual
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#define ASE_VERSION 19904
|
|
#define ASE_SRP_VERSION 170200
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
|
|
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
|
|
#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.universal/ShaderLibrary/Input.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
struct Attributes
|
|
{
|
|
float4 positionOS : POSITION;
|
|
half3 normalOS : NORMAL;
|
|
half4 tangentOS : TANGENT;
|
|
half4 texcoord : TEXCOORD0;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float3 positionWS : TEXCOORD0;
|
|
half3 normalWS : TEXCOORD1;
|
|
float4 tangentWS : TEXCOORD2;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BaseTexture_ST;
|
|
float _Smoothness;
|
|
float _Radius;
|
|
float _ScreenSpaceOutlineIntensity;
|
|
half3 _ScreenSpaceOutlineColor;
|
|
float _ScreenSpaceOutlineWidth;
|
|
float _Surface;
|
|
/*ase_srp_batcher*/
|
|
CBUFFER_END
|
|
|
|
|
|
|
|
|
|
PackedVaryings VertexFunction( Attributes input )
|
|
{
|
|
PackedVaryings output = (PackedVaryings)0;
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
UNITY_TRANSFER_INSTANCE_ID(input, output);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
|
|
|
|
|
|
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
float3 defaultVertexValue = input.positionOS.xyz;
|
|
#else
|
|
float3 defaultVertexValue = float3(0, 0, 0);
|
|
#endif
|
|
|
|
float3 vertexValue = defaultVertexValue;
|
|
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
input.positionOS.xyz = vertexValue;
|
|
#else
|
|
input.positionOS.xyz += vertexValue;
|
|
#endif
|
|
|
|
input.normalOS = input.normalOS;
|
|
input.tangentOS = input.tangentOS;
|
|
|
|
VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
|
|
VertexNormalInputs normalInput = GetVertexNormalInputs( input.normalOS, input.tangentOS );
|
|
|
|
output.positionCS = vertexInput.positionCS;
|
|
output.positionWS = vertexInput.positionWS;
|
|
output.normalWS = normalInput.normalWS;
|
|
output.tangentWS = float4( normalInput.tangentWS, ( input.tangentOS.w > 0.0 ? 1.0 : -1.0 ) * GetOddNegativeScale() );
|
|
|
|
return output;
|
|
}
|
|
|
|
PackedVaryings vert ( Attributes input )
|
|
{
|
|
return VertexFunction( input );
|
|
}
|
|
|
|
void frag( PackedVaryings input
|
|
, out half4 outNormalWS : SV_Target0
|
|
#ifdef _WRITE_RENDERING_LAYERS
|
|
, out uint outRenderingLayers : SV_Target1
|
|
#endif
|
|
)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
LODFadeCrossFade( input.positionCS );
|
|
#endif
|
|
|
|
float3 PositionWS = input.positionWS;
|
|
float3 NormalWS = input.normalWS;
|
|
float4 TangentWS = input.tangentWS;
|
|
|
|
|
|
|
|
float Alpha = 1;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#if defined(_ALPHATEST_ON)
|
|
AlphaDiscard( Alpha, AlphaClipThreshold );
|
|
#endif
|
|
|
|
#if defined(_GBUFFER_NORMALS_OCT)
|
|
float3 normalWS = normalize(NormalWS);
|
|
float2 octNormalWS = PackNormalOctQuadEncode(normalWS);
|
|
float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5);
|
|
half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS);
|
|
outNormalWS = half4(packedNormalWS, 0.0);
|
|
#else
|
|
float3 normalWS = NormalizeNormalPerPixel(NormalWS);
|
|
outNormalWS = half4(normalWS, 0.0);
|
|
#endif
|
|
|
|
#ifdef _WRITE_RENDERING_LAYERS
|
|
outRenderingLayers = EncodeMeshRenderingLayer();
|
|
#endif
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
Name "Meta"
|
|
Tags { "LightMode"="Meta" }
|
|
|
|
Cull Off
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#define ASE_VERSION 19904
|
|
#define ASE_SRP_VERSION 170200
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#pragma shader_feature EDITOR_VISUALIZATION
|
|
|
|
#define SHADERPASS SHADERPASS_META
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
|
|
|
|
#define ASE_NEEDS_TEXTURE_COORDINATES0
|
|
#define ASE_NEEDS_FRAG_TEXTURE_COORDINATES0
|
|
|
|
|
|
struct Attributes
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 texcoord : TEXCOORD0;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct PackedVaryings
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 positionWS : TEXCOORD0;
|
|
#endif
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BaseTexture_ST;
|
|
float _Smoothness;
|
|
float _Radius;
|
|
float _ScreenSpaceOutlineIntensity;
|
|
half3 _ScreenSpaceOutlineColor;
|
|
float _ScreenSpaceOutlineWidth;
|
|
float _Surface;
|
|
/*ase_srp_batcher*/
|
|
CBUFFER_END
|
|
|
|
sampler2D _BaseTexture;
|
|
|
|
|
|
|
|
PackedVaryings VertexFunction( Attributes input )
|
|
{
|
|
PackedVaryings output;
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
UNITY_TRANSFER_INSTANCE_ID(input, output);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
|
|
|
|
output.ase_texcoord1.xy = input.texcoord.xy;
|
|
|
|
//setting value to unused interpolator channels and avoid initialization warnings
|
|
output.ase_texcoord1.zw = 0;
|
|
|
|
float3 positionWS = TransformObjectToWorld( input.positionOS.xyz );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
output.positionWS = positionWS;
|
|
#endif
|
|
|
|
output.positionCS = UnityMetaVertexPosition( input.positionOS.xyz, input.texcoord1.xy, input.texcoord2.xy );
|
|
return output;
|
|
}
|
|
|
|
PackedVaryings vert ( Attributes input )
|
|
{
|
|
return VertexFunction( input );
|
|
}
|
|
|
|
half4 frag(PackedVaryings input ) : SV_TARGET
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(input);
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 PositionWS = input.positionWS;
|
|
#endif
|
|
|
|
float4 ShadowCoord = float4( 0, 0, 0, 0 );
|
|
|
|
float2 temp_cast_0 = (2.0).xx;
|
|
float2 temp_cast_1 = (-1.0).xx;
|
|
float2 texCoord12 = input.ase_texcoord1.xy * temp_cast_0 + temp_cast_1;
|
|
float smoothstepResult13 = smoothstep( _Radius , ( _Radius - _Smoothness ) , length( texCoord12 ));
|
|
float2 uv_BaseTexture = input.ase_texcoord1.xy * _BaseTexture_ST.xy + _BaseTexture_ST.zw;
|
|
float layeredBlendVar18 = smoothstepResult13;
|
|
float4 layeredBlend18 = ( lerp( float4( 1,1,1,1 ),tex2D( _BaseTexture, uv_BaseTexture ) , layeredBlendVar18 ) );
|
|
|
|
|
|
float3 BaseColor = layeredBlend18.rgb;
|
|
float3 Emission = 0;
|
|
float Alpha = 1;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#if defined(_ALPHATEST_ON)
|
|
AlphaDiscard( Alpha, AlphaClipThreshold );
|
|
#endif
|
|
|
|
MetaInput metaInput = (MetaInput)0;
|
|
metaInput.Albedo = BaseColor;
|
|
metaInput.Emission = Emission;
|
|
return UnityMetaFragment(metaInput);
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
}
|
|
|
|
CustomEditor "UnityEditor.ShaderGraphUnlitGUI"
|
|
FallBack "Hidden/Shader Graph/FallbackError"
|
|
|
|
Fallback Off
|
|
}
|
|
/*ASEBEGIN
|
|
Version=19904
|
|
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;10;-1408,-32;Inherit;False;Constant;_1;-1;0;0;Create;True;0;0;0;False;0;False;-1;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;11;-1408,-112;Inherit;False;Constant;_2;2;0;0;Create;True;0;0;0;False;0;False;2;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;7;-1280,80;Inherit;False;Property;_Smoothness;Smoothness;2;0;Create;True;0;0;0;False;0;False;0.5;0.5;0.01;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;12;-1280,-112;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleSubtractOpNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;8;-992,48;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.LengthOpNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;9;-992,-16;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;6;-1280,16;Inherit;False;Property;_Radius;Radius;1;0;Create;True;0;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SmoothstepOpNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;13;-864,0;Inherit;True;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;5;-944,-240;Inherit;True;Property;_BaseTexture;BaseTexture;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;False;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
|
|
Node;AmplifyShaderEditor.LayeredBlendNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;18;-624,-240;Inherit;False;6;0;FLOAT;0;False;1;COLOR;1,1,1,1;False;2;COLOR;1,1,1,1;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;19;-455.1483,-37.39032;Inherit;False;Constant;_Float0;Float 0;3;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;71;-192,-336;Float;False;True;-1;3;UnityEditor.ShaderGraphUnlitGUI;300;20;Mingle/Floor/White Horizon;df83b33f62768f64cb5fff5416086758;True;Forward;0;0;Forward;10;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;UniversalMaterialType=ComplexLit;IgnoreProjector=True;True;2;False;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=UniversalForwardOnly;True;0;False;0;;0;0;Standard;14;Workflow;1;0;Surface;0;0; Blend;0;0;Two Sided;1;0;Alpha Clipping;0;0;Fragment Normal Space;0;0;Cast Shadows;1;0;Receive Shadows;2;0;Specular Highlights;2;0;Environment Reflections;2;0;Receive SSAO;1;0;GPU Instancing;1;0;LOD CrossFade;1;0;NiloToon Screen Space Outline;0;0;0;5;True;True;True;True;True;False;;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;72;-192,-104.4;Float;False;False;-1;3;UnityEditor.ShaderGraphUnlitGUI;300;20;New Amplify Shader;df83b33f62768f64cb5fff5416086758;True;ShadowCaster;0;1;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;UniversalMaterialType=ComplexLit;IgnoreProjector=True;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;73;-192,-71.39999;Float;False;False;-1;3;UnityEditor.ShaderGraphUnlitGUI;300;20;New Amplify Shader;df83b33f62768f64cb5fff5416086758;True;DepthOnly;0;2;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;UniversalMaterialType=ComplexLit;IgnoreProjector=True;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;True;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;75;-192,-38.39999;Float;False;False;-1;3;UnityEditor.ShaderGraphUnlitGUI;300;20;New Amplify Shader;df83b33f62768f64cb5fff5416086758;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;UniversalMaterialType=ComplexLit;IgnoreProjector=True;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode, AmplifyShaderEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;76;-176,192;Float;False;False;-1;3;UnityEditor.ShaderGraphUnlitGUI;300;20;New Amplify Shader;df83b33f62768f64cb5fff5416086758;True;DepthNormalsOnly;0;3;DepthNormalsOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;UniversalMaterialType=ComplexLit;IgnoreProjector=True;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormalsOnly;False;False;0;;0;0;Standard;0;False;0
|
|
WireConnection;12;0;11;0
|
|
WireConnection;12;1;10;0
|
|
WireConnection;8;0;6;0
|
|
WireConnection;8;1;7;0
|
|
WireConnection;9;0;12;0
|
|
WireConnection;13;0;9;0
|
|
WireConnection;13;1;6;0
|
|
WireConnection;13;2;8;0
|
|
WireConnection;18;0;13;0
|
|
WireConnection;18;2;5;0
|
|
WireConnection;71;0;18;0
|
|
WireConnection;71;3;19;0
|
|
WireConnection;71;4;19;0
|
|
ASEEND*/
|
|
//CHKSM=8B1CA8DE0570E445AF37A3658FBEA2444B0B4CEB |