Skip to content

[HDRP] Fix cropping issue with the graphics compositor when using the camera bridge #4802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 7, 2021
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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed volumetric fog in planar reflections.
- Fixed error with motion blur and small render targets.
- Fixed issue with on-demand directional shadow maps looking broken when a reflection probe is updated at the same time.
- Fixed cropping issue with the compositor camera bridge (case 1340549).

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public bool shaderPropertiesAreDirty

ShaderVariablesGlobal m_ShaderVariablesGlobalCB = new ShaderVariablesGlobal();

int m_RecorderTempRT = Shader.PropertyToID("TempRecorder");

static private CompositionManager s_CompositorInstance;

// Built-in Color.black has an alpha of 1, so defien here a fully transparent black
Expand Down Expand Up @@ -824,14 +826,14 @@ void CustomRender(ScriptableRenderContext context, HDCamera camera)
if (recorderCaptureActions != null)
{
m_ShaderVariablesGlobalCB._ViewProjMatrix = m_ViewProjMatrixFlipped;
cmd.SetInvertCulling(true);
ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal);
cmd.Blit(null, BuiltinRenderTextureType.CameraTarget, m_Material, m_Material.FindPass("ForwardOnly"));
var format = m_InputLayers[0].GetRenderTarget().format;
cmd.GetTemporaryRT(m_RecorderTempRT, camera.camera.pixelWidth, camera.camera.pixelHeight, 0, FilterMode.Point, format);
cmd.Blit(null, m_RecorderTempRT, m_Material, m_Material.FindPass("ForwardOnly"));
for (recorderCaptureActions.Reset(); recorderCaptureActions.MoveNext();)
{
recorderCaptureActions.Current(BuiltinRenderTextureType.CameraTarget, cmd);
recorderCaptureActions.Current(m_RecorderTempRT, cmd);
}
cmd.SetInvertCulling(false);
}

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