// Toony Colors Pro+Mobile 2 // (c) 2014-2025 Jean Moreno Shader "Reset/BaseStructureShader" { Properties { [TCP2HeaderHelp(Base)] _BaseColor ("Color", Color) = (1,1,1,1) [TCP2ColorNoAlpha] _HColor ("Highlight Color", Color) = (0.75,0.75,0.75,1) [TCP2ColorNoAlpha] _SColor ("Shadow Color", Color) = (0.2,0.2,0.2,1) [MainTexture] _BaseMap ("Albedo", 2D) = "white" {} [TCP2Separator] [TCP2Header(Ramp Shading)] _RampThreshold ("Threshold", Range(0.01,1)) = 0.5 _RampSmoothing ("Smoothing", Range(0.001,1)) = 0.5 [TCP2Separator] [TCP2HeaderHelp(Rim Lighting)] [Toggle(TCP2_RIM_LIGHTING)] _UseRim ("Enable Rim Lighting", Float) = 0 [TCP2ColorNoAlpha] _RimColor ("Rim Color", Color) = (0.8,0.8,0.8,0.5) _RimMin ("Rim Min", Range(0,2)) = 0.5 _RimMax ("Rim Max", Range(0,2)) = 1 //Rim Direction _RimDir ("Rim Direction", Vector) = (0,0,1,1) [TCP2Separator] [TCP2HeaderHelp(Normal Mapping)] [Toggle(_NORMALMAP)] _UseNormalMap ("Enable Normal Mapping", Float) = 0 [NoScaleOffset] _BumpMap ("Normal Map", 2D) = "bump" {} _BumpScale ("Scale", Float) = 1 [NoScaleOffset] _ParallaxMap ("Height Map", 2D) = "black" {} _Parallax ("Height", Range(0.005,0.08)) = 0.02 [TCP2Separator] [HideInInspector] __BeginGroup_ShadowHSV ("Shadow Line", Float) = 0 _ShadowLineThreshold ("Threshold", Range(0,1)) = 0.5 _ShadowLineSmoothing ("Smoothing", Range(0.001,0.1)) = 0.015 _ShadowLineStrength ("Strength", Float) = 1 _ShadowLineColor ("Color (RGB) Opacity (A)", Color) = (0,0,0,1) [HideInInspector] __EndGroup ("Shadow Line", Float) = 0 [ToggleOff(_RECEIVE_SHADOWS_OFF)] _ReceiveShadowsOff ("Receive Shadows", Float) = 1 // Avoid compile error if the properties are ending with a drawer [HideInInspector] __dummy__ ("unused", Float) = 0 } SubShader { Tags { "RenderPipeline" = "UniversalPipeline" "RenderType"="Opaque" } HLSLINCLUDE #define fixed half #define fixed2 half2 #define fixed3 half3 #define fixed4 half4 #if UNITY_VERSION >= 202020 #define URP_10_OR_NEWER #endif #if UNITY_VERSION >= 202120 #define URP_12_OR_NEWER #endif #if UNITY_VERSION >= 202220 #define URP_14_OR_NEWER #endif // Texture/Sampler abstraction #define TCP2_TEX2D_WITH_SAMPLER(tex) TEXTURE2D(tex); SAMPLER(sampler##tex) #define TCP2_TEX2D_NO_SAMPLER(tex) TEXTURE2D(tex) #define TCP2_TEX2D_SAMPLE(tex, samplertex, coord) SAMPLE_TEXTURE2D(tex, sampler##samplertex, coord) #define TCP2_TEX2D_SAMPLE_LOD(tex, samplertex, coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler##samplertex, coord, lod) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" // Uniforms // Shader Properties TCP2_TEX2D_WITH_SAMPLER(_ParallaxMap); TCP2_TEX2D_WITH_SAMPLER(_BumpMap); TCP2_TEX2D_WITH_SAMPLER(_BaseMap); CBUFFER_START(UnityPerMaterial) // Shader Properties float _Parallax; float _BumpScale; float4 _BaseMap_ST; fixed4 _BaseColor; float _RampThreshold; float _RampSmoothing; float _ShadowLineThreshold; float _ShadowLineStrength; float _ShadowLineSmoothing; fixed4 _ShadowLineColor; float4 _RimDir; float _RimMin; float _RimMax; fixed4 _RimColor; fixed4 _SColor; fixed4 _HColor; CBUFFER_END #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ParallaxMapping.hlsl" // Calculates UV offset for parallax bump mapping inline float2 TCP2_ParallaxOffset( half h, half height, half3 viewDir ) { h = h * height - height/2.0; float3 v = normalize(viewDir); v.z += 0.42; return h * (v.xy / v.z); } // Cubic pulse function // Adapted from: http://www.iquilezles.org/www/articles/functions/functions.htm (c) 2017 - Inigo Quilez - MIT License float linearPulse(float c, float w, float x) { x = abs(x - c); if (x > w) { return 0; } x /= w; return 1 - x; } // Built-in renderer (CG) to SRP (HLSL) bindings #define UnityObjectToClipPos TransformObjectToHClip #define _WorldSpaceLightPos0 _MainLightPosition ENDHLSL Pass { Name "Main" Tags { "LightMode"="UniversalForward" } HLSLPROGRAM // Required to compile gles 2.0 with standard SRP library // All shaders must be compiled with HLSLcc and currently only gles is not using HLSLcc by default #pragma prefer_hlslcc gles #pragma exclude_renderers d3d11_9x #pragma target 3.0 // ------------------------------------- // Material keywords #pragma shader_feature_local _ _RECEIVE_SHADOWS_OFF // ------------------------------------- // Universal Render 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_fragment _ _ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING #pragma multi_compile _ SHADOWS_SHADOWMASK #pragma multi_compile _ _CLUSTER_LIGHT_LOOP #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" // ------------------------------------- //-------------------------------------- // GPU Instancing #pragma multi_compile_instancing #pragma vertex Vertex #pragma fragment Fragment //-------------------------------------- // Toony Colors Pro 2 keywords #pragma shader_feature_local_fragment TCP2_RIM_LIGHTING #pragma shader_feature_local _NORMALMAP // vertex input struct Attributes { float4 vertex : POSITION; float3 normal : NORMAL; float4 tangent : TANGENT; float4 texcoord0 : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; // vertex output / fragment input struct Varyings { float4 positionCS : SV_POSITION; float3 normal : NORMAL; float4 worldPosAndFog : TEXCOORD0; #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) float4 shadowCoord : TEXCOORD1; // compute shadow coord per-vertex for the main light #endif #ifdef _ADDITIONAL_LIGHTS_VERTEX half3 vertexLights : TEXCOORD2; #endif float3 pack0 : TEXCOORD3; /* pack0.xyz = tangent */ float3 pack1 : TEXCOORD4; /* pack1.xyz = bitangent */ float2 pack2 : TEXCOORD5; /* pack2.xy = texcoord0 */ UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; #if USE_FORWARD_PLUS || USE_CLUSTER_LIGHT_LOOP // Fake InputData struct needed for Forward+ macro struct InputDataForwardPlusDummy { float3 positionWS; float2 normalizedScreenSpaceUV; }; #endif Varyings Vertex(Attributes input) { Varyings output = (Varyings)0; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); // Texture Coordinates output.pack2.xy.xy = input.texcoord0.xy * _BaseMap_ST.xy + _BaseMap_ST.zw; float3 worldPos = mul(UNITY_MATRIX_M, input.vertex).xyz; VertexPositionInputs vertexInput = GetVertexPositionInputs(input.vertex.xyz); #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) output.shadowCoord = GetShadowCoord(vertexInput); #endif VertexNormalInputs vertexNormalInput = GetVertexNormalInputs(input.normal, input.tangent); #ifdef _ADDITIONAL_LIGHTS_VERTEX // Vertex lighting output.vertexLights = VertexLighting(vertexInput.positionWS, vertexNormalInput.normalWS); #endif // world position output.worldPosAndFog = float4(vertexInput.positionWS.xyz, 0); // normal output.normal = normalize(vertexNormalInput.normalWS); // tangent output.pack0.xyz = vertexNormalInput.tangentWS; output.pack1.xyz = vertexNormalInput.bitangentWS; // clip position output.positionCS = vertexInput.positionCS; return output; } half4 Fragment(Varyings input ) : SV_Target { UNITY_SETUP_INSTANCE_ID(input); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); float3 positionWS = input.worldPosAndFog.xyz; float3 normalWS = normalize(input.normal); half3 viewDirWS = GetWorldSpaceNormalizeViewDir(positionWS); half3 tangentWS = input.pack0.xyz; half3 bitangentWS = input.pack1.xyz; #if defined(_NORMALMAP) half3x3 tangentToWorldMatrix = half3x3(tangentWS.xyz, bitangentWS.xyz, normalWS.xyz); //Parallax Offset float __parallaxHeightMap = ( TCP2_TEX2D_SAMPLE(_ParallaxMap, _ParallaxMap, input.pack2.xy).a ); float __parallaxHeight = ( _Parallax ); half height = __parallaxHeightMap; half3 viewDirTS = GetViewDirectionTangentSpace(half4(tangentWS, 0), normalWS, viewDirWS); float2 offset = TCP2_ParallaxOffset(height, __parallaxHeight, viewDirTS); input.pack2.xy += offset; #endif // Shader Properties Sampling float4 __normalMap = ( TCP2_TEX2D_SAMPLE(_BumpMap, _BumpMap, input.pack2.xy).rgba ); float __bumpScale = ( _BumpScale ); float4 __albedo = ( TCP2_TEX2D_SAMPLE(_BaseMap, _BaseMap, input.pack2.xy).rgba ); float4 __mainColor = ( _BaseColor.rgba ); float __alpha = ( __albedo.a * __mainColor.a ); float __ambientIntensity = ( 1.0 ); float __rampThreshold = ( _RampThreshold ); float __rampSmoothing = ( _RampSmoothing ); float __shadowLineThreshold = ( _ShadowLineThreshold ); float __shadowLineStrength = ( _ShadowLineStrength ); float __shadowLineSmoothing = ( _ShadowLineSmoothing ); float4 __shadowLineColor = ( _ShadowLineColor.rgba ); float3 __rimDir = ( _RimDir.xyz ); float __rimMin = ( _RimMin ); float __rimMax = ( _RimMax ); float3 __rimColor = ( _RimColor.rgb ); float __rimStrength = ( 1.0 ); float3 __shadowColor = ( _SColor.rgb ); float3 __highlightColor = ( _HColor.rgb ); #if defined(_NORMALMAP) half4 normalMap = __normalMap; half3 normalTS = UnpackNormalScale(normalMap, __bumpScale); #if defined(_NORMALMAP) normalWS = normalize( mul(normalTS, tangentToWorldMatrix) ); #endif #endif // main texture half3 albedo = __albedo.rgb; half alpha = __alpha; half3 emission = half3(0,0,0); albedo *= __mainColor.rgb; // main light: direction, color, distanceAttenuation, shadowAttenuation #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) float4 shadowCoord = input.shadowCoord; #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) float4 shadowCoord = TransformWorldToShadowCoord(positionWS); #else float4 shadowCoord = float4(0, 0, 0, 0); #endif #if defined(URP_10_OR_NEWER) #if defined(SHADOWS_SHADOWMASK) && defined(LIGHTMAP_ON) half4 shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV); #elif !defined (LIGHTMAP_ON) half4 shadowMask = unity_ProbesOcclusion; #else half4 shadowMask = half4(1, 1, 1, 1); #endif Light mainLight = GetMainLight(shadowCoord, positionWS, shadowMask); #else Light mainLight = GetMainLight(shadowCoord); #endif #if defined(_SCREEN_SPACE_OCCLUSION) || defined(USE_FORWARD_PLUS) || defined(USE_CLUSTER_LIGHT_LOOP) float2 normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS); #endif // ambient or lightmap // Samples SH fully per-pixel. SampleSHVertex and SampleSHPixel functions // are also defined in case you want to sample some terms per-vertex. half3 bakedGI = SampleSH(normalWS); half occlusion = 1; half3 indirectDiffuse = bakedGI; indirectDiffuse *= occlusion * albedo * __ambientIntensity; half3 lightDir = mainLight.direction; half3 lightColor = mainLight.color.rgb; half atten = mainLight.shadowAttenuation * mainLight.distanceAttenuation; half ndl = dot(normalWS, lightDir); half3 ramp; half rampThreshold = __rampThreshold; half rampSmooth = __rampSmoothing * 0.5; ndl = saturate(ndl); ramp = smoothstep(rampThreshold - rampSmooth, rampThreshold + rampSmooth, ndl); // apply attenuation ramp *= atten; //Shadow Line float ndlAtten = ndl * atten; float shadowLineThreshold = __shadowLineThreshold; float shadowLineStrength = __shadowLineStrength; float shadowLineSmoothing = __shadowLineSmoothing; float shadowLine = min(linearPulse(ndlAtten, shadowLineSmoothing, shadowLineThreshold) * shadowLineStrength, 1.0); half4 shadowLineColor = __shadowLineColor; ramp = lerp(ramp.rgb, shadowLineColor.rgb, shadowLine * shadowLineColor.a); half3 color = half3(0,0,0); // Rim Lighting #if defined(TCP2_RIM_LIGHTING) half3 rViewDir = viewDirWS; half3 rimDir = __rimDir; rViewDir = normalize(UNITY_MATRIX_V[0].xyz * rimDir.x + UNITY_MATRIX_V[1].xyz * rimDir.y + UNITY_MATRIX_V[2].xyz * rimDir.z); half rim = 1.0f - saturate(dot(rViewDir, normalWS)); rim = ( rim ); half rimMin = __rimMin; half rimMax = __rimMax; rim = smoothstep(rimMin, rimMax, rim); half3 rimColor = __rimColor; half rimStrength = __rimStrength; //Rim light mask emission.rgb += ndl * atten * rim * rimColor * rimStrength; #endif half3 accumulatedRamp = ramp * max(lightColor.r, max(lightColor.g, lightColor.b)); half3 accumulatedColors = ramp * lightColor.rgb; // Additional lights loop #ifdef _ADDITIONAL_LIGHTS uint pixelLightCount = GetAdditionalLightsCount(); #if USE_FORWARD_PLUS || USE_CLUSTER_LIGHT_LOOP // Additional directional lights in Forward+ for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++) { CLUSTER_LIGHT_LOOP_SUBTRACTIVE_LIGHT_CHECK Light light = GetAdditionalLight(lightIndex, positionWS, shadowMask); #if defined(_LIGHT_LAYERS) if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) #endif { half atten = light.shadowAttenuation * light.distanceAttenuation; #if defined(_LIGHT_LAYERS) half3 lightDir = half3(0, 1, 0); half3 lightColor = half3(0, 0, 0); if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) { lightColor = light.color.rgb; lightDir = light.direction; } #else half3 lightColor = light.color.rgb; half3 lightDir = light.direction; #endif half ndl = dot(normalWS, lightDir); half3 ramp; ndl = saturate(ndl); ramp = smoothstep(rampThreshold - rampSmooth, rampThreshold + rampSmooth, ndl); // apply attenuation (shadowmaps & point/spot lights attenuation) ramp *= atten; //Shadow Line float ndlAtten = ndl * atten; float shadowLineThreshold = __shadowLineThreshold; float shadowLineStrength = __shadowLineStrength; float shadowLineSmoothing = __shadowLineSmoothing; float shadowLine = min(linearPulse(ndlAtten, shadowLineSmoothing, shadowLineThreshold) * shadowLineStrength, 1.0); half4 shadowLineColor = __shadowLineColor; ramp = lerp(ramp.rgb, shadowLineColor.rgb, shadowLine * shadowLineColor.a); accumulatedRamp += ramp * max(lightColor.r, max(lightColor.g, lightColor.b)); accumulatedColors += ramp * lightColor.rgb; #if defined(TCP2_RIM_LIGHTING) // Rim light mask half3 rimColor = __rimColor; half rimStrength = __rimStrength; emission.rgb += ndl * atten * rim * rimColor * rimStrength; #endif } } // Data with dummy struct used in Forward+ macro (LIGHT_LOOP_BEGIN) InputDataForwardPlusDummy inputData; inputData.normalizedScreenSpaceUV = normalizedScreenSpaceUV; inputData.positionWS = positionWS; #endif LIGHT_LOOP_BEGIN(pixelLightCount) { #if defined(URP_10_OR_NEWER) Light light = GetAdditionalLight(lightIndex, positionWS, shadowMask); #else Light light = GetAdditionalLight(lightIndex, positionWS); #endif half atten = light.shadowAttenuation * light.distanceAttenuation; #if defined(_LIGHT_LAYERS) half3 lightDir = half3(0, 1, 0); half3 lightColor = half3(0, 0, 0); if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) { lightColor = light.color.rgb; lightDir = light.direction; } #else half3 lightColor = light.color.rgb; half3 lightDir = light.direction; #endif half ndl = dot(normalWS, lightDir); half3 ramp; ndl = saturate(ndl); ramp = smoothstep(rampThreshold - rampSmooth, rampThreshold + rampSmooth, ndl); // apply attenuation (shadowmaps & point/spot lights attenuation) ramp *= atten; //Shadow Line float ndlAtten = ndl * atten; float shadowLineThreshold = __shadowLineThreshold; float shadowLineStrength = __shadowLineStrength; float shadowLineSmoothing = __shadowLineSmoothing; float shadowLine = min(linearPulse(ndlAtten, shadowLineSmoothing, shadowLineThreshold) * shadowLineStrength, 1.0); half4 shadowLineColor = __shadowLineColor; ramp = lerp(ramp.rgb, shadowLineColor.rgb, shadowLine * shadowLineColor.a); accumulatedRamp += ramp * max(lightColor.r, max(lightColor.g, lightColor.b)); accumulatedColors += ramp * lightColor.rgb; #if defined(TCP2_RIM_LIGHTING) // Rim light mask half3 rimColor = __rimColor; half rimStrength = __rimStrength; emission.rgb += ndl * atten * rim * rimColor * rimStrength; #endif } LIGHT_LOOP_END #endif #ifdef _ADDITIONAL_LIGHTS_VERTEX color += input.vertexLights * albedo; #endif accumulatedRamp = saturate(accumulatedRamp); half3 shadowColor = (1 - accumulatedRamp.rgb) * __shadowColor; accumulatedRamp = accumulatedColors.rgb * __highlightColor + shadowColor; color += albedo * accumulatedRamp; // apply ambient color += indirectDiffuse; color += emission; return half4(color, alpha); } ENDHLSL } // Depth & Shadow Caster Passes HLSLINCLUDE #if defined(SHADOW_CASTER_PASS) || defined(DEPTH_ONLY_PASS) #define fixed half #define fixed2 half2 #define fixed3 half3 #define fixed4 half4 float3 _LightDirection; float3 _LightPosition; struct Attributes { float4 vertex : POSITION; float3 normal : NORMAL; float4 texcoord0 : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct Varyings { float4 positionCS : SV_POSITION; #if defined(DEPTH_NORMALS_PASS) float3 normalWS : TEXCOORD0; #endif float3 pack0 : TEXCOORD1; /* pack0.xyz = positionWS */ float2 pack1 : TEXCOORD2; /* pack1.xy = texcoord0 */ #if defined(DEPTH_ONLY_PASS) UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO #endif }; float4 GetShadowPositionHClip(Attributes input) { float3 positionWS = TransformObjectToWorld(input.vertex.xyz); float3 normalWS = TransformObjectToWorldNormal(input.normal); #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 return positionCS; } Varyings ShadowDepthPassVertex(Attributes input) { Varyings output = (Varyings)0; UNITY_SETUP_INSTANCE_ID(input); #if defined(DEPTH_ONLY_PASS) UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); #endif // Texture Coordinates output.pack1.xy.xy = input.texcoord0.xy * _BaseMap_ST.xy + _BaseMap_ST.zw; float3 worldPos = mul(UNITY_MATRIX_M, input.vertex).xyz; VertexPositionInputs vertexInput = GetVertexPositionInputs(input.vertex.xyz); output.pack0.xyz = vertexInput.positionWS; #if defined(DEPTH_ONLY_PASS) output.positionCS = TransformObjectToHClip(input.vertex.xyz); #if defined(DEPTH_NORMALS_PASS) float3 normalWS = TransformObjectToWorldNormal(input.normal); output.normalWS = normalWS; // already normalized in TransformObjectToWorldNormal #endif #elif defined(SHADOW_CASTER_PASS) output.positionCS = GetShadowPositionHClip(input); #else output.positionCS = float4(0,0,0,0); #endif return output; } half4 ShadowDepthPassFragment( Varyings input #if defined(DEPTH_NORMALS_PASS) && defined(_WRITE_RENDERING_LAYERS) #if UNITY_VERSION >= 60020000 , out uint outRenderingLayers : SV_Target1 #else , out float4 outRenderingLayers : SV_Target1 #endif #endif ) : SV_TARGET { #if defined(DEPTH_ONLY_PASS) UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); #endif float3 positionWS = input.pack0.xyz; // Shader Properties Sampling float4 __albedo = ( TCP2_TEX2D_SAMPLE(_BaseMap, _BaseMap, input.pack1.xy).rgba ); float4 __mainColor = ( _BaseColor.rgba ); float __alpha = ( __albedo.a * __mainColor.a ); half3 viewDirWS = GetWorldSpaceNormalizeViewDir(positionWS); half3 albedo = half3(1,1,1); half alpha = __alpha; half3 emission = half3(0,0,0); #if defined(DEPTH_NORMALS_PASS) #if defined(_WRITE_RENDERING_LAYERS) #if UNITY_VERSION >= 60020000 outRenderingLayers = EncodeMeshRenderingLayer(); #else outRenderingLayers = float4(EncodeMeshRenderingLayer(GetMeshRenderingLayer()), 0, 0, 0); #endif #endif #if defined(URP_12_OR_NEWER) return float4(input.normalWS.xyz, 0.0); #else return float4(PackNormalOctRectEncode(TransformWorldToViewDir(input.normalWS, true)), 0.0, 0.0); #endif #endif return 0; } #endif ENDHLSL Pass { Name "ShadowCaster" Tags { "LightMode" = "ShadowCaster" } ZWrite On ZTest LEqual HLSLPROGRAM // Required to compile gles 2.0 with standard srp library #pragma prefer_hlslcc gles #pragma exclude_renderers d3d11_9x #pragma target 2.0 // using simple #define doesn't work, we have to use this instead #pragma multi_compile SHADOW_CASTER_PASS //-------------------------------------- // GPU Instancing #pragma multi_compile_instancing #pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW #pragma vertex ShadowDepthPassVertex #pragma fragment ShadowDepthPassFragment #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" ENDHLSL } Pass { Name "DepthOnly" Tags { "LightMode" = "DepthOnly" } ZWrite On ColorMask 0 HLSLPROGRAM // Required to compile gles 2.0 with standard srp library #pragma prefer_hlslcc gles #pragma exclude_renderers d3d11_9x #pragma target 2.0 //-------------------------------------- // GPU Instancing #pragma multi_compile_instancing // using simple #define doesn't work, we have to use this instead #pragma multi_compile DEPTH_ONLY_PASS #pragma vertex ShadowDepthPassVertex #pragma fragment ShadowDepthPassFragment ENDHLSL } Pass { Name "DepthNormals" Tags { "LightMode" = "DepthNormals" } ZWrite On HLSLPROGRAM #pragma exclude_renderers gles gles3 glcore #pragma target 2.0 #pragma multi_compile_instancing // using simple #define doesn't work, we have to use this instead #pragma multi_compile DEPTH_ONLY_PASS #pragma multi_compile DEPTH_NORMALS_PASS #pragma vertex ShadowDepthPassVertex #pragma fragment ShadowDepthPassFragment ENDHLSL } } FallBack "Hidden/InternalErrorShader" CustomEditor "ToonyColorsPro.ShaderGenerator.MaterialInspector_SG2" } /* TCP_DATA u config(ver:"2.9.20";unity:"6000.2.1f1";tmplt:"SG2_Template_URP";features:list["UNITY_5_4","UNITY_5_5","UNITY_5_6","UNITY_2017_1","UNITY_2018_1","UNITY_2018_2","UNITY_2018_3","UNITY_2019_1","UNITY_2019_2","UNITY_2019_3","UNITY_2019_4","UNITY_2020_1","UNITY_2021_1","UNITY_2021_2","UNITY_2022_2","UNITY_6000_2","UNITY_6000_1","UNITY_6000_0","ENABLE_DEPTH_NORMALS_PASS","ENABLE_FORWARD_PLUS","BUMP","BUMP_SCALE","BUMP_SHADER_FEATURE","PARALLAX","RIM","SHADOW_LINE","TEMPLATE_LWRP","RIM_DIR","RIM_SHADER_FEATURE","RIM_LIGHTMASK"];flags:list[];flags_extra:dict[];keywords:dict[RENDER_TYPE="Opaque",RampTextureDrawer="[TCP2Gradient]",RampTextureLabel="Ramp Texture",SHADER_TARGET="3.0",RIM_LABEL="Rim Lighting"];shaderProperties:list[];customTextures:list[];codeInjection:codeInjection(injectedFiles:list[];mark:False);matLayers:list[]) */ /* TCP_HASH 26ac4c997cc75da0155d69e41faede51 */