Custom Shadows are missing in Builds

Hey everyone,

we are currently developing a game which uses custom toon shaders (utilizing Shader Graphs).
In Unity 2022.x everything works just fine, but in Unity 6 the materials using our custom shaders do not receive shadows any more in builds. Within the editor everything is as intended but in any build (no matter which quality setting, target platform etc.) the custom shadows are gone.
To be precise: The shader is unlit and the shadows are created manually using a toon ramp and a little Shader Graph magic.

I have created a debug project with the shaders.

The left image is from the editor play mode and the right from a Windows standalone build:
image

You can download the debug project here:

Maybe someone finds the solution. We have been trying to resolve the issue for some days now.

Thank you all in advance and happy development to you all.
Garvin

any warnings/errors in player.log?

Nothing. No “Error” or “Warning”:

Mono path[0] = 'D:/Game Dev/roka/Shader Tests/Builds/Test 1/Shader Tests_Data/Managed'
Mono config path = 'D:/Game Dev/roka/Shader Tests/Builds/Test 1/MonoBleedingEdge/etc'
Starting managed debugger on port 56159
Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=0.0.0.0:56159
Found 2 interfaces on host : 0) 192.168.1.11 1) 192.168.128.1
Player connection [51444]  Target information:

Player connection [51444]  * "[IP] 192.168.1.11 [Port] 55000 [Flags] 2 [Guid] 2315352159 [EditorId] 323776274 [Version] 1048832 [Id] WindowsPlayer(2,GARVINS-PC) [Debug] 1 [PackageName] WindowsPlayer [ProjectName] Shader Tests" 

Player connection [51444]  * "[IP] 192.168.128.1 [Port] 55000 [Flags] 2 [Guid] 2315352159 [EditorId] 323776274 [Version] 1048832 [Id] WindowsPlayer(2,GARVINS-PC) [Debug] 1 [PackageName] WindowsPlayer [ProjectName] Shader Tests" 

Player connection [51444] Started UDP target info broadcast (1) on [225.0.0.222:54997].

Initialize engine version: 6000.0.7f1 (7dd95c051e11)
[Subsystems] Discovering subsystems at path D:/Game Dev/roka/Shader Tests/Builds/Test 1/Shader Tests_Data/UnitySubsystems
kGfxThreadingModeSplitJobs is not supported on Direct3D 11. Reverting to kGfxThreadingModeClientWorkerJobs instead.
GfxDevice: creating device client; kGfxThreadingModeClientWorkerJobs
Direct3D:
    Version:  Direct3D 11.0 [level 11.1]
    Renderer: NVIDIA GeForce RTX 3080 Ti (ID=0x2208)
    Vendor:   NVIDIA
    VRAM:     12086 MB
    Driver:   32.0.15.6109
Begin MonoManager ReloadAssembly
- Loaded All Assemblies, in  0.122 seconds
- Finished resetting the current domain, in  0.003 seconds
[PhysX] Initialized MultithreadedTaskDispatcher with 32 workers.
<RI> Initializing input.
New input system (experimental) initialized
Using Windows.Gaming.Input
<RI> Input initialized.
<RI> Initialized touch support.
UnloadTime: 0.520000 ms
RenderGraph is now enabled.
UnityEngine.Debug:ExtractStackTraceNoAlloc (byte*,int,string)
UnityEngine.StackTraceUtility:ExtractStackTrace () (at C:/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:.ctor (UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset) (at ./Library/PackageCache/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs:252)
UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset:CreatePipeline () (at ./Library/PackageCache/com.unity.render-pipelines.universal/Runtime/Data/UniversalRenderPipelineAsset.cs:810)
UnityEngine.Rendering.RenderPipelineAsset:InternalCreatePipeline () (at C:/build/output/unity/unity/Runtime/Export/RenderPipeline/RenderPipelineAsset.cs:15)
UnityEngine.Rendering.RenderPipelineManager:TryPrepareRenderPipeline (UnityEngine.Rendering.RenderPipelineAsset) (at C:/build/output/unity/unity/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:166)
UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset,intptr,UnityEngine.Object) (at C:/build/output/unity/unity/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:139)

(Filename: ./Library/PackageCache/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs Line: 252)

PlayerConnection::Cleanup##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1727261635698,"processId":51400,"allocatedMemory":62300,"memoryLabels":[{"Default":136},{"Thread":1280},{"Manager":17003},{"GfxDevice":72},{"GfxThread":3840},{"Serialization":416},{"JobScheduler":32768},{"String":297},{"HashMap":3584},{"PoolAlloc":192},{"VR":1776},{"NativeArray":720},{"Subsystems":96},{"CoreBusinessMetrics":120}]}

Try enabling strict shader variant matching - maybe the variant it needs is not included in the build.