Hello, I am trying to reimplement bloom as a custom feature and use the post process volume system so it works the same as the bloom from post processing with volumes. However URP seems to now create a blitter more than once causing an exception. I can't figure out why this happens. Is it a bug in URP
using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace PostFX
{
[Serializable, VolumeComponentMenu("PostFX/BloomV2")]
[SupportedOnRenderPipeline(typeof(UniversalRenderPipeline))]
public sealed partial class BloomV2 : VolumeComponent, IPostProcessComponent
{
/// <summary>
/// Controls the strength of the bloom filter.
/// </summary>
[Tooltip("Strength of the bloom filter.")]
public MinFloatParameter intensity = new MinFloatParameter(0.0f, 0.0f);
public bool IsActive() => intensity.value > 0.0f;
}
}
Exception: Blitter is already initialized. Please only initialize the blitter once or you will leak engine resources. If you need to re-initialize the blitter with different shaders destroy & recreate it.
UnityEngine.Rendering.Blitter.Initialize (UnityEngine.Shader blitPS, UnityEngine.Shader blitColorAndDepthPS) (at ./Library/PackageCache/com.unity.render-pipelines.core@84bf82d10e47/Runtime/Utilities/Blitter.cs:277)
UnityEngine.Rendering.Universal.UniversalRenderPipeline..ctor (UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset asset) (at ./Library/PackageCache/com.unity.render-pipelines.universal@fd0c0d56fb49/Runtime/UniversalRenderPipeline.cs:244)
UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset.CreatePipeline () (at ./Library/PackageCache/com.unity.render-pipelines.universal@fd0c0d56fb49/Runtime/Data/UniversalRenderPipelineAsset.cs:830)
UnityEngine.Rendering.RenderPipelineAsset.InternalCreatePipeline () (at <5fbef2e591e14a4c91f3c5e34508b853>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)