Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit ca1ce0f

Browse files
committed
Added AO markers
1 parent 30a10b6 commit ca1ce0f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

PostProcessing/Runtime/Effects/AmbientOcclusion.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,20 @@ PropertySheet PreRender(PostProcessRenderContext context, int occlusionSource)
142142

143143
internal void RenderAfterOpaque(PostProcessRenderContext context)
144144
{
145+
var cmd = context.command;
146+
cmd.BeginSample("Ambient Occlusion");
145147
var sheet = PreRender(context, 0); // Forward
146-
context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, (int)Pass.CompositionForward);
148+
cmd.BlitFullscreenTriangle(context.source, context.destination, sheet, (int)Pass.CompositionForward);
149+
cmd.EndSample("Ambient Occlusion");
147150
}
148151

149152
internal void RenderAmbientOnly(PostProcessRenderContext context)
150153
{
154+
var cmd = context.command;
155+
cmd.BeginSample("Ambient Occlusion");
151156
var sheet = PreRender(context, 1); // Deferred
152-
context.command.BlitFullscreenTriangle(BuiltinRenderTextureType.None, m_MRT, BuiltinRenderTextureType.CameraTarget, sheet, (int)Pass.CompositionDeferred);
157+
cmd.BlitFullscreenTriangle(BuiltinRenderTextureType.None, m_MRT, BuiltinRenderTextureType.CameraTarget, sheet, (int)Pass.CompositionDeferred);
158+
cmd.EndSample("Ambient Occlusion");
153159
}
154160
}
155161
}

PostProcessing/Shaders/Builtins/AmbientOcclusion.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ float4 FragAO(VaryingsDefault i) : SV_Target
205205
float depth_o = SampleDepthNormal(uv, norm_o);
206206

207207
// Reconstruct the view-space position.
208-
float3 vpos_o = ReconstructViewPos(i.texcoord, depth_o, p11_22, p13_31);
208+
float3 vpos_o = ReconstructViewPos(uv, depth_o, p11_22, p13_31);
209209

210210
float ao = 0.0;
211211

0 commit comments

Comments
 (0)