Alpha Clipping broken in Application Spacewarp URP 2022.2 fork

,

I am currently using the 2022.2 URP fork for motion vectors. After much troubleshooting, I found that enabling Alpha Clipping or Allow Material Override in a shader graph return an error, and do not work.

The error is :

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Rendering.Universal.ShaderGraph.CorePasses.AddAlphaClipControlToPass (UnityEditor.ShaderGraph.PassDescriptor& pass, UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget target) (at ./Library/PackageCache/com.unity.render-pipelines.universal@428604577a/Editor/ShaderGraph/Targets/UniversalTarget.cs:858)
UnityEditor.Rendering.Universal.ShaderGraph.CorePasses.MotionVectors (UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget target) (at ./Library/PackageCache/com.unity.render-pipelines.universal@428604577a/Editor/ShaderGraph/Targets/UniversalTarget.cs:1090)
UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget+SubShaders.LitComputeDotsSubShader (UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget target, UnityEditor.Rendering.Universal.ShaderGraph.WorkflowMode workflowMode, System.String renderType, System.String renderQueue, System.String disableBatchingTag, System.Boolean complexLit, System.Boolean blendModePreserveSpecular) (at ./Library/PackageCache/com.unity.render-pipelines.universal@428604577a/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs:370)
UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget.Setup (UnityEditor.ShaderGraph.TargetSetupContext& context) (at ./Library/PackageCache/com.unity.render-pipelines.universal@428604577a/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs:93)
UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget.Setup (UnityEditor.ShaderGraph.TargetSetupContext& context) (at ./Library/PackageCache/com.unity.render-pipelines.universal@428604577a/Editor/ShaderGraph/Targets/UniversalTarget.cs:360)
UnityEditor.ShaderGraph.Generator..ctor (UnityEditor.ShaderGraph.GraphData graphData, UnityEditor.ShaderGraph.AbstractMaterialNode outputNode, UnityEditor.ShaderGraph.GenerationMode mode, System.String primaryShaderName, UnityEditor.ShaderGraph.Target[] targets, UnityEditor.ShaderGraph.AssetCollection assetCollection, System.Boolean humanReadable) (at ./Library/PackageCache/com.unity.shadergraph@428604577a/Editor/Generation/Processors/Generator.cs:111)
UnityEditor.ShaderGraph.Drawing.PreviewManager.CompileMasterNodeShader () (at ./Library/PackageCache/com.unity.shadergraph@428604577a/Editor/Drawing/PreviewManager.cs:1251)
UnityEditor.ShaderGraph.Drawing.PreviewManager.KickOffShaderCompilations () (at ./Library/PackageCache/com.unity.shadergraph@428604577a/Editor/Drawing/PreviewManager.cs:828)
UnityEditor.ShaderGraph.Drawing.PreviewManager.UpdateShaders () (at ./Library/PackageCache/com.unity.shadergraph@428604577a/Editor/Drawing/PreviewManager.cs:882)
UnityEditor.ShaderGraph.Drawing.PreviewManager.RenderPreviews (UnityEditor.EditorWindow editorWindow, System.Boolean requestShaders) (at ./Library/PackageCache/com.unity.shadergraph@428604577a/Editor/Drawing/PreviewManager.cs:534)
UnityEditor.ShaderGraph.Drawing.GraphEditorView.HandleGraphChanges (System.Boolean wasUndoRedoPerformed) (at ./Library/PackageCache/com.unity.shadergraph@428604577a/Editor/Drawing/Views/GraphEditorView.cs:685)
UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow.Update () (at ./Library/PackageCache/com.unity.shadergraph@428604577a/Editor/Drawing/MaterialGraphEditWindow.cs:384)
UnityEditor.HostView.SendUpdate () (at <ae93fefe62eb49e6b9ef3807ffd33dc7>:0)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <ae93fefe62eb49e6b9ef3807ffd33dc7>:0)

Which ends at the function:

internal static void AddAlphaClipControlToPass(ref PassDescriptor pass, UniversalTarget target)
{
if (target.allowMaterialOverride)
pass.keywords.Add(CoreKeywordDescriptors.AlphaTestOn);
else if (target.alphaClip)
pass.defines.Add(CoreKeywordDescriptors.AlphaTestOn, 1);
}

Any help in resolving this would be life saving.

Found this issue that fixed my problem:

This seems like an easy fix to add Oculus peoples.

Thanks for identifying this @NoteMEdown . I’ll make sure it gets routed to the right team here at Unity.