浏览代码

MSAA works with clustered light list generation

Changed clustered kernel string generation
LightLoop settings disables FPTL with MSAA
Disable SSS HTILE allocation if SSS is diabled (fails with MSAA)

I want to make the config more dynamic, then...I can start re-adding passes!
/main
Robert Srinivasiah 7 年前
当前提交
4a125ead
共有 3 个文件被更改,包括 27 次插入4 次删除
  1. 9
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  2. 19
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs
  3. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopSettings.cs

9
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


bool m_FullScreenDebugPushed;
// temp hack
public const int kMsaaSamplesFixed = 1;
public const int kMsaaSamplesFixed = 4;
public HDRenderPipeline(HDRenderPipelineAsset asset)
{

if (resolutionChanged || m_CameraDepthStencilBuffer == null)
{
CreateDepthStencilBuffer(hdCamera);
m_SSSBufferManager.Resize(hdCamera);
if (m_FrameSettings.enableSubsurfaceScattering)
{
// TODO: The R8 target doesn't allocate with MSAA support...
m_SSSBufferManager.Resize(hdCamera);
}
}
if (resolutionChanged || m_LightLoop.NeedResize())

19
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs


// Cluster
{
var kernelName = m_FrameSettings.lightLoopSettings.enableBigTilePrepass ? (k_UseDepthBuffer ? "TileLightListGen_DepthRT_SrcBigTile" : "TileLightListGen_NoDepthRT_SrcBigTile") : (k_UseDepthBuffer ? "TileLightListGen_DepthRT" : "TileLightListGen_NoDepthRT");
//var kernelName = m_FrameSettings.lightLoopSettings.enableBigTilePrepass ? (k_UseDepthBuffer ? "TileLightListGen_DepthRT_SrcBigTile" : "TileLightListGen_NoDepthRT_SrcBigTile") : (k_UseDepthBuffer ? "TileLightListGen_DepthRT" : "TileLightListGen_NoDepthRT");
var kernelName = "TileLightListGen";
if (k_UseDepthBuffer)
{
kernelName += "_DepthRT";
// if MSAA is actually active, use the MSAA path
if (m_FrameSettings.enableMSAA &&
(HDRenderPipeline.kMsaaSamplesFixed > 1))
kernelName += "_MSAA";
}
else
{
kernelName += "_NoDepthRT";
}
if (m_FrameSettings.lightLoopSettings.enableBigTilePrepass)
kernelName += "_SrcBigTile";
s_GenListPerVoxelKernel = buildPerVoxelLightListShader.FindKernel(kernelName);
}

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopSettings.cs


// Deferred opaque are always using Fptl. Forward opaque can use Fptl or Cluster, transparent use cluster.
// When MSAA is enabled we disable Fptl as it become expensive compare to cluster
// In HD, MSAA is only supported for forward only rendering, no MSAA in deferred mode (for code complexity reasons)
aggregate.enableFptlForForwardOpaque = aggregate.enableFptlForForwardOpaque && aggregateFrameSettings.enableMSAA;
//aggregate.enableFptlForForwardOpaque = aggregate.enableFptlForForwardOpaque && aggregateFrameSettings.enableMSAA;
aggregate.enableFptlForForwardOpaque = aggregate.enableFptlForForwardOpaque && !aggregateFrameSettings.enableMSAA;
// If Deferred, enable Fptl. If we are forward renderer only and not using Fptl for forward opaque, disable Fptl
aggregate.isFptlEnabled = !aggregateFrameSettings.enableForwardRenderingOnly || aggregate.enableFptlForForwardOpaque;
}

正在加载...
取消
保存