Skip to content

Commit c674c41

Browse files
Fix cropping issue with the compositor camera bridge (#4802)
Co-authored-by: sebastienlagarde <[email protected]>
1 parent ca93d88 commit c674c41

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
236236
- Fixed volumetric fog in planar reflections.
237237
- Fixed error with motion blur and small render targets.
238238
- Fixed issue with on-demand directional shadow maps looking broken when a reflection probe is updated at the same time.
239+
- Fixed cropping issue with the compositor camera bridge (case 1340549).
239240

240241
### Changed
241242
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard

com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ public bool shaderPropertiesAreDirty
151151

152152
ShaderVariablesGlobal m_ShaderVariablesGlobalCB = new ShaderVariablesGlobal();
153153

154+
int m_RecorderTempRT = Shader.PropertyToID("TempRecorder");
155+
154156
static private CompositionManager s_CompositorInstance;
155157

156158
// Built-in Color.black has an alpha of 1, so defien here a fully transparent black
@@ -824,14 +826,14 @@ void CustomRender(ScriptableRenderContext context, HDCamera camera)
824826
if (recorderCaptureActions != null)
825827
{
826828
m_ShaderVariablesGlobalCB._ViewProjMatrix = m_ViewProjMatrixFlipped;
827-
cmd.SetInvertCulling(true);
828829
ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal);
829-
cmd.Blit(null, BuiltinRenderTextureType.CameraTarget, m_Material, m_Material.FindPass("ForwardOnly"));
830+
var format = m_InputLayers[0].GetRenderTarget().format;
831+
cmd.GetTemporaryRT(m_RecorderTempRT, camera.camera.pixelWidth, camera.camera.pixelHeight, 0, FilterMode.Point, format);
832+
cmd.Blit(null, m_RecorderTempRT, m_Material, m_Material.FindPass("ForwardOnly"));
830833
for (recorderCaptureActions.Reset(); recorderCaptureActions.MoveNext();)
831834
{
832-
recorderCaptureActions.Current(BuiltinRenderTextureType.CameraTarget, cmd);
835+
recorderCaptureActions.Current(m_RecorderTempRT, cmd);
833836
}
834-
cmd.SetInvertCulling(false);
835837
}
836838

837839
// When we render directly to game view, we render the image flipped up-side-down, like other HDRP cameras

0 commit comments

Comments
 (0)