lukakldiashvili / Unified-Universal-Blur

UI blur (translucent) effect for Unity.
MIT License
424 stars 33 forks source link

Material passed to Blitter is null and leads to error in Unity 2022.3.5f1 #5

Closed TdXYZ closed 1 year ago

TdXYZ commented 1 year ago

When adding just the render feature and starting the scene, an error happens with the following message:

ArgumentNullException: Value cannot be null.
Parameter name: material
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:521)
UnityEngine.Rendering.Blitter.DrawTriangle (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Material material, System.Int32 shaderPass) (at ./Library/PackageCache/com.unity.render-pipelines.core@14.0.8/Runtime/Utilities/Blitter.cs:192)
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.8/Runtime/Utilities/Blitter.cs:262)
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.8/Runtime/Utilities/Blitter.cs:214)
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.8/Runtime/Utilities/Blitter.cs:342)
Unified.Universal.Blur.UniversalBlurPass.<ExecutePass>g__ProcessEffect|6_0 (UnityEngine.Rendering.ScriptableRenderContext& context, Unified.Universal.Blur.UniversalBlurPass+<>c__DisplayClass6_0& ) (at ./Library/PackageCache/com.unify.unified-universal-blur@34bcea407f/UnifiedUniversalBlur/Scripts/UniversalBlurPass.cs:112)
Unified.Universal.Blur.UniversalBlurPass.ExecutePass (Unified.Universal.Blur.UniversalBlurPass+PassData passData, UnityEngine.Rendering.Universal.RenderingData& renderingData, UnityEngine.Rendering.ScriptableRenderContext& context) (at ./Library/PackageCache/com.unify.unified-universal-blur@34bcea407f/UnifiedUniversalBlur/Scripts/UniversalBlurPass.cs:89)
Unified.Universal.Blur.UniversalBlurPass.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at ./Library/PackageCache/com.unify.unified-universal-blur@34bcea407f/UnifiedUniversalBlur/Scripts/UniversalBlurPass.cs:53)
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.8/Runtime/ScriptableRenderer.cs:1490)
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.8/Runtime/ScriptableRenderer.cs:1446)
UnityEngine.Rendering.Universal.ScriptableRenderer.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.8/Runtime/ScriptableRenderer.cs:1248)
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.8/Runtime/UniversalRenderPipeline.cs:650)
UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderCameraStack (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera baseCamera) (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.8/Runtime/UniversalRenderPipeline.cs:816)
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.8/Runtime/UniversalRenderPipeline.cs:362)
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)
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)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:190)

This seems to be a Unity problem as everything was still working normally on 2022.3.0f1. Is there a workaround for this?

lukakldiashvili commented 1 year ago

Could you tell me what version of Unity do you have a problem with and how does render feature configuration look like?

TdXYZ commented 1 year ago

As mentioned in the title, it is Unity 2022.3.5f1 and I'm running a 2D game in URP. I have installed and set up everything according to the guide. I have not made any changes. Merely starting the scene without even adding a canvas already causes that error. I think Unity must've screwed something up, as this error didn't happen in Unity 2022.3.0f1.

lukakldiashvili commented 1 year ago

Thank you for reporting the issue. It should now be fixed in the latest release 0.2.2