// These need to be Runtime Only because those values are held by the HDRenderPipeline asset so if user change them through the editor debug menu they might change the value in the asset without noticing it.
DebugMenuManager.instance.AddDebugItem<bool>("HDRP","Enable Big Tile",()=>m_Asset.lightLoopSettings.enableBigTilePrepass,(value)=>m_Asset.lightLoopSettings.enableBigTilePrepass=(bool)value,DebugItemFlag.RuntimeOnly);
DebugMenuManager.instance.AddDebugItem<bool>("HDRP","Enable Material Classification",()=>m_Asset.lightLoopSettings.enableComputeMaterialVariants,(value)=>m_Asset.lightLoopSettings.enableComputeMaterialVariants=(bool)value,DebugItemFlag.RuntimeOnly);
DebugMenuManager.instance.AddDebugItem<bool>("HDRP","Enable Big Tile",()=>m_debugSettings.lightLoopSettings.enableBigTilePrepass,(value)=>m_debugSettings.lightLoopSettings.enableBigTilePrepass=(bool)value,DebugItemFlag.RuntimeOnly);
DebugMenuManager.instance.AddDebugItem<bool>("HDRP","Enable Material Classification",()=>m_debugSettings.lightLoopSettings.enableComputeMaterialVariants,(value)=>m_debugSettings.lightLoopSettings.enableComputeMaterialVariants=(bool)value,DebugItemFlag.RuntimeOnly);
// It must also have a "DepthForwardOnly" and no "DepthOnly" pass as forward material (either deferred or forward only rendering) have always a depth pass.
// In case of forward only rendering we have a depth prepass. In case of deferred renderer, it is optional
// Forward opaque material always have a prepass (whether or not we use deferred, whether or not there is option like alpha test only) so we pass the right depth state here.
constboolk_UseDepthBuffer=true;// only has an impact when EnableClustered is true (requires a depth-prepass)
constboolk_UseAsyncCompute=true;// should not use on mobile
constintk_Log2NumClusters=6;// accepted range is from 0 to 6. NumClusters is 1<<g_iLog2NumClusters
constfloatk_ClustLogBase=1.02f;// each slice 2% bigger than the previous
staticComputeBuffers_GlobalLightListAtomic=null;
// clustered light list specific buffers and data end
boolm_isForwardRenderingOnly;
boolm_isFptlEnabled;
boolm_isFptlEnabledForForwardOpaque;
FrameSettingsm_FrameSettings=null;
RenderPipelineResourcesm_Resources=null;
// Following is an array of material of size eight for all combination of keyword: OUTPUT_SPLIT_LIGHTING - LIGHTLOOP_TILE_PASS - SHADOWS_SHADOWMASK - USE_FPTL_LIGHTLIST/USE_CLUSTERED_LIGHTLIST - DEBUG_DISPLAY
// Each camera must have its own per frame settings
[Serializable]
publicstructLightingSettings
// FrameSettings contain settings for a given camera / render. This settings can change from one frame to the other
[DisallowMultipleComponent, ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
publicclassFrameSettings:MonoBehaviour
// Setup by users
publicboolenableShadow;
publicboolenableSSR;// Depends on DepthPyramid
publicboolenableSSAO;
publicboolenableSSSAndTransmission;
// Setup by system
publicfloatdiffuseGlobalDimmer;
publicfloatspecularGlobalDimmer;
publicLightingSettings()
// The settings here are per frame settings.
// Each camera must have its own per frame settings
[Serializable]
publicclassLightingSettings
enableShadow=true;
enableSSR=true;
enableSSAO=true;
enableSSSAndTransmission=true;
// Setup by users
publicboolenableShadow=true;
publicboolenableSSR=true;// Depends on DepthPyramid
publicboolenableSSAO=true;
publicboolenableSSSAndTransmission=true;
diffuseGlobalDimmer=1.0f;
specularGlobalDimmer=1.0f;
// Setup by system
publicfloatdiffuseGlobalDimmer=1.0f;
publicfloatspecularGlobalDimmer=1.0f;
}
[Serializable]
publicstructRenderSettings
{
// Setup by users
publicboolenableForwardRenderingOnly;// TODO: Currently there is no way to strip the extra forward shaders generated by the shaders compiler, so we can switch dynamically.
publicboolenableRoughRefraction;// Depends on DepthPyramid - If not enable, just do a copy of the scene color (?) - how to disable rough refraction ?
publicboolenableTransparentPostPass;
publicboolenableDistortion;
publicboolenablePostprocess;
publicboolenableStereo;
publicboolenableAsyncCompute;
publicboolenableOpaqueObjects;
publicboolenableTransparentObjects;
publicboolenableMSAA;
// Setup by system
publicboolenableMaterialDisplayDebug;
publicboolenableShadowMask;
publicRenderSettings()
[Serializable]
publicclassRenderSettings
enableForwardRenderingOnly=false;
enableDepthPrepassWithDeferredRendering=false;
enableAlphaTestOnlyInDeferredPrepass=false;
// Setup by users
publicboolenableForwardRenderingOnly=false;// TODO: Currently there is no way to strip the extra forward shaders generated by the shaders compiler, so we can switch dynamically.
publicboolenableRoughRefraction=true;// Depends on DepthPyramid - If not enable, just do a copy of the scene color (?) - how to disable rough refraction ?
publicboolenableTransparentPostPass=true;
publicboolenableDistortion=true;
publicboolenablePostprocess=true;
enableStereo=false;
enableAsyncCompute=false;
publicboolenableStereo=false;
publicboolenableAsyncCompute=false;
enableOpaqueObjects=true;
enableTransparentObjects=true;
publicboolenableOpaqueObjects=true;
publicboolenableTransparentObjects=true;
enableMSAA=false;
publicboolenableMSAA=false;
enableMaterialDisplayDebug=false;
enableShadowMask=false;
// Setup by system
publicboolenableMaterialDisplayDebug=false;
publicboolenableShadowMask=false;
}
// FrameSettings contain settings for a given camera / render. This settings can change from one frame to the other