publicreadonlyGUIContentfadeDistance=newGUIContent("Fade Distance","The distance at which the light will smoothly fade before being culled to minimize popping.");
publicreadonlyGUIContentspotInnerPercent=newGUIContent("Inner Percent","Controls size of the angular attenuation in percent of the base angle of the Spot light's cone.");
publicreadonlyGUIContentspotLightShape=newGUIContent("Shape","The shape use for the spotlight. Has an impact on the cookie transformation and light angular attenuation.");
publicreadonlyGUIContentshapeLengthLine=newGUIContent("Length","Length of the line light");
publicreadonlyGUIContentshapeLengthRect=newGUIContent("Size X","SizeX of the rectangle light");
publicreadonlyGUIContentshapeWidthRect=newGUIContent("Size Y","SizeY of the rectangle light");
publicreadonlyGUIContentshapeWidthLine=newGUIContent("Length","Length of the line light");
publicreadonlyGUIContentshapeWidthRect=newGUIContent("Size X","SizeX of the rectangle light");
publicreadonlyGUIContentshapeHeightRect=newGUIContent("Size Y","SizeY of the rectangle light");
publicreadonlyGUIContentapplyRangeAttenuation=newGUIContent("Apply Range Attenuation","Allows disabling range attenuation. This is useful indoor (like a room) to avoid having to setup a large range for a light to get correct inverse square attenuation that may leak out of the indoor");
publicreadonlyGUIContentshape=newGUIContent("Type","Specifies the current type of light. Possible types are Directional, Spot, Point, Rectangle and Line lights.");
// 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);
// Rendering distortion here have off course lot of artifact.
// But resolving at each objects that write in distortion is not possible (need to sort transparent, render those that do not distort, then resolve, then etc...)
// Instead we chose to apply distortion at the end after we cumulate distortion vector and desired blurriness.
// 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
// RenderGBuffer do the gbuffer pass. This is solely call with deferred. If we use a depth prepass, then the depth prepass will perform the alpha testing for opaque apha tested and we don't need to do it anymore
// 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.
// NOTE: All those properties are public because of how HDRenderPipelineInspector retrieves those properties via serialization/reflection
// Doing it this way allows to change parameters name and still retrieve correct serialized values
// To be able to turn on/off FrameSettings properties at runtime for debugging purpose without affecting the original one
// we create a runtime copy (m_ActiveFrameSettings that is used, and any parametrization is done on serialized frameSettings)
publicFrameSettingsserializedFrameSettings=newFrameSettings();// This are the defaultFrameSettings for all the camera and apply to sceneView, public to be visible in the inspector
// Not serialized, not visible, the settings effectively used
publicboolenableTileAndCluster;// For debug / test
publicboolenableComputeLightEvaluation;
publicboolenableComputeLightVariants;
publicboolenableComputeMaterialVariants;
// Deferred opaque always use FPTL, forward opaque can use FPTL or cluster, transparent always use cluster
// When MSAA is enabled, we only support cluster (Fptl is too slow with MSAA), and we don't support MSAA for deferred path (mean it is ok to keep fptl)
publicboolenableFptlForForwardOpaque;
// clustered light list specific buffers and data begin
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
publicstaticstringkEnableMaterialClassification="Enable Material Classification";
// Setup by the users
publicboolenableTileAndCluster=true;
publicboolenableComputeLightEvaluation=true;
publicboolenableComputeLightVariants=true;
publicboolenableComputeMaterialVariants=true;
// Deferred opaque always use FPTL, forward opaque can use FPTL or cluster, transparent always use cluster
// When MSAA is enabled, we only support cluster (Fptl is too slow with MSAA), and we don't support MSAA for deferred path (mean it is ok to keep fptl)
publicboolenableSSR=true;// Depends on DepthPyramid
publicboolenableSSAO=true;
publicboolenableSSSAndTransmission=true;
// Setup by system
publicfloatdiffuseGlobalDimmer=1.0f;
publicfloatspecularGlobalDimmer=1.0f;
// View
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 ?
// RenderPipelineSettings define settings that can't be change during runtime. It is equivalent to the GraphicsSettings of Unity (Tiers + shader variant removal).
// This allow to allocate resource or not for a given feature.
// FrameSettings control within a frame what is enable or not(enableShadow, enableStereo, enableDistortion...).
// HDRenderPipelineAsset reference the current RenderPipelineSettings use, there is one per supported platform(Currently this feature is not implemented and only one GlobalFrameSettings is available).
// A Camera with HDAdditionalData have one FrameSettings that configure how it will render.For example a camera use for reflection will disable distortion and postprocess.
// Additionally on a Camera there is another FrameSettings call ActiveFrameSettings that is created on the fly based on FrameSettings and allow modification for debugging purpose at runtime without being serialized on disk.
// The ActiveFrameSettings is register in the debug windows at the creation of the camera.
// A Camera with HDAdditionalData have a RenderPath that define if it use a "Default" FrameSettings, a preset of FrameSettings or a custom one.
// HDRenderPipelineAsset contain a "Default" FrameSettings that can be reference by any camera with RenderPath.Defaut or when the camera don't have HDAdditionalData like the camera of the Editor.
// It also contain a DefaultActiveFrameSettings
// RenderPipelineSettings represent settings that are immutable at runtime.
// There is a dedicated RenderPipelineSettings for each platform
publicbooluseForwardRenderingOnly;// TODO: Currently there is no way to strip the extra forward shaders generated by the shaders compiler, so we can switch dynamically.
publicbooluseDepthPrepassWithDeferredRendering;
publicboolrenderAlphaTestOnlyInDeferredPrepass;
// We have to fall back to forward-only rendering when scene view is using wireframe rendering mode --
// as rendering everything in wireframe + deferred do not play well together