Skip to content

Commit

Permalink
fixed not correct working Refraction Rend.Feature - cameraColorTarget…
Browse files Browse the repository at this point in the history
… as source was sometimes just a UnityDefault texture
  • Loading branch information
pfcDorn committed Apr 16, 2024
1 parent df9addc commit 539f6b3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Runtime/Scripts/RenderPipelines/RoughRefractionFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ public void Dispose()
m_destination?.Release();
}
#else

public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
if (renderingData.cameraData.isPreviewCamera)
return;

Setup(renderingData.cameraData.renderer.cameraColorTarget, destination, m_DownsamplingMethod);

#pragma warning disable 672
#pragma warning disable 618
base.Execute(context, ref renderingData);
#pragma warning restore 672
#pragma warning restore 618
}
public new void Setup(RenderTargetIdentifier source, RenderTargetHandle destination, Downsampling downsampling)
{
base.Setup(source, destination, downsampling);
Expand Down Expand Up @@ -179,12 +193,13 @@ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingD
var identifier = new RenderTargetIdentifier(BuiltinRenderTextureType.CameraTarget);
m_RoughRefractionPassNonRG.Setup(identifier, m_OpaqueColor, downsampling);
#else

m_RoughRefractionPassNonRG.Setup(renderer.cameraColorTarget, m_OpaqueColor, downsampling);
#endif
renderer.EnqueuePass(m_RoughRefractionPassNonRG);
#endif
}

#if UNITY_2022_3_OR_NEWER
public override void SetupRenderPasses(ScriptableRenderer renderer, in RenderingData renderingData)
{
Expand Down

0 comments on commit 539f6b3

Please sign in to comment.