Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6ed601f
Implemented Probe Volume light list build.
JulienIgnace-Unity Jun 22, 2020
7454aa7
Merge branch 'HDRP/rendergraph-misc' of https://github.com/Unity-Tech…
JulienIgnace-Unity Jun 22, 2020
9a23e9d
Implement transparency overdraw.
JulienIgnace-Unity Jun 22, 2020
3d2b33b
Implement XR occlusion mesh
JulienIgnace-Unity Jun 22, 2020
e23f6f6
Fix when no movecs are available.
JulienIgnace-Unity Jun 22, 2020
587ef27
Remove unnecessary workaround.
JulienIgnace-Unity Jun 23, 2020
a5bf4c0
Merge branch 'HDRP/rendergraph-misc' of https://github.com/Unity-Tech…
JulienIgnace-Unity Jun 23, 2020
05256fe
Fixed AO texture binding and usage.
JulienIgnace-Unity Jun 23, 2020
ac5d63d
Implement transparent SSR and fixed transparent depth prepass
JulienIgnace-Unity Jun 23, 2020
6c2bb2d
Fixed a leak with the resource purge system.
JulienIgnace-Unity Jun 23, 2020
b4cda74
Temporary fix to a texture binding error with deferred compute shaders.
JulienIgnace-Unity Jun 23, 2020
8d98914
Fixed null ref
JulienIgnace-Unity Jun 23, 2020
057ba36
Fixed area shadows
JulienIgnace-Unity Jun 23, 2020
28a69fb
Enabled test 2501 LightLayers
JulienIgnace-Unity Jun 23, 2020
2e59707
Enabled SSAO tests 2601/2602
JulienIgnace-Unity Jun 23, 2020
60a12f9
Fixed debug mode background color
JulienIgnace-Unity Jun 23, 2020
5109cd2
Fixed GCAlloc in PushFullScreenDebug
JulienIgnace-Unity Jun 23, 2020
7616e6d
Fixed GCAlloc in Resolve MSAA functions
JulienIgnace-Unity Jun 23, 2020
000fcbb
Reenabled 8106
JulienIgnace-Unity Jun 23, 2020
570e6bd
Fixed MSAA prepass and camera motion vector
JulienIgnace-Unity Jun 23, 2020
22bfe94
Re-enabled tests 9402
JulienIgnace-Unity Jun 23, 2020
9aaaf45
Re-enabled 9500, 9603 and 9604
JulienIgnace-Unity Jun 23, 2020
e992506
Fixed object motion vector pass with MSAA.
JulienIgnace-Unity Jun 23, 2020
32e25f4
Fixed AOV output
JulienIgnace-Unity Jun 23, 2020
9ff631d
Fixed binding of depth texture to volumetric lighting shader.
JulienIgnace-Unity Jun 23, 2020
4010916
Merge branch 'HDRP/staging' of https://github.com/Unity-Technologies/…
JulienIgnace-Unity Jun 24, 2020
2e2e778
Merge branch 'HDRP/staging' of https://github.com/Unity-Technologies/…
JulienIgnace-Unity Jun 24, 2020
2916593
Custom Passes implementation WIP
JulienIgnace-Unity Jun 24, 2020
23d829e
Remove comment
JulienIgnace-Unity Jun 24, 2020
9b85049
Merge branch 'HDRP/staging' of https://github.com/Unity-Technologies/…
JulienIgnace-Unity Jun 24, 2020
90653ea
Re-enabled tests 9700 9701 for custom passes.
JulienIgnace-Unity Jun 25, 2020
ac210ed
Add comment.
JulienIgnace-Unity Jun 25, 2020
e6c8530
typo
JulienIgnace-Unity Jun 25, 2020
228a92d
Fixed a null ref and binding of color pyramid.
JulienIgnace-Unity Jun 25, 2020
9c18fce
Implemented MSAA resolve for custom pass.
JulienIgnace-Unity Jun 25, 2020
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 @@ -321,7 +321,7 @@ PrefabInstance:
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: renderGraphCompatible
value: 0
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ PrefabInstance:
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: renderGraphCompatible
value: 0
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
Expand Down Expand Up @@ -397,6 +397,7 @@ MonoBehaviour:
m_EnableSpotReflector: 0
m_LuxAtDistance: 1
m_InnerSpotPercent: 0
m_SpotIESCutoffPercent: 100
m_LightDimmer: 1
m_VolumetricDimmer: 1
m_LightUnit: 0
Expand All @@ -415,6 +416,8 @@ MonoBehaviour:
m_ApplyRangeAttenuation: 1
m_DisplayAreaLightEmissiveMesh: 0
m_AreaLightCookie: {fileID: 0}
m_IESPoint: {fileID: 0}
m_IESSpot: {fileID: 0}
m_AreaLightShadowCone: 120
m_UseScreenSpaceShadows: 0
m_InteractsWithSky: 1
Expand Down Expand Up @@ -2741,6 +2744,7 @@ MonoBehaviour:
m_EnableSpotReflector: 0
m_LuxAtDistance: 1
m_InnerSpotPercent: 0
m_SpotIESCutoffPercent: 100
m_LightDimmer: 1
m_VolumetricDimmer: 1
m_LightUnit: 0
Expand All @@ -2759,6 +2763,8 @@ MonoBehaviour:
m_ApplyRangeAttenuation: 1
m_DisplayAreaLightEmissiveMesh: 0
m_AreaLightCookie: {fileID: 0}
m_IESPoint: {fileID: 0}
m_IESSpot: {fileID: 0}
m_AreaLightShadowCone: 120
m_UseScreenSpaceShadows: 0
m_InteractsWithSky: 1
Expand Down Expand Up @@ -3954,6 +3960,7 @@ MonoBehaviour:
serializedVersion: 2
m_Bits: 4294967295
hasPersistentHistory: 0
exposureTarget: {fileID: 0}
m_RenderingPathCustomFrameSettings:
bitDatas:
data1: 72198260625768269
Expand Down Expand Up @@ -4389,6 +4396,7 @@ MonoBehaviour:
serializedVersion: 2
m_Bits: 4294967295
hasPersistentHistory: 0
exposureTarget: {fileID: 0}
m_RenderingPathCustomFrameSettings:
bitDatas:
data1: 72198260625768268
Expand Down
26 changes: 13 additions & 13 deletions com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public enum DepthAccess
/// <summary>
/// This struct specifies the context given to every render pass.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the doc, this is now a class and not a struct

/// </summary>
public ref struct RenderGraphContext
public class RenderGraphContext
{
///<summary>Scriptable Render Context used for rendering.</summary>
public ScriptableRenderContext renderContext;
Expand Down Expand Up @@ -197,6 +197,7 @@ public void Reset(RenderGraphPass pass)
RenderGraphDefaultResources m_DefaultResources = new RenderGraphDefaultResources();
Dictionary<int, ProfilingSampler> m_DefaultProfilingSamplers = new Dictionary<int, ProfilingSampler>();
bool m_ExecutionExceptionWasRaised;
RenderGraphContext m_RenderGraphContext = new RenderGraphContext();

// Compiled Render Graph info.
DynamicArray<CompiledResourceInfo>[] m_CompiledResourcesInfos = new DynamicArray<CompiledResourceInfo>[(int)RenderGraphResourceType.Count];
Expand Down Expand Up @@ -810,12 +811,11 @@ internal void CompileRenderGraph()
// Execute the compiled render graph
void ExecuteRenderGraph(ScriptableRenderContext renderContext, CommandBuffer cmd)
{
RenderGraphContext rgContext = new RenderGraphContext();
rgContext.cmd = cmd;
rgContext.renderContext = renderContext;
rgContext.renderGraphPool = m_RenderGraphPool;
rgContext.resources = m_Resources;
rgContext.defaultResources = m_DefaultResources;
m_RenderGraphContext.cmd = cmd;
m_RenderGraphContext.renderContext = renderContext;
m_RenderGraphContext.renderGraphPool = m_RenderGraphPool;
m_RenderGraphContext.resources = m_Resources;
m_RenderGraphContext.defaultResources = m_DefaultResources;

for (int passIndex = 0; passIndex < m_CompiledPassInfos.size; ++passIndex)
{
Expand All @@ -830,14 +830,14 @@ void ExecuteRenderGraph(ScriptableRenderContext renderContext, CommandBuffer cmd

try
{
using (new ProfilingScope(rgContext.cmd, passInfo.pass.customSampler))
using (new ProfilingScope(m_RenderGraphContext.cmd, passInfo.pass.customSampler))
{
LogRenderPassBegin(passInfo);
using (new RenderGraphLogIndent(m_Logger))
{
PreRenderPassExecute(passInfo, ref rgContext);
passInfo.pass.Execute(rgContext);
PostRenderPassExecute(cmd, ref passInfo, ref rgContext);
PreRenderPassExecute(passInfo, m_RenderGraphContext);
passInfo.pass.Execute(m_RenderGraphContext);
PostRenderPassExecute(cmd, ref passInfo, m_RenderGraphContext);
}
}
}
Expand Down Expand Up @@ -895,7 +895,7 @@ void PreRenderPassSetRenderTargets(in CompiledPassInfo passInfo, RenderGraphCont
}
}

void PreRenderPassExecute(in CompiledPassInfo passInfo, ref RenderGraphContext rgContext)
void PreRenderPassExecute(in CompiledPassInfo passInfo, RenderGraphContext rgContext)
{
// TODO RENDERGRAPH merge clear and setup here if possible
RenderGraphPass pass = passInfo.pass;
Expand Down Expand Up @@ -930,7 +930,7 @@ void PreRenderPassExecute(in CompiledPassInfo passInfo, ref RenderGraphContext r
}
}

void PostRenderPassExecute(CommandBuffer mainCmd, ref CompiledPassInfo passInfo, ref RenderGraphContext rgContext)
void PostRenderPassExecute(CommandBuffer mainCmd, ref CompiledPassInfo passInfo, RenderGraphContext rgContext)
{
RenderGraphPass pass = passInfo.pass;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.RenderGraphModule;

Expand Down Expand Up @@ -135,7 +136,14 @@ void BindMotionVectorPassColorBuffers(in RenderGraphBuilder builder, in PrepassO
}
}

PrepassOutput RenderPrepass(RenderGraph renderGraph, TextureHandle colorbuffer, TextureHandle sssBuffer, CullingResults cullingResults, HDCamera hdCamera)
PrepassOutput RenderPrepass(RenderGraph renderGraph,
TextureHandle colorBuffer,
TextureHandle sssBuffer,
CullingResults cullingResults,
CullingResults customPassCullingResults,
HDCamera hdCamera,
AOVRequestData aovRequest,
List<RTHandle> aovBuffers)
{
m_IsDepthBufferCopyValid = false;

Expand All @@ -150,20 +158,14 @@ PrepassOutput RenderPrepass(RenderGraph renderGraph, TextureHandle colorbuffer,
result.motionVectorsBuffer = CreateMotionVectorBuffer(renderGraph, msaa, clearMotionVectors);
result.depthBuffer = CreateDepthBuffer(renderGraph, msaa);

RenderXROcclusionMeshes(renderGraph, hdCamera, colorbuffer, result.depthBuffer);
RenderXROcclusionMeshes(renderGraph, hdCamera, colorBuffer, result.depthBuffer);

using (new XRSinglePassScope(renderGraph, hdCamera))
{
//// Bind the custom color/depth before the first custom pass
//if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.CustomPass))
//{
// if (m_CustomPassColorBuffer.IsValueCreated)
// cmd.SetGlobalTexture(HDShaderIDs._CustomColorTexture, m_CustomPassColorBuffer.Value);
// if (m_CustomPassDepthBuffer.IsValueCreated)
// cmd.SetGlobalTexture(HDShaderIDs._CustomDepthTexture, m_CustomPassDepthBuffer.Value);
//}
// Bind the custom color/depth before the first custom pass
BindCustomPassBuffers(renderGraph, hdCamera);

//RenderCustomPass(renderContext, cmd, hdCamera, customPassCullingResults, CustomPassInjectionPoint.BeforeRendering, aovRequest, aovCustomPassBuffers);
RenderCustomPass(renderGraph, hdCamera, colorBuffer, result.depthBuffer, result.normalBuffer, customPassCullingResults, CustomPassInjectionPoint.BeforeRendering, aovRequest, aovBuffers);

//RenderRayTracingPrepass(cullingResults, hdCamera, renderContext, cmd, false);

Expand Down Expand Up @@ -192,7 +194,7 @@ PrepassOutput RenderPrepass(RenderGraph renderGraph, TextureHandle colorbuffer,
RenderCameraMotionVectors(renderGraph, hdCamera, result.depthBuffer, result.motionVectorsBuffer);
}

PreRenderSky(renderGraph, hdCamera, colorbuffer, result.depthBuffer, result.normalBuffer);
PreRenderSky(renderGraph, hdCamera, colorBuffer, result.depthBuffer, result.normalBuffer);

// At this point in forward all objects have been rendered to the prepass (depth/normal/motion vectors) so we can resolve them
ResolvePrepassBuffers(renderGraph, hdCamera, ref result);
Expand All @@ -201,16 +203,14 @@ PrepassOutput RenderPrepass(RenderGraph renderGraph, TextureHandle colorbuffer,

RenderGBuffer(renderGraph, sssBuffer, ref result, probeVolumeListOutput, cullingResults, hdCamera);


DecalNormalPatch(renderGraph, hdCamera, ref result);

// TODO RENDERGRAPH
//// After Depth and Normals/roughness including decals
//bool depthBufferModified = RenderCustomPass(renderContext, cmd, hdCamera, customPassCullingResults, CustomPassInjectionPoint.AfterOpaqueDepthAndNormal, aovRequest, aovCustomPassBuffers);
// After Depth and Normals/roughness including decals
bool depthBufferModified = RenderCustomPass(renderGraph, hdCamera, colorBuffer, result.depthBuffer, result.normalBuffer, customPassCullingResults, CustomPassInjectionPoint.AfterOpaqueDepthAndNormal, aovRequest, aovBuffers);

//// If the depth was already copied in RenderDBuffer, we force the copy again because the custom pass modified the depth.
//if (depthBufferModified)
// m_IsDepthBufferCopyValid = false;
// If the depth was already copied in RenderDBuffer, we force the copy again because the custom pass modified the depth.
if (depthBufferModified)
m_IsDepthBufferCopyValid = false;

// In both forward and deferred, everything opaque should have been rendered at this point so we can safely copy the depth buffer for later processing.
GenerateDepthPyramid(renderGraph, hdCamera, ref result);
Expand Down
Loading