Shader Error 'AdditionalLightShadow': no matching 4 parameter function

Good afternoon!

I recently moved from 2020.2 to 2021.1 and have come across an error in one of my shaders with the new version with URP. It looks like a function I’d previously been calling ‘AdditionalLightShadow’ with 4 parameters is no longer valid. I have a copy of the project running in 2020.2 and the shader works correctly there, so it looks like that function perhaps changed. Is there a place I can view changes to this sort of thing or the list of built in functions so that I can make the appropriate changes?

Thanks in advance for any pointers/help!

1 Like

I switched to 2021 and Vegetation shader from Unity Boat Attack project works, but I get errors when trying to edit

UnityEditor.ShaderGraph.AbstractMaterialNode.CollectPreviewMaterialProperties (System.Collections.Generic.List`1[T] properties) (at C:/Users/leslv/Documents/Software/unity-editors/2021.1.0b1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs:713)
UnityEditor.ShaderGraph.Drawing.PreviewManager.CollectPreviewProperties (System.Collections.Generic.IEnumerable`1[T] nodesToCollect, UnityEditor.ShaderGraph.PooledList`1[T] perMaterialPreviewProperties) (at C:/Users/leslv/Documents/Software/unity-editors/2021.1.0b1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs:355)
UnityEditor.ShaderGraph.Drawing.PreviewManager.RenderPreviews (System.Boolean requestShaders) (at C:/Users/leslv/Documents/Software/unity-editors/2021.1.0b1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.shadergraph/Editor/Drawing/PreviewManager.cs:442)
UnityEditor.ShaderGraph.Drawing.GraphEditorView.HandleGraphChanges (System.Boolean wasUndoRedoPerformed) (at C:/Users/leslv/Documents/Software/unity-editors/2021.1.0b1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs:659)```

Was able to figure this one out! AdditionalLightShadow looks like it requires the light direction as a third argument now, which I had not been supplying in previous versions of Unity. Found an example usage here: https://github.com/Unity-Technologies/Graphics/blob/master/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl at line 235. Looks like it maybe changed with the new point light shadows?