浏览代码

Merge pull request #1321 from EvgeniiG/master

Fix the infinite recursion bug in the VolumetricLightingSystem
/main
GitHub 6 年前
当前提交
71a8132f
共有 2 个文件被更改,包括 15 次插入7 次删除
  1. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  2. 18
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


RTHandles.Release(m_DebugFullScreenTempBuffer);
m_DebugScreenSpaceTracingData.Release();
HDCamera.CleanUnused();
}

m_SkyManager.Cleanup();
m_VolumetricLightingSystem.Cleanup();
m_IBLFilterGGX.Cleanup();
HDCamera.ClearAll();
DestroyRenderTextures();

18
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs


}
// RTHandleSystem API expects a function which computes the resolution. We define it here.
Vector2Int ComputeVBuffeResolutionXY(Vector2Int screenSize)
Vector2Int ComputeVBufferResolutionXY(Vector2Int screenSize)
return new Vector2Int(resolution.x, resolution.y);
}
// RTHandleSystem API expects a function which computes the resolution. We define it here.
Vector2Int ComputeHistoryVBufferResolutionXY(Vector2Int screenSize)
{
Vector2Int resolution = ComputeVBufferResolutionXY(screenSize);
// Since the buffers owned by the VolumetricLightingSystem may have different lifetimes compared
// to those owned by the HDCamera, we need to make sure that the buffer resolution is the same
// (in order to share the UV scale and the UV limit).

resolution.y = Math.Max(resolution.y, m_LightingBufferHandle.rt.height);
}
return new Vector2Int(resolution.x, resolution.y);
return resolution;
}
// BufferedRTHandleSystem API expects an allocator function. We define it here.

int d = ComputeVBufferSliceCount(preset);
return rtHandleSystem.Alloc(scaleFunc: ComputeVBuffeResolutionXY,
return rtHandleSystem.Alloc(scaleFunc: ComputeHistoryVBufferResolutionXY,
slices: d,
dimension: TextureDimension.Tex3D,
colorFormat: RenderTextureFormat.ARGBHalf,

int d = ComputeVBufferSliceCount(preset);
m_DensityBufferHandle = RTHandles.Alloc(scaleFunc: ComputeVBuffeResolutionXY,
m_DensityBufferHandle = RTHandles.Alloc(scaleFunc: ComputeVBufferResolutionXY,
slices: d,
dimension: TextureDimension.Tex3D,
colorFormat: RenderTextureFormat.ARGBHalf,

/* useDynamicScale: true, // <- TODO */
name: "VBufferDensity");
m_LightingBufferHandle = RTHandles.Alloc(scaleFunc: ComputeVBuffeResolutionXY,
m_LightingBufferHandle = RTHandles.Alloc(scaleFunc: ComputeVBufferResolutionXY,
slices: d,
dimension: TextureDimension.Tex3D,
colorFormat: RenderTextureFormat.ARGBHalf,

正在加载...
取消
保存