浏览代码

Further cleanups for partial-functionality PR

Getting this branch ready to merge, even though we aren't at full functionality yet
/main
Robert Srinivasiah 7 年前
当前提交
9e90b376
共有 4 个文件被更改,包括 23 次插入24 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  2. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs
  3. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoopSettings.cs
  4. 39
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipeline/FrameSettings.cs

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


{
cmd.ReleaseTemporaryRT(m_DeferredShadowBuffer);
// TODO: I'll leave this as 1x for easy sampling, but I need to make it MSAA
// TODO: For MSAA, we are overriding to 1x, but we'll need to add a Draw path in order to support MSAA properly
CoreUtils.CreateCmdTemporaryRT(cmd, m_DeferredShadowBuffer, hdCamera.renderTextureDesc, 0, FilterMode.Point, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear, 1, true);
m_LightLoop.RenderDeferredDirectionalShadow(hdCamera, m_DeferredShadowBufferRT, GetDepthTexture(), cmd);
PushFullScreenDebugTexture(cmd, m_DeferredShadowBuffer, hdCamera, renderContext, FullScreenDebugMode.DeferredShadows);

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


static int s_GenListPerBigTileKernel;
const bool k_UseDepthBuffer = true; // only has an impact when EnableClustered is true (requires a depth-prepass)
//const bool k_UseDepthBuffer = false; // only has an impact when EnableClustered is true (requires a depth-prepass)
const int k_Log2NumClusters = 6; // accepted range is from 0 to 6. NumClusters is 1<<g_iLog2NumClusters
const float k_ClustLogBase = 1.02f; // each slice 2% bigger than the previous

// Cluster
{
//var kernelName = m_FrameSettings.lightLoopSettings.enableBigTilePrepass ? (k_UseDepthBuffer ? "TileLightListGen_DepthRT_SrcBigTile" : "TileLightListGen_NoDepthRT_SrcBigTile") : (k_UseDepthBuffer ? "TileLightListGen_DepthRT" : "TileLightListGen_NoDepthRT");
if (m_FrameSettings.enableMSAA)
kernelName += "_MSAA";
}

}
if (m_FrameSettings.lightLoopSettings.enableBigTilePrepass)
kernelName += "_SrcBigTile";
s_GenListPerVoxelKernel = buildPerVoxelLightListShader.FindKernel(kernelName);
}

1
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;
// 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;

39
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipeline/FrameSettings.cs


aggregate.enableMSAA = srcFrameSettings.enableMSAA && renderPipelineSettings.supportMSAA;
if (QualitySettings.antiAliasing < 1)
aggregate.enableMSAA = false;
if (aggregate.enableMSAA)
aggregate.ConfigureMSAADependentSettings();
aggregate.enableShadowMask = srcFrameSettings.enableShadowMask && renderPipelineSettings.supportShadowMask;
LightLoopSettings.InitializeLightLoopSettings(camera, aggregate, renderPipelineSettings, srcFrameSettings, ref aggregate.lightLoopSettings);
}
public void ConfigureMSAADependentSettings()
{
if (enableMSAA)
aggregate.enableForwardRenderingOnly = true;
enableForwardRenderingOnly = true;
aggregate.enableMotionVectors = false;
enableMotionVectors = false;
// The work will be implemented piecemeal to support all passes
aggregate.enableDBuffer = false; // no decals
aggregate.enableDistortion = false; // no gaussian final color
aggregate.enablePostprocess = false;
aggregate.enableRoughRefraction = false; // no gaussian pre-refraction
aggregate.enableSSAO = false;
aggregate.enableSSR = false;
aggregate.enableSubsurfaceScattering = false;
aggregate.enableTransparentObjects = false; // trying to skip the depth pyramid
// I also want to disable the deferred directional shadow to start
// TODO: The work will be implemented piecemeal to support all passes
enableDBuffer = false; // no decals
enableDistortion = false; // no gaussian final color
enablePostprocess = false;
enableRoughRefraction = false; // no gaussian pre-refraction
enableSSAO = false;
enableSSR = false;
enableSubsurfaceScattering = false;
enableTransparentObjects = false; // waiting on depth pyramid generation
aggregate.enableShadowMask = srcFrameSettings.enableShadowMask && renderPipelineSettings.supportShadowMask;
LightLoopSettings.InitializeLightLoopSettings(camera, aggregate, renderPipelineSettings, srcFrameSettings, ref aggregate.lightLoopSettings);
}
static public void RegisterDebug(String menuName, FrameSettings frameSettings)

正在加载...
取消
保存