-
Notifications
You must be signed in to change notification settings - Fork 855
Fix frame count in editor #3173
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
Changes from all commits
f7c0014
25b99c7
fca31e7
b8abbad
2fb6ac3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest, | |
{ | ||
scriptableRenderContext = renderContext, | ||
commandBuffer = commandBuffer, | ||
currentFrameIndex = GetFrameCount() | ||
currentFrameIndex = m_FrameCount | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is intended to still use m_FrameCount here and not the one from the camera? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's intended, i investigated a bit how the frame count was used by the rendergraph, and it seems it should not be camera dependent, but you may want to confirm 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will take another look and try to confirm then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the change is ok yes :) |
||
}; | ||
|
||
m_RenderGraph.Begin(renderGraphParams); | ||
|
@@ -104,7 +104,7 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest, | |
{ | ||
gpuLightListOutput = BuildGPULightList(m_RenderGraph, hdCamera, m_TileAndClusterData, m_TotalLightCount, ref m_ShaderVariablesLightListCB, prepassOutput.depthBuffer, prepassOutput.stencilBuffer, prepassOutput.gbuffer); | ||
|
||
lightingBuffers.ambientOcclusionBuffer = m_AmbientOcclusionSystem.Render(m_RenderGraph, hdCamera, prepassOutput.depthPyramidTexture, prepassOutput.resolvedNormalBuffer, prepassOutput.resolvedMotionVectorsBuffer, m_FrameCount, m_DepthBufferMipChainInfo, m_ShaderVariablesRayTracingCB, rayCountTexture); | ||
lightingBuffers.ambientOcclusionBuffer = m_AmbientOcclusionSystem.Render(m_RenderGraph, hdCamera, prepassOutput.depthPyramidTexture, prepassOutput.resolvedNormalBuffer, prepassOutput.resolvedMotionVectorsBuffer, m_DepthBufferMipChainInfo, m_ShaderVariablesRayTracingCB, rayCountTexture); | ||
// Should probably be inside the AO render function but since it's a separate class it's currently not super clean to do. | ||
PushFullScreenDebugTexture(m_RenderGraph, lightingBuffers.ambientOcclusionBuffer, FullScreenDebugMode.ScreenSpaceAmbientOcclusion); | ||
|
||
|
@@ -135,7 +135,7 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest, | |
case IndirectDiffuseMode.Raytrace: | ||
lightingBuffers.ssgiLightingBuffer = RenderRayTracedIndirectDiffuse(m_RenderGraph, hdCamera, | ||
prepassOutput.depthBuffer, prepassOutput.stencilBuffer, prepassOutput.normalBuffer, prepassOutput.resolvedMotionVectorsBuffer, m_SkyManager.GetSkyReflection(hdCamera), rayCountTexture, | ||
m_FrameCount, m_ShaderVariablesRayTracingCB); | ||
m_ShaderVariablesRayTracingCB); | ||
break; | ||
default: | ||
lightingBuffers.ssgiLightingBuffer = m_RenderGraph.defaultResources.blackTextureXR; | ||
|
@@ -1117,7 +1117,6 @@ class PreRenderSkyPassData | |
public TextureHandle normalBuffer; | ||
public DebugDisplaySettings debugDisplaySettings; | ||
public SkyManager skyManager; | ||
public int frameCount; | ||
} | ||
|
||
void PreRenderSky(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle colorBuffer, TextureHandle depthStencilBuffer, TextureHandle normalbuffer) | ||
|
@@ -1135,12 +1134,11 @@ void PreRenderSky(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle colo | |
passData.normalBuffer = builder.WriteTexture(normalbuffer); | ||
passData.debugDisplaySettings = m_CurrentDebugDisplaySettings; | ||
passData.skyManager = m_SkyManager; | ||
passData.frameCount = m_FrameCount; | ||
|
||
builder.SetRenderFunc( | ||
(PreRenderSkyPassData data, RenderGraphContext context) => | ||
{ | ||
data.skyManager.PreRenderSky(data.hdCamera, data.sunLight, data.colorBuffer, data.normalBuffer, data.depthStencilBuffer, data.debugDisplaySettings, data.frameCount, context.cmd); | ||
data.skyManager.PreRenderSky(data.hdCamera, data.sunLight, data.colorBuffer, data.normalBuffer, data.depthStencilBuffer, data.debugDisplaySettings, context.cmd); | ||
}); | ||
} | ||
} | ||
|
@@ -1157,7 +1155,6 @@ class RenderSkyPassData | |
public TextureHandle intermediateBuffer; | ||
public DebugDisplaySettings debugDisplaySettings; | ||
public SkyManager skyManager; | ||
public int frameCount; | ||
} | ||
|
||
void RenderSky(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle colorBuffer, TextureHandle volumetricLighting, TextureHandle depthStencilBuffer, TextureHandle depthTexture) | ||
|
@@ -1177,15 +1174,14 @@ void RenderSky(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle colorBu | |
passData.intermediateBuffer = builder.CreateTransientTexture(colorBuffer); | ||
passData.debugDisplaySettings = m_CurrentDebugDisplaySettings; | ||
passData.skyManager = m_SkyManager; | ||
passData.frameCount = m_FrameCount; | ||
|
||
builder.SetRenderFunc( | ||
(RenderSkyPassData data, RenderGraphContext context) => | ||
{ | ||
// Necessary to perform dual-source (polychromatic alpha) blending which is not supported by Unity. | ||
// We load from the color buffer, perform blending manually, and store to the atmospheric scattering buffer. | ||
// Then we perform a copy from the atmospheric scattering buffer back to the color buffer. | ||
data.skyManager.RenderSky(data.hdCamera, data.sunLight, data.colorBuffer, data.depthStencilBuffer, data.debugDisplaySettings, data.frameCount, context.cmd); | ||
data.skyManager.RenderSky(data.hdCamera, data.sunLight, data.colorBuffer, data.depthStencilBuffer, data.debugDisplaySettings, context.cmd); | ||
|
||
if (Fog.IsFogEnabled(data.hdCamera) || Fog.IsPBRFogEnabled(data.hdCamera)) | ||
{ | ||
|
Uh oh!
There was an error while loading. Please reload this page.