Skip to content

Fix AOV API for render graph #2909

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
Dec 16, 2020
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 @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed NullPointerException when baking probes from the lighting window (case 1289680)
- Fixed volumetric fog with XR single-pass rendering.
- Fixed issues with first frame rendering when RenderGraph is used (auto exposure, AO)
- Fixed AOV api in render graph (case 1296605)

### Changed
- Removed the material pass probe volumes evaluation mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class TempPassData {};
void ExecuteWithRenderGraph(RenderRequest renderRequest,
AOVRequestData aovRequest,
List<RTHandle> aovBuffers,
List<RTHandle> aovCustomPassBuffers,
ScriptableRenderContext renderContext,
CommandBuffer commandBuffer)
{
Expand Down Expand Up @@ -187,7 +188,7 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest,
ClearStencilBuffer(m_RenderGraph, colorBuffer, prepassOutput.depthBuffer);
}

colorBuffer = RenderTransparency(m_RenderGraph, hdCamera, colorBuffer, prepassOutput.resolvedNormalBuffer, vtFeedbackBuffer, currentColorPyramid, volumetricLighting, rayCountTexture, m_SkyManager.GetSkyReflection(hdCamera), gpuLightListOutput, ref prepassOutput, shadowResult, cullingResults, customPassCullingResults, aovRequest, aovBuffers);
colorBuffer = RenderTransparency(m_RenderGraph, hdCamera, colorBuffer, prepassOutput.resolvedNormalBuffer, vtFeedbackBuffer, currentColorPyramid, volumetricLighting, rayCountTexture, m_SkyManager.GetSkyReflection(hdCamera), gpuLightListOutput, ref prepassOutput, shadowResult, cullingResults, customPassCullingResults, aovRequest, aovCustomPassBuffers);

if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.TransparentsWriteMotionVector))
{
Expand Down Expand Up @@ -251,7 +252,7 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest,
// At this point, the color buffer has been filled by either debug views are regular rendering so we can push it here.
var colorPickerTexture = PushColorPickerDebugTexture(m_RenderGraph, colorBuffer);

RenderCustomPass(m_RenderGraph, hdCamera, colorBuffer, prepassOutput, customPassCullingResults, cullingResults, CustomPassInjectionPoint.BeforePostProcess, aovRequest, aovBuffers);
RenderCustomPass(m_RenderGraph, hdCamera, colorBuffer, prepassOutput, customPassCullingResults, cullingResults, CustomPassInjectionPoint.BeforePostProcess, aovRequest, aovCustomPassBuffers);

if (aovRequest.isValid)
{
Expand All @@ -267,7 +268,7 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest,
}
PushFullScreenExposureDebugTexture(m_RenderGraph, postProcessDest);

RenderCustomPass(m_RenderGraph, hdCamera, postProcessDest, prepassOutput, customPassCullingResults, cullingResults, CustomPassInjectionPoint.AfterPostProcess, aovRequest, aovBuffers);
RenderCustomPass(m_RenderGraph, hdCamera, postProcessDest, prepassOutput, customPassCullingResults, cullingResults, CustomPassInjectionPoint.AfterPostProcess, aovRequest, aovCustomPassBuffers);

CopyXRDepth(m_RenderGraph, hdCamera, prepassOutput.depthBuffer, backBuffer);

Expand Down Expand Up @@ -322,7 +323,7 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest,
// aovRequest.Execute don't go through render graph for now
using (new ProfilingScope(commandBuffer, ProfilingSampler.Get(HDProfileId.AOVExecute)))
{
aovRequest.Execute(commandBuffer, aovBuffers, RenderOutputProperties.From(hdCamera));
aovRequest.Execute(commandBuffer, aovBuffers, aovCustomPassBuffers, RenderOutputProperties.From(hdCamera));
}
}
}
Expand Down Expand Up @@ -895,7 +896,7 @@ TextureHandle RenderTransparency(RenderGraph renderGraph,
CullingResults cullingResults,
CullingResults customPassCullingResults,
AOVRequestData aovRequest,
List<RTHandle> aovBuffers)
List<RTHandle> aovCustomPassBuffers)
{
RenderTransparentDepthPrepass(renderGraph, hdCamera, prepassOutput, cullingResults);

Expand All @@ -908,7 +909,7 @@ TextureHandle RenderTransparency(RenderGraph renderGraph,
// To allow users to fetch the current color buffer, we temporarily bind the camera color buffer
SetGlobalColorForCustomPass(renderGraph, currentColorPyramid);

RenderCustomPass(m_RenderGraph, hdCamera, colorBuffer, prepassOutput, customPassCullingResults, cullingResults, CustomPassInjectionPoint.BeforePreRefraction, aovRequest, aovBuffers);
RenderCustomPass(m_RenderGraph, hdCamera, colorBuffer, prepassOutput, customPassCullingResults, cullingResults, CustomPassInjectionPoint.BeforePreRefraction, aovRequest, aovCustomPassBuffers);

// Render pre-refraction objects
RenderForwardTransparent(renderGraph, hdCamera, colorBuffer, normalBuffer, prepassOutput, vtFeedbackBuffer, volumetricLighting, ssrLightingBuffer, null, lightLists, shadowResult, cullingResults, true);
Expand All @@ -920,7 +921,7 @@ TextureHandle RenderTransparency(RenderGraph renderGraph,
}

// We don't have access to the color pyramid with transparent if rough refraction is disabled
RenderCustomPass(m_RenderGraph, hdCamera, colorBuffer, prepassOutput, customPassCullingResults, cullingResults, CustomPassInjectionPoint.BeforeTransparent, aovRequest, aovBuffers);
RenderCustomPass(m_RenderGraph, hdCamera, colorBuffer, prepassOutput, customPassCullingResults, cullingResults, CustomPassInjectionPoint.BeforeTransparent, aovRequest, aovCustomPassBuffers);

// Render all type of transparent forward (unlit, lit, complex (hair...)) to keep the sorting between transparent objects.
RenderForwardTransparent(renderGraph, hdCamera, colorBuffer, normalBuffer, prepassOutput, vtFeedbackBuffer, volumetricLighting, ssrLightingBuffer, currentColorPyramid, lightLists, shadowResult, cullingResults, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,7 @@ AOVRequestData aovRequest

try
{
ExecuteWithRenderGraph(renderRequest, aovRequest, aovBuffers, renderContext, cmd);
ExecuteWithRenderGraph(renderRequest, aovRequest, aovBuffers, aovCustomPassBuffers, renderContext, cmd);
}
catch (Exception e)
{
Expand Down