Skip to content
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 @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added new functions that sample the custom buffer in custom passes (CustomPassSampleCustomColor and CustomPassLoadCustomColor) to handle the RTHandleScale automatically.
- Added new panels to Rendering Debugger Display Stats panel, displaying improved CPU/GPU frame timings and bottlenecks.
- Added API to edit diffusion profiles and set IES on lights.
- Added public API to reset path tracing accumulation, and check its status.

### Fixed
- Fixed decal position when created from context menu. (case 1368987)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ internal void PrepareNewSubFrame()
foreach (int camID in m_CameraCache.Keys.ToList())
maxIteration = Math.Max(maxIteration, GetCameraData(camID).currentIteration);

if (maxIteration == m_AccumulationSamples)
if (maxIteration >= m_AccumulationSamples)
{
Reset();
}
Expand Down Expand Up @@ -264,6 +264,18 @@ public void PrepareNewSubFrame()
m_SubFrameManager.PrepareNewSubFrame();
}

/// <summary>
/// Checks if the multi-frame accumulation is completed for a given camera.
/// </summary>
/// <param name="hdCamera">Camera for which the accumulation status is checked.</param>
/// <returns><c>true</c> if the accumulation is completed, <c>false</c> otherwise.</returns>
public bool IsFrameCompleted(HDCamera hdCamera)
{
int camID = hdCamera.camera.GetInstanceID();
CameraData camData = m_SubFrameManager.GetCameraData(camID);
return camData.currentIteration >= m_SubFrameManager.subFrameCount;
}

class RenderAccumulationPassData
{
public ComputeShader accumulationCS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,26 @@ void ReleasePathTracing()
#endif // UNITY_EDITOR
}

internal void ResetPathTracing()
/// <summary>
/// Resets path tracing accumulation for all cameras.
/// </summary>
public void ResetPathTracing()
{
m_RenderSky = true;
m_SubFrameManager.Reset();
}

/// <summary>
/// Resets path tracing accumulation for a specific camera.
/// </summary>
/// <param name="hdCamera">Camera for which the accumulation is reset.</param>
public void ResetPathTracing(HDCamera hdCamera)
{
int camID = hdCamera.camera.GetInstanceID();
CameraData camData = m_SubFrameManager.GetCameraData(camID);
ResetPathTracing(camID, camData);
}

internal CameraData ResetPathTracing(int camID, CameraData camData)
{
m_RenderSky = true;
Expand Down