Search Unity

Question ArgumentNullException: Value cannot be null.

Discussion in 'Universal Render Pipeline' started by Bean_Office, May 29, 2023.

  1. Bean_Office

    Bean_Office

    Joined:
    Jun 18, 2018
    Posts:
    16
    Unity version: 2022.2.10
    I created a Fullscreen Shader in shader graph. I then went to my Render 2D Data and added a "Full screen pass render feature", and added a material with shader on to it. However, anytime I run the game with this option enabled every frame console prints this error:
    Code (CSharp):
    1. ArgumentNullException: Value cannot be null.
    2. Parameter name: material
    3. UnityEngine.Rendering.CommandBuffer.DrawProcedural (UnityEngine.Matrix4x4 matrix, UnityEngine.Material material, System.Int32 shaderPass, UnityEngine.MeshTopology topology, System.Int32 vertexCount, System.Int32 instanceCount, UnityEngine.MaterialPropertyBlock properties) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Graphics/RenderingCommandBuffer.cs:526)
    4. UnityEngine.Rendering.Blitter.DrawTriangle (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Material material, System.Int32 shaderPass) (at ./Library/PackageCache/com.unity.render-pipelines.core@14.0.6/Runtime/Utilities/Blitter.cs:169)
    5. UnityEngine.Rendering.Blitter.BlitTexture (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.RTHandle source, UnityEngine.Vector4 scaleBias, UnityEngine.Material material, System.Int32 pass) (at ./Library/PackageCache/com.unity.render-pipelines.core@14.0.6/Runtime/Utilities/Blitter.cs:239)
    6. UnityEngine.Rendering.Blitter.BlitTexture (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.RTHandle source, UnityEngine.Vector4 scaleBias, System.Single mipLevel, System.Boolean bilinear) (at ./Library/PackageCache/com.unity.render-pipelines.core@14.0.6/Runtime/Utilities/Blitter.cs:191)
    7. UnityEngine.Rendering.Blitter.BlitCameraTexture (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.RTHandle source, UnityEngine.Rendering.RTHandle destination, System.Single mipLevel, System.Boolean bilinear) (at ./Library/PackageCache/com.unity.render-pipelines.core@14.0.6/Runtime/Utilities/Blitter.cs:306)
    8. FullScreenPassRendererFeature+FullScreenRenderPass.ExecutePass (FullScreenPassRendererFeature+FullScreenRenderPass+PassData passData, UnityEngine.Rendering.Universal.RenderingData& renderingData, UnityEngine.Rendering.ScriptableRenderContext& context) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.6/Runtime/RendererFeatures/FullScreenPassRendererFeature.cs:174)
    9. FullScreenPassRendererFeature+FullScreenRenderPass.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.6/Runtime/RendererFeatures/FullScreenPassRendererFeature.cs:138)
    10. UnityEngine.Rendering.Universal.ScriptableRenderer.ExecuteRenderPass (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.ScriptableRenderPass renderPass, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.6/Runtime/ScriptableRenderer.cs:1484)
    11. UnityEngine.Rendering.Universal.ScriptableRenderer.ExecuteBlock (System.Int32 blockIndex, UnityEngine.Rendering.Universal.ScriptableRenderer+RenderBlocks& renderBlocks, UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData, System.Boolean submit) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.6/Runtime/ScriptableRenderer.cs:1440)
    12. UnityEngine.Rendering.Universal.ScriptableRenderer.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.6/Runtime/ScriptableRenderer.cs:1223)
    13. UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderSingleCamera (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.CameraData& cameraData, System.Boolean anyPostProcessingEnabled) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.6/Runtime/UniversalRenderPipeline.cs:642)
    14. UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderCameraStack (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera baseCamera) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.6/Runtime/UniversalRenderPipeline.cs:820)
    15. UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, System.Collections.Generic.List`1[T] cameras) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.6/Runtime/UniversalRenderPipeline.cs:355)
    16. UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, System.Collections.Generic.List`1[T] cameras) (at /Users/bokken/build/output/unity/unity/Runtime/Export/RenderPipeline/RenderPipeline.cs:52)
    17. UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, UnityEngine.Object renderRequest, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at /Users/bokken/build/output/unity/unity/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:126)
    18. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)
    Any ideas on how to fix this? I don't have much experience with URP...
    Also to clarify, I'm making this in a 2D project and while the error is printing only the UI is rendered, no sprites.
     
  2. ElliotB

    ElliotB

    Joined:
    Aug 11, 2013
    Posts:
    289
    I've also encountered this error.

    It appears that the new Blitter API (which replaced the old command buffer Blit) is incompatible with the Universal 2D render pipeline. The required materials for blitting are not initialised.
     
    Bean_Office likes this.
  3. Bean_Office

    Bean_Office

    Joined:
    Jun 18, 2018
    Posts:
    16
    That stinks... Is there any solution for this?
     
  4. ElliotB

    ElliotB

    Joined:
    Aug 11, 2013
    Posts:
    289
    There is a fix in progress but I don't have the issue number (mine was closed)
     
  5. amirivala

    amirivala

    Joined:
    May 29, 2013
    Posts:
    57
    Hey all, is there any fix for this? Im using 2022.3.5?
     
  6. adam-carmichael4

    adam-carmichael4

    Joined:
    Jun 17, 2014
    Posts:
    5
    I also have this issue on 2022.3.5f1 with URP 14.0.8. Any workaround would be hugely appreciated.