Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ public override void Setup()
var hdrpAsset = HDRenderPipeline.defaultAsset;
if (hdrpAsset != null)
m_Material = CoreUtils.CreateEngineMaterial(hdrpAsset.renderPipelineResources.shaders.alphaInjectionPS);

name = "AlphaInjection"; // Needed to get a scope name in RenderDoc captures
}

public override void Render(CommandBuffer cmd, HDCamera camera, RTHandle source, RTHandle destination)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public override void Setup()
var hdrpAsset = HDRenderPipeline.defaultAsset;
if (hdrpAsset != null)
m_Material = CoreUtils.CreateEngineMaterial(hdrpAsset.renderPipelineResources.shaders.chromaKeyingPS);

name = "ChromaKeying"; // Needed to get a scope name in RenderDoc captures
}

public override void Render(CommandBuffer cmd, HDCamera camera, RTHandle source, RTHandle destination)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,10 @@ void OnDestroy()
CoreUtils.Destroy(volume);
}
}

// We don't need the custom passes anymore
var hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;
UnRegisterCustomPasses(hdPipeline);
}

public void AddInputFilterAtLayer(CompositionFilter filter, int index)
Expand Down Expand Up @@ -929,14 +933,12 @@ static internal void RegisterCustomPasses(HDRenderPipeline hdPipeline)
}

// If custom post processes are not registered in the HDRP asset, they are never executed so we have to add them manually
int indx = hdPipeline.asset.beforePostProcessCustomPostProcesses.FindIndex(x => x == typeof(ChromaKeying).AssemblyQualifiedName);
if (indx < 0)
if (!hdPipeline.asset.beforePostProcessCustomPostProcesses.Contains(typeof(ChromaKeying).AssemblyQualifiedName))
{
hdPipeline.asset.beforePostProcessCustomPostProcesses.Add(typeof(ChromaKeying).AssemblyQualifiedName);
}

indx = hdPipeline.asset.beforePostProcessCustomPostProcesses.FindIndex(x => x == typeof(AlphaInjection).AssemblyQualifiedName);
if (indx < 0)
if (!hdPipeline.asset.beforePostProcessCustomPostProcesses.Contains(typeof(AlphaInjection).AssemblyQualifiedName))
{
hdPipeline.asset.beforePostProcessCustomPostProcesses.Add(typeof(AlphaInjection).AssemblyQualifiedName);
}
Expand All @@ -950,14 +952,12 @@ static internal void UnRegisterCustomPasses(HDRenderPipeline hdPipeline)
return;
}

int indx = hdPipeline.asset.beforePostProcessCustomPostProcesses.FindIndex(x => x == typeof(ChromaKeying).AssemblyQualifiedName);
if (indx >= 0)
if (hdPipeline.asset.beforePostProcessCustomPostProcesses.Contains(typeof(ChromaKeying).AssemblyQualifiedName))
{
hdPipeline.asset.beforePostProcessCustomPostProcesses.Remove(typeof(ChromaKeying).AssemblyQualifiedName);
}

indx = hdPipeline.asset.beforePostProcessCustomPostProcesses.FindIndex(x => x == typeof(AlphaInjection).AssemblyQualifiedName);
if (indx >= 0)
if (hdPipeline.asset.beforePostProcessCustomPostProcesses.Contains(typeof(AlphaInjection).AssemblyQualifiedName))
{
hdPipeline.asset.beforePostProcessCustomPostProcesses.Remove(typeof(AlphaInjection).AssemblyQualifiedName);
}
Expand Down