public static void RegisterDebug(string menuName, LightLoopSettings lightLoopSettings)
        {
            s_DebugEntries = new DebugUI.Widget[]
            {
                new DebugUI.BoolField {
                    displayName = "Enable Fptl for Forward Opaque", getter = () => lightLoopSettings.enableFptlForForwardOpaque, setter = value => lightLoopSettings.enableFptlForForwardOpaque = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Tile/Cluster", getter = () => lightLoopSettings.enableTileAndCluster, setter = value => lightLoopSettings.enableTileAndCluster = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Big Tile", getter = () => lightLoopSettings.enableBigTilePrepass, setter = value => lightLoopSettings.enableBigTilePrepass = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Compute Lighting", getter = () => lightLoopSettings.enableComputeLightEvaluation, setter = value => lightLoopSettings.enableComputeLightEvaluation = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Light Classification", getter = () => lightLoopSettings.enableComputeLightVariants, setter = value => lightLoopSettings.enableComputeLightVariants = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Material Classification", getter = () => lightLoopSettings.enableComputeMaterialVariants, setter = value => lightLoopSettings.enableComputeMaterialVariants = value
                }
            };

            var panel = DebugManager.instance.GetPanel(menuName, true);

            panel.children.Add(s_DebugEntries);
        }
Exemple #2
0
 public static void RegisterDebug(LightLoopSettings lightLoopSettings, List <DebugUI.Widget> widgets)
 {
     widgets.AddRange(new[]
     {
         new DebugUI.Foldout
         {
             displayName = "Light Loop Settings",
             children    =
             {
                 // Uncomment if you re-enable LIGHTLOOP_SINGLE_PASS multi_compile in lit*.shader
                 //new DebugUI.BoolField { displayName = "Enable Tile/Cluster", getter = () => lightLoopSettings.enableTileAndCluster, setter = value => lightLoopSettings.enableTileAndCluster = value },
                 new DebugUI.BoolField {
                     displayName = "Enable Fptl for Forward Opaque", getter = () => lightLoopSettings.enableFptlForForwardOpaque, setter = value => lightLoopSettings.enableFptlForForwardOpaque = value
                 },
                 new DebugUI.BoolField {
                     displayName = "Enable Big Tile", getter = () => lightLoopSettings.enableBigTilePrepass, setter = value => lightLoopSettings.enableBigTilePrepass = value
                 },
                 new DebugUI.BoolField {
                     displayName = "Enable Compute Lighting", getter = () => lightLoopSettings.enableComputeLightEvaluation, setter = value => lightLoopSettings.enableComputeLightEvaluation = value
                 },
                 new DebugUI.BoolField {
                     displayName = "Enable Light Classification", getter = () => lightLoopSettings.enableComputeLightVariants, setter = value => lightLoopSettings.enableComputeLightVariants = value
                 },
                 new DebugUI.BoolField {
                     displayName = "Enable Material Classification", getter = () => lightLoopSettings.enableComputeMaterialVariants, setter = value => lightLoopSettings.enableComputeMaterialVariants = value
                 }
             }
         }
     });
 }
Exemple #3
0
        // aggregateFrameSettings already contain the aggregation of RenderPipelineSettings and FrameSettings (regular and/or debug)
        public static void InitializeLightLoopSettings(Camera camera, FrameSettings aggregateFrameSettings,
                                                       RenderPipelineSettings renderPipelineSettings, FrameSettings frameSettings,
                                                       ref LightLoopSettings aggregate)
        {
            if (aggregate == null)
            {
                aggregate = new LightLoopSettings();
            }

            aggregate.enableTileAndCluster          = frameSettings.lightLoopSettings.enableTileAndCluster;
            aggregate.enableComputeLightEvaluation  = frameSettings.lightLoopSettings.enableComputeLightEvaluation;
            aggregate.enableComputeLightVariants    = frameSettings.lightLoopSettings.enableComputeLightVariants;
            aggregate.enableComputeMaterialVariants = frameSettings.lightLoopSettings.enableComputeMaterialVariants;
            aggregate.enableFptlForForwardOpaque    = frameSettings.lightLoopSettings.enableFptlForForwardOpaque;
            aggregate.enableBigTilePrepass          = frameSettings.lightLoopSettings.enableBigTilePrepass;

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

            // disable FPTL for stereo for now
            aggregate.enableFptlForForwardOpaque = aggregate.enableFptlForForwardOpaque && XRGraphics.enabled;

            // If Deferred, enable Fptl. If we are forward renderer only and not using Fptl for forward opaque, disable Fptl
            aggregate.isFptlEnabled = aggregateFrameSettings.shaderLitMode == LitShaderMode.Deferred || aggregate.enableFptlForForwardOpaque;
        }
 public static void RegisterDebug(LightLoopSettings lightLoopSettings, List <DebugUI.Widget> widgets)
 {
     widgets.AddRange(new []
     {
         new DebugUI.Container
         {
             displayName = "Lighting Settings",
             children    =
             {
                 new DebugUI.BoolField {
                     displayName = "Enable Fptl for Forward Opaque", getter = () => lightLoopSettings.enableFptlForForwardOpaque, setter = value => lightLoopSettings.enableFptlForForwardOpaque = value
                 },
                 new DebugUI.BoolField {
                     displayName = "Enable Tile/Cluster", getter = () => lightLoopSettings.enableTileAndCluster, setter = value => lightLoopSettings.enableTileAndCluster = value
                 },
                 new DebugUI.BoolField {
                     displayName = "Enable Big Tile", getter = () => lightLoopSettings.enableBigTilePrepass, setter = value => lightLoopSettings.enableBigTilePrepass = value
                 },
                 new DebugUI.BoolField {
                     displayName = "Enable Compute Lighting", getter = () => lightLoopSettings.enableComputeLightEvaluation, setter = value => lightLoopSettings.enableComputeLightEvaluation = value
                 },
                 new DebugUI.BoolField {
                     displayName = "Enable Light Classification", getter = () => lightLoopSettings.enableComputeLightVariants, setter = value => lightLoopSettings.enableComputeLightVariants = value
                 },
                 new DebugUI.BoolField {
                     displayName = "Enable Material Classification", getter = () => lightLoopSettings.enableComputeMaterialVariants, setter = value => lightLoopSettings.enableComputeMaterialVariants = value
                 }
             }
         }
     });
 }
Exemple #5
0
        static public void UnRegisterDebug(String menuName)
        {
            // Register the camera into the debug menu
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableShadow);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableContactShadows);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableSSR);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableSSAO);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableSubsurfaceScattering);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableTransmission);

            DebugMenuManager.instance.RemoveDebugItem(menuName, kForwardOnly);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kDeferredDepthPrepass);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kDeferredDepthPrepassATestOnly);

            DebugMenuManager.instance.RemoveDebugItem(menuName, KEnableTransparentPrepass);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableMotionVectors);
            DebugMenuManager.instance.RemoveDebugItem(menuName, KEnableObjectMotionVectors);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableDBuffer);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableAtmosphericScattering);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableRoughRefraction);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableTransparentPostpass);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableDistortion);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnablePostprocess);

            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableStereoRendering);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableAsyncCompute);

            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableOpaqueObjects);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableTransparentObjects);

            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableMSAA);
            DebugMenuManager.instance.RemoveDebugItem(menuName, kEnableShadowMask);

            LightLoopSettings.UnRegisterDebug(menuName);
        }
Exemple #6
0
        static public void RegisterDebug(String menuName, FrameSettings frameSettings)
        {
            // Register the camera into the debug menu
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableShadow, () => frameSettings.enableShadow, (value) => frameSettings.enableShadow = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableContactShadows, () => frameSettings.enableContactShadows, (value) => frameSettings.enableContactShadows = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableSSR, () => frameSettings.enableSSR, (value) => frameSettings.enableSSR    = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableSSAO, () => frameSettings.enableSSAO, (value) => frameSettings.enableSSAO = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableSubsurfaceScattering, () => frameSettings.enableSubsurfaceScattering, (value) => frameSettings.enableSubsurfaceScattering = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableTransmission, () => frameSettings.enableTransmission, (value) => frameSettings.enableTransmission = (bool)value);

            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kForwardOnly, () => frameSettings.enableForwardRenderingOnly, (value) => frameSettings.enableForwardRenderingOnly = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kDeferredDepthPrepass, () => frameSettings.enableDepthPrepassWithDeferredRendering, (value) => frameSettings.enableDepthPrepassWithDeferredRendering    = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kDeferredDepthPrepassATestOnly, () => frameSettings.enableAlphaTestOnlyInDeferredPrepass, (value) => frameSettings.enableAlphaTestOnlyInDeferredPrepass = (bool)value);

            DebugMenuManager.instance.AddDebugItem <bool>(menuName, KEnableTransparentPrepass, () => frameSettings.enableTransparentPrepass, (value) => frameSettings.enableTransparentPrepass = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableMotionVectors, () => frameSettings.enableMotionVectors, (value) => frameSettings.enableMotionVectors = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, KEnableObjectMotionVectors, () => frameSettings.enableObjectMotionVectors, (value) => frameSettings.enableObjectMotionVectors = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableDBuffer, () => frameSettings.enableDBuffer, (value) => frameSettings.enableDBuffer = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableAtmosphericScattering, () => frameSettings.enableAtmosphericScattering, (value) => frameSettings.enableAtmosphericScattering = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableRoughRefraction, () => frameSettings.enableRoughRefraction, (value) => frameSettings.enableRoughRefraction             = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableTransparentPostpass, () => frameSettings.enableTransparentPostpass, (value) => frameSettings.enableTransparentPostpass = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableDistortion, () => frameSettings.enableDistortion, (value) => frameSettings.enableDistortion    = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnablePostprocess, () => frameSettings.enablePostprocess, (value) => frameSettings.enablePostprocess = (bool)value);

            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableStereoRendering, () => frameSettings.enableStereo, (value) => frameSettings.enableStereo          = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableAsyncCompute, () => frameSettings.enableAsyncCompute, (value) => frameSettings.enableAsyncCompute = (bool)value);

            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableOpaqueObjects, () => frameSettings.enableOpaqueObjects, (value) => frameSettings.enableOpaqueObjects = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableTransparentObjects, () => frameSettings.enableTransparentObjects, (value) => frameSettings.enableTransparentObjects = (bool)value);

            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableMSAA, () => frameSettings.enableMSAA, (value) => frameSettings.enableMSAA = (bool)value);
            DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableShadowMask, () => frameSettings.enableShadowMask, (value) => frameSettings.enableShadowMask = (bool)value);

            LightLoopSettings.RegisterDebug(menuName, frameSettings.lightLoopSettings);
        }
Exemple #7
0
        // Init a FrameSettings from renderpipeline settings, frame settings and debug settings (if any)
        // This will aggregate the various option
        public static void InitializeFrameSettings(Camera camera, RenderPipelineSettings renderPipelineSettings, FrameSettings srcFrameSettings, ref FrameSettings aggregate)
        {
            if (aggregate == null)
            {
                aggregate = new FrameSettings();
            }

            // When rendering reflection probe we disable specular as it is view dependent
            if (camera.cameraType == CameraType.Reflection)
            {
                aggregate.diffuseGlobalDimmer  = 1.0f;
                aggregate.specularGlobalDimmer = 0.0f;
            }
            else
            {
                aggregate.diffuseGlobalDimmer  = 1.0f;
                aggregate.specularGlobalDimmer = 1.0f;
            }

            aggregate.enableShadow               = srcFrameSettings.enableShadow;
            aggregate.enableContactShadows       = srcFrameSettings.enableContactShadows;
            aggregate.enableSSR                  = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableSSR && renderPipelineSettings.supportSSR;
            aggregate.enableSSAO                 = srcFrameSettings.enableSSAO && renderPipelineSettings.supportSSAO;
            aggregate.enableSubsurfaceScattering = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableSubsurfaceScattering && renderPipelineSettings.supportSubsurfaceScattering;
            aggregate.enableTransmission         = srcFrameSettings.enableTransmission;

            // 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
            aggregate.enableForwardRenderingOnly = srcFrameSettings.enableForwardRenderingOnly || GL.wireframe;
            aggregate.enableDepthPrepassWithDeferredRendering = srcFrameSettings.enableDepthPrepassWithDeferredRendering;
            aggregate.enableAlphaTestOnlyInDeferredPrepass    = srcFrameSettings.enableAlphaTestOnlyInDeferredPrepass;

            aggregate.enableTransparentPrepass    = srcFrameSettings.enableTransparentPrepass;
            aggregate.enableMotionVectors         = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableMotionVectors;
            aggregate.enableObjectMotionVectors   = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableObjectMotionVectors;
            aggregate.enableDBuffer               = srcFrameSettings.enableDBuffer && renderPipelineSettings.supportDBuffer;
            aggregate.enableAtmosphericScattering = srcFrameSettings.enableAtmosphericScattering;
            aggregate.enableRoughRefraction       = srcFrameSettings.enableRoughRefraction;
            aggregate.enableTransparentPostpass   = srcFrameSettings.enableTransparentPostpass;
            aggregate.enableDistortion            = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableDistortion;

            // Planar and real time cubemap doesn't need post process and render in FP16
            aggregate.enablePostprocess = camera.cameraType != CameraType.Reflection && srcFrameSettings.enablePostprocess;

            aggregate.enableStereo = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableStereo && XRSettings.isDeviceActive && (camera.stereoTargetEye == StereoTargetEyeMask.Both);
            // Force forward if we request stereo. TODO: We should not enforce that, users should be able to chose deferred
            aggregate.enableForwardRenderingOnly = aggregate.enableForwardRenderingOnly || aggregate.enableStereo;

            aggregate.enableAsyncCompute = srcFrameSettings.enableAsyncCompute && SystemInfo.supportsAsyncCompute;

            aggregate.enableOpaqueObjects      = srcFrameSettings.enableOpaqueObjects;
            aggregate.enableTransparentObjects = srcFrameSettings.enableTransparentObjects;

            aggregate.enableMSAA = srcFrameSettings.enableMSAA && renderPipelineSettings.supportMSAA;

            aggregate.enableShadowMask = srcFrameSettings.enableShadowMask && renderPipelineSettings.supportShadowMask;

            LightLoopSettings.InitializeLightLoopSettings(camera, aggregate, renderPipelineSettings, srcFrameSettings, ref aggregate.lightLoopSettings);
        }
 static public void RegisterDebug(String menuName, LightLoopSettings lightLoopSettings)
 {
     DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableTileCluster, () => lightLoopSettings.enableTileAndCluster, (value) => lightLoopSettings.enableTileAndCluster = (bool)value);
     DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableBigTile, () => lightLoopSettings.enableBigTilePrepass, (value) => lightLoopSettings.enableBigTilePrepass     = (bool)value);
     DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableComputeLighting, () => lightLoopSettings.enableComputeLightEvaluation, (value) => lightLoopSettings.enableComputeLightEvaluation          = (bool)value);
     DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableLightclassification, () => lightLoopSettings.enableComputeLightVariants, (value) => lightLoopSettings.enableComputeLightVariants          = (bool)value);
     DebugMenuManager.instance.AddDebugItem <bool>(menuName, kEnableMaterialClassification, () => lightLoopSettings.enableComputeMaterialVariants, (value) => lightLoopSettings.enableComputeMaterialVariants = (bool)value);
 }
Exemple #9
0
        public static void UnRegisterDebug(string menuName)
        {
            var panel = DebugManager.instance.GetPanel(menuName);

            if (panel != null)
            {
                panel.children.Remove(s_DebugEntries);
            }

            LightLoopSettings.UnRegisterDebug(menuName);
        }
Exemple #10
0
        public void CopyTo(LightLoopSettings lightLoopSettings)
        {
            lightLoopSettings.enableTileAndCluster          = this.enableTileAndCluster;
            lightLoopSettings.enableComputeLightEvaluation  = this.enableComputeLightEvaluation;
            lightLoopSettings.enableComputeLightVariants    = this.enableComputeLightVariants;
            lightLoopSettings.enableComputeMaterialVariants = this.enableComputeMaterialVariants;

            lightLoopSettings.enableFptlForForwardOpaque = this.enableFptlForForwardOpaque;
            lightLoopSettings.enableBigTilePrepass       = this.enableBigTilePrepass;

            lightLoopSettings.isFptlEnabled = this.isFptlEnabled;
        }
Exemple #11
0
        public void ApplyOverrideOn(LightLoopSettings overridedFrameSettings)
        {
            if (overrides == 0)
            {
                return;
            }

            Array values = Enum.GetValues(typeof(LightLoopSettingsOverrides));

            foreach (LightLoopSettingsOverrides val in values)
            {
                if ((val & overrides) > 0)
                {
                    s_Overrides[val](overridedFrameSettings, this);
                }
            }

            //propagate override to be chained
            overridedFrameSettings.overrides = overrides | overridedFrameSettings.overrides;
        }
        // aggregateFrameSettings already contain the aggregation of RenderPipelineSettings and FrameSettings (regular and/or debug)
        static public LightLoopSettings InitializeLightLoopSettings(Camera camera, FrameSettings aggregateFrameSettings,
                                                                    RenderPipelineSettings renderPipelineSettings, FrameSettings frameSettings)
        {
            LightLoopSettings aggregate = new LightLoopSettings();

            aggregate.enableTileAndCluster          = frameSettings.lightLoopSettings.enableTileAndCluster;
            aggregate.enableComputeLightEvaluation  = frameSettings.lightLoopSettings.enableComputeLightEvaluation;
            aggregate.enableComputeLightVariants    = frameSettings.lightLoopSettings.enableComputeLightVariants;
            aggregate.enableComputeMaterialVariants = frameSettings.lightLoopSettings.enableComputeMaterialVariants;
            aggregate.enableFptlForForwardOpaque    = frameSettings.lightLoopSettings.enableFptlForForwardOpaque;
            aggregate.enableBigTilePrepass          = frameSettings.lightLoopSettings.enableBigTilePrepass;

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

            return(aggregate);
        }
Exemple #13
0
        public LightLoopSettings Override(LightLoopSettings overridedFrameSettings)
        {
            if (overrides == 0)
            {
                //nothing to override
                return(overridedFrameSettings);
            }

            LightLoopSettings result = new LightLoopSettings(overridedFrameSettings);
            Array             values = Enum.GetValues(typeof(LightLoopSettingsOverrides));

            foreach (LightLoopSettingsOverrides val in values)
            {
                if ((val & overrides) > 0)
                {
                    s_Overrides[val](result, this);
                }
            }

            //propagate override to be chained
            result.overrides = overrides | overridedFrameSettings.overrides;
            return(result);
        }
        // Init a FrameSettings from renderpipeline settings, frame settings and debug settings (if any)
        // This will aggregate the various option
        public static void InitializeFrameSettings(Camera camera, RenderPipelineSettings renderPipelineSettings, FrameSettings srcFrameSettings, ref FrameSettings aggregate)
        {
            if (aggregate == null)
            {
                aggregate = new FrameSettings();
            }

            // When rendering reflection probe we disable specular as it is view dependent
            if (camera.cameraType == CameraType.Reflection)
            {
                aggregate.diffuseGlobalDimmer  = 1.0f;
                aggregate.specularGlobalDimmer = 0.0f;
            }
            else
            {
                aggregate.diffuseGlobalDimmer  = 1.0f;
                aggregate.specularGlobalDimmer = 1.0f;
            }

            aggregate.enableShadow                = srcFrameSettings.enableShadow;
            aggregate.enableContactShadows        = srcFrameSettings.enableContactShadows;
            aggregate.enableShadowMask            = srcFrameSettings.enableShadowMask && renderPipelineSettings.supportShadowMask;
            aggregate.enableSSR                   = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableSSR && renderPipelineSettings.supportSSR;
            aggregate.enableSSAO                  = srcFrameSettings.enableSSAO && renderPipelineSettings.supportSSAO;
            aggregate.enableSubsurfaceScattering  = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableSubsurfaceScattering && renderPipelineSettings.supportSubsurfaceScattering;
            aggregate.enableTransmission          = srcFrameSettings.enableTransmission;
            aggregate.enableAtmosphericScattering = srcFrameSettings.enableAtmosphericScattering;
            // We must take care of the scene view fog flags in the editor
            if (!CoreUtils.IsSceneViewFogEnabled(camera))
            {
                aggregate.enableAtmosphericScattering = false;
            }
            // Volumetric are disabled if there is no atmospheric scattering
            aggregate.enableVolumetrics = srcFrameSettings.enableVolumetrics && renderPipelineSettings.supportVolumetrics && aggregate.enableAtmosphericScattering;

            // TODO: Add support of volumetric in planar reflection
            if (camera.cameraType == CameraType.Reflection)
            {
                aggregate.enableVolumetrics = false;
            }

            aggregate.enableLightLayers = srcFrameSettings.enableLightLayers && renderPipelineSettings.supportLightLayers;

            // 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
            aggregate.enableForwardRenderingOnly = srcFrameSettings.enableForwardRenderingOnly || GL.wireframe || renderPipelineSettings.supportOnlyForward;
            aggregate.enableDepthPrepassWithDeferredRendering = srcFrameSettings.enableDepthPrepassWithDeferredRendering;

            aggregate.enableTransparentPrepass  = srcFrameSettings.enableTransparentPrepass;
            aggregate.enableMotionVectors       = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableMotionVectors && renderPipelineSettings.supportMotionVectors;
            aggregate.enableObjectMotionVectors = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableObjectMotionVectors && renderPipelineSettings.supportMotionVectors;
            aggregate.enableDecals              = srcFrameSettings.enableDecals && renderPipelineSettings.supportDecals;
            aggregate.enableRoughRefraction     = srcFrameSettings.enableRoughRefraction;
            aggregate.enableTransparentPostpass = srcFrameSettings.enableTransparentPostpass;
            aggregate.enableDistortion          = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableDistortion;

            // Planar and real time cubemap doesn't need post process and render in FP16
            aggregate.enablePostprocess = camera.cameraType != CameraType.Reflection && srcFrameSettings.enablePostprocess;

#if UNITY_SWITCH
            aggregate.enableStereo = false;
#else
            aggregate.enableStereo = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableStereo && XRSettings.isDeviceActive && (camera.stereoTargetEye == StereoTargetEyeMask.Both) && renderPipelineSettings.supportStereo;
#endif

            aggregate.enableAsyncCompute = srcFrameSettings.enableAsyncCompute && SystemInfo.supportsAsyncCompute;

            aggregate.enableOpaqueObjects      = srcFrameSettings.enableOpaqueObjects;
            aggregate.enableTransparentObjects = srcFrameSettings.enableTransparentObjects;

            aggregate.enableMSAA = srcFrameSettings.enableMSAA && renderPipelineSettings.supportMSAA;

            aggregate.ConfigureMSAADependentSettings();
            aggregate.ConfigureStereoDependentSettings();

            // Disable various option for the preview except if we are a Camera Editor preview
            if (HDUtils.IsRegularPreviewCamera(camera))
            {
                aggregate.enableShadow                = false;
                aggregate.enableContactShadows        = false;
                aggregate.enableShadowMask            = false;
                aggregate.enableSSR                   = false;
                aggregate.enableSSAO                  = false;
                aggregate.enableAtmosphericScattering = false;
                aggregate.enableVolumetrics           = false;
                aggregate.enableLightLayers           = false;
                aggregate.enableTransparentPrepass    = false;
                aggregate.enableMotionVectors         = false;
                aggregate.enableObjectMotionVectors   = false;
                aggregate.enableDecals                = false;
                aggregate.enableTransparentPostpass   = false;
                aggregate.enableDistortion            = false;
                aggregate.enablePostprocess           = false;
                aggregate.enableStereo                = false;
            }

            LightLoopSettings.InitializeLightLoopSettings(camera, aggregate, renderPipelineSettings, srcFrameSettings, ref aggregate.lightLoopSettings);
        }
        public static void RegisterDebug(string menuName, FrameSettings frameSettings)
        {
            List <DebugUI.Widget> widgets = new List <DebugUI.Widget>();

            widgets.AddRange(
                new DebugUI.Widget[]
            {
                new DebugUI.Foldout
                {
                    displayName = "Rendering Passes",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Enable Transparent Prepass", getter = () => frameSettings.enableTransparentPrepass, setter = value => frameSettings.enableTransparentPrepass = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Transparent Postpass", getter = () => frameSettings.enableTransparentPostpass, setter = value => frameSettings.enableTransparentPostpass = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Motion Vectors", getter = () => frameSettings.enableMotionVectors, setter = value => frameSettings.enableMotionVectors = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Object Motion Vectors", getter = () => frameSettings.enableObjectMotionVectors, setter = value => frameSettings.enableObjectMotionVectors = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable DBuffer", getter = () => frameSettings.enableDecals, setter = value => frameSettings.enableDecals = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Rough Refraction", getter = () => frameSettings.enableRoughRefraction, setter = value => frameSettings.enableRoughRefraction = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Distortion", getter = () => frameSettings.enableDistortion, setter = value => frameSettings.enableDistortion = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Postprocess", getter = () => frameSettings.enablePostprocess, setter = value => frameSettings.enablePostprocess = value
                        },
                    }
                },
                new DebugUI.Foldout
                {
                    displayName = "Rendering Settings",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Forward Only", getter = () => frameSettings.enableForwardRenderingOnly, setter = value => frameSettings.enableForwardRenderingOnly = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Deferred Depth Prepass", getter = () => frameSettings.enableDepthPrepassWithDeferredRendering, setter = value => frameSettings.enableDepthPrepassWithDeferredRendering = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Async Compute", getter = () => frameSettings.enableAsyncCompute, setter = value => frameSettings.enableAsyncCompute = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Opaque Objects", getter = () => frameSettings.enableOpaqueObjects, setter = value => frameSettings.enableOpaqueObjects = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Transparent Objects", getter = () => frameSettings.enableTransparentObjects, setter = value => frameSettings.enableTransparentObjects = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable MSAA", getter = () => frameSettings.enableMSAA, setter = value => frameSettings.enableMSAA = value
                        },
                    }
                },
                new DebugUI.Foldout
                {
                    displayName = "XR Settings",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Enable Stereo Rendering", getter = () => frameSettings.enableStereo, setter = value => frameSettings.enableStereo = value
                        }
                    }
                },
                new DebugUI.Foldout
                {
                    displayName = "Lighting Settings",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Enable SSR", getter = () => frameSettings.enableSSR, setter = value => frameSettings.enableSSR = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable SSAO", getter = () => frameSettings.enableSSAO, setter = value => frameSettings.enableSSAO = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable SubsurfaceScattering", getter = () => frameSettings.enableSubsurfaceScattering, setter = value => frameSettings.enableSubsurfaceScattering = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Transmission", getter = () => frameSettings.enableTransmission, setter = value => frameSettings.enableTransmission = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Shadows", getter = () => frameSettings.enableShadow, setter = value => frameSettings.enableShadow = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Contact Shadows", getter = () => frameSettings.enableContactShadows, setter = value => frameSettings.enableContactShadows = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable ShadowMask", getter = () => frameSettings.enableShadowMask, setter = value => frameSettings.enableShadowMask = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Atmospheric Scattering", getter = () => frameSettings.enableAtmosphericScattering, setter = value => frameSettings.enableAtmosphericScattering = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Volumetrics", getter = () => frameSettings.enableVolumetrics, setter = value => frameSettings.enableVolumetrics = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable LightLayers", getter = () => frameSettings.enableLightLayers, setter = value => frameSettings.enableLightLayers = value
                        },
                    }
                }
            });

            LightLoopSettings.RegisterDebug(frameSettings.lightLoopSettings, widgets);

            var panel = DebugManager.instance.GetPanel(menuName, true);

            panel.children.Add(widgets.ToArray());
        }
Exemple #16
0
        public static void RegisterDebug(string menuName, FrameSettings frameSettings)
        {
            s_DebugEntries = new DebugUI.Widget[]
            {
                new DebugUI.BoolField {
                    displayName = "Enable Shadows", getter = () => frameSettings.enableShadow, setter = value => frameSettings.enableShadow = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Contact Shadows", getter = () => frameSettings.enableContactShadows, setter = value => frameSettings.enableContactShadows = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable SSR", getter = () => frameSettings.enableSSR, setter = value => frameSettings.enableSSR = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable SSAO", getter = () => frameSettings.enableSSAO, setter = value => frameSettings.enableSSAO = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable SubsurfaceScattering", getter = () => frameSettings.enableSubsurfaceScattering, setter = value => frameSettings.enableSubsurfaceScattering = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Transmission", getter = () => frameSettings.enableTransmission, setter = value => frameSettings.enableTransmission = value
                },

                new DebugUI.BoolField {
                    displayName = "Forward Only", getter = () => frameSettings.enableForwardRenderingOnly, setter = value => frameSettings.enableForwardRenderingOnly = value
                },
                new DebugUI.BoolField {
                    displayName = "Deferred Depth Prepass", getter = () => frameSettings.enableDepthPrepassWithDeferredRendering, setter = value => frameSettings.enableDepthPrepassWithDeferredRendering = value
                },
                new DebugUI.BoolField {
                    displayName = "Deferred Depth Prepass ATest Only", getter = () => frameSettings.enableAlphaTestOnlyInDeferredPrepass, setter = value => frameSettings.enableAlphaTestOnlyInDeferredPrepass = value
                },

                new DebugUI.BoolField {
                    displayName = "Enable Transparent Prepass", getter = () => frameSettings.enableTransparentPrepass, setter = value => frameSettings.enableTransparentPrepass = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Motion Vectors", getter = () => frameSettings.enableMotionVectors, setter = value => frameSettings.enableMotionVectors = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Object Motion Vectors", getter = () => frameSettings.enableObjectMotionVectors, setter = value => frameSettings.enableObjectMotionVectors = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable DBuffer", getter = () => frameSettings.enableDBuffer, setter = value => frameSettings.enableDBuffer = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Atmospheric Scattering", getter = () => frameSettings.enableAtmosphericScattering, setter = value => frameSettings.enableAtmosphericScattering = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Rough Refraction", getter = () => frameSettings.enableRoughRefraction, setter = value => frameSettings.enableRoughRefraction = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Transparent Postpass", getter = () => frameSettings.enableTransparentPostpass, setter = value => frameSettings.enableTransparentPostpass = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Distortion", getter = () => frameSettings.enableDistortion, setter = value => frameSettings.enableDistortion = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Postprocess", getter = () => frameSettings.enablePostprocess, setter = value => frameSettings.enablePostprocess = value
                },

                new DebugUI.BoolField {
                    displayName = "Enable Stereo Rendering", getter = () => frameSettings.enableStereo, setter = value => frameSettings.enableStereo = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Async Compute", getter = () => frameSettings.enableAsyncCompute, setter = value => frameSettings.enableAsyncCompute = value
                },

                new DebugUI.BoolField {
                    displayName = "Enable Opaque Objects", getter = () => frameSettings.enableOpaqueObjects, setter = value => frameSettings.enableOpaqueObjects = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable Transparent Objects", getter = () => frameSettings.enableTransparentObjects, setter = value => frameSettings.enableTransparentObjects = value
                },

                new DebugUI.BoolField {
                    displayName = "Enable MSAA", getter = () => frameSettings.enableMSAA, setter = value => frameSettings.enableMSAA = value
                },
                new DebugUI.BoolField {
                    displayName = "Enable ShadowMask", getter = () => frameSettings.enableShadowMask, setter = value => frameSettings.enableShadowMask = value
                },
            };

            var panel = DebugManager.instance.GetPanel(menuName, true);

            panel.children.Add(s_DebugEntries);

            LightLoopSettings.RegisterDebug(menuName, frameSettings.lightLoopSettings);
        }
Exemple #17
0
 public LightLoopSettings(LightLoopSettings toCopy)
 {
     toCopy.CopyTo(this);
 }
Exemple #18
0
        // Init a FrameSettings from renderpipeline settings, frame settings and debug settings (if any)
        // This will aggregate the various option
        public static void InitializeFrameSettings(Camera camera, RenderPipelineSettings renderPipelineSettings, FrameSettings srcFrameSettings, ref FrameSettings aggregate)
        {
            if (aggregate == null)
            {
                aggregate = new FrameSettings();
            }

            // When rendering reflection probe we disable specular as it is view dependent
            if (camera.cameraType == CameraType.Reflection)
            {
                aggregate.diffuseGlobalDimmer  = 1.0f;
                aggregate.specularGlobalDimmer = 0.0f;
            }
            else
            {
                aggregate.diffuseGlobalDimmer  = 1.0f;
                aggregate.specularGlobalDimmer = 1.0f;
            }

            aggregate.enableShadow                = srcFrameSettings.enableShadow;
            aggregate.enableContactShadows        = srcFrameSettings.enableContactShadows;
            aggregate.enableShadowMask            = srcFrameSettings.enableShadowMask && renderPipelineSettings.supportShadowMask;
            aggregate.enableSSR                   = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableSSR && renderPipelineSettings.supportSSR; // No recursive reflections
            aggregate.enableSSAO                  = srcFrameSettings.enableSSAO && renderPipelineSettings.supportSSAO;
            aggregate.enableSubsurfaceScattering  = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableSubsurfaceScattering && renderPipelineSettings.supportSubsurfaceScattering;
            aggregate.enableTransmission          = srcFrameSettings.enableTransmission;
            aggregate.enableAtmosphericScattering = srcFrameSettings.enableAtmosphericScattering;
            // We must take care of the scene view fog flags in the editor
            if (!CoreUtils.IsSceneViewFogEnabled(camera))
            {
                aggregate.enableAtmosphericScattering = false;
            }
            // Volumetric are disabled if there is no atmospheric scattering
            aggregate.enableVolumetrics = srcFrameSettings.enableVolumetrics && renderPipelineSettings.supportVolumetrics && aggregate.enableAtmosphericScattering;
            aggregate.enableReprojectionForVolumetrics = srcFrameSettings.enableReprojectionForVolumetrics;

            // TODO: Add support of volumetric in planar reflection
            if (camera.cameraType == CameraType.Reflection)
            {
                aggregate.enableVolumetrics = false;
            }

            aggregate.enableLightLayers = srcFrameSettings.enableLightLayers && renderPipelineSettings.supportLightLayers;

            // 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
            if (GL.wireframe) //force forward mode for wireframe
            {
                aggregate.shaderLitMode = LitShaderMode.Forward;
            }
            else
            {
                switch (renderPipelineSettings.supportedLitShaderMode)
                {
                case RenderPipelineSettings.SupportedLitShaderMode.ForwardOnly:
                    aggregate.shaderLitMode = LitShaderMode.Forward;
                    break;

                case RenderPipelineSettings.SupportedLitShaderMode.DeferredOnly:
                    aggregate.shaderLitMode = LitShaderMode.Deferred;
                    break;

                case RenderPipelineSettings.SupportedLitShaderMode.Both:
                    aggregate.shaderLitMode = srcFrameSettings.shaderLitMode;
                    break;
                }
            }

            aggregate.enableDepthPrepassWithDeferredRendering = srcFrameSettings.enableDepthPrepassWithDeferredRendering;

            aggregate.enableTransparentPrepass = srcFrameSettings.enableTransparentPrepass;
            aggregate.enableMotionVectors      = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableMotionVectors && renderPipelineSettings.supportMotionVectors;
            // Object motion vector are disabled if motion vector are disabled
            aggregate.enableObjectMotionVectors = srcFrameSettings.enableObjectMotionVectors && aggregate.enableMotionVectors;
            aggregate.enableDecals              = srcFrameSettings.enableDecals && renderPipelineSettings.supportDecals;
            aggregate.enableRoughRefraction     = srcFrameSettings.enableRoughRefraction;
            aggregate.enableTransparentPostpass = srcFrameSettings.enableTransparentPostpass;
            aggregate.enableDistortion          = camera.cameraType != CameraType.Reflection && srcFrameSettings.enableDistortion;

            // Planar and real time cubemap doesn't need post process and render in FP16
            aggregate.enablePostprocess = camera.cameraType != CameraType.Reflection && srcFrameSettings.enablePostprocess;

            aggregate.enableAsyncCompute = srcFrameSettings.enableAsyncCompute && SystemInfo.supportsAsyncCompute;

            aggregate.enableOpaqueObjects            = srcFrameSettings.enableOpaqueObjects;
            aggregate.enableTransparentObjects       = srcFrameSettings.enableTransparentObjects;
            aggregate.enableRealtimePlanarReflection = srcFrameSettings.enableRealtimePlanarReflection;

            //MSAA only supported in forward
            aggregate.enableMSAA = srcFrameSettings.enableMSAA && renderPipelineSettings.supportMSAA && aggregate.shaderLitMode == LitShaderMode.Forward;

            aggregate.ConfigureMSAADependentSettings();
            aggregate.ConfigureStereoDependentSettings(camera);

            // Disable various option for the preview except if we are a Camera Editor preview
            if (HDUtils.IsRegularPreviewCamera(camera))
            {
                aggregate.enableShadow                     = false;
                aggregate.enableContactShadows             = false;
                aggregate.enableShadowMask                 = false;
                aggregate.enableSSR                        = false;
                aggregate.enableSSAO                       = false;
                aggregate.enableAtmosphericScattering      = false;
                aggregate.enableVolumetrics                = false;
                aggregate.enableReprojectionForVolumetrics = false;
                aggregate.enableLightLayers                = false;
                aggregate.enableTransparentPrepass         = false;
                aggregate.enableMotionVectors              = false;
                aggregate.enableObjectMotionVectors        = false;
                aggregate.enableDecals                     = false;
                aggregate.enableTransparentPostpass        = false;
                aggregate.enableDistortion                 = false;
                aggregate.enablePostprocess                = false;
            }

            LightLoopSettings.InitializeLightLoopSettings(camera, aggregate, renderPipelineSettings, srcFrameSettings, ref aggregate.lightLoopSettings);
        }
Exemple #19
0
        public static void RegisterDebug(string menuName, FrameSettings frameSettings)
        {
            List <DebugUI.Widget> widgets = new List <DebugUI.Widget>();

            widgets.AddRange(
                new DebugUI.Widget[]
            {
                new DebugUI.Foldout
                {
                    displayName = "Rendering Passes",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Enable Transparent Prepass", getter = () => frameSettings.enableTransparentPrepass, setter = value => frameSettings.enableTransparentPrepass = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Transparent Postpass", getter = () => frameSettings.enableTransparentPostpass, setter = value => frameSettings.enableTransparentPostpass = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Motion Vectors", getter = () => frameSettings.enableMotionVectors, setter = value => frameSettings.enableMotionVectors = value
                        },
                        new DebugUI.BoolField {
                            displayName = "  Enable Object Motion Vectors", getter = () => frameSettings.enableObjectMotionVectors, setter = value => frameSettings.enableObjectMotionVectors = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable DBuffer", getter = () => frameSettings.enableDecals, setter = value => frameSettings.enableDecals = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Rough Refraction", getter = () => frameSettings.enableRoughRefraction, setter = value => frameSettings.enableRoughRefraction = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Distortion", getter = () => frameSettings.enableDistortion, setter = value => frameSettings.enableDistortion = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Postprocess", getter = () => frameSettings.enablePostprocess, setter = value => frameSettings.enablePostprocess = value
                        },
                    }
                },
                new DebugUI.Foldout
                {
                    displayName = "Rendering Settings",
                    children    =
                    {
                        new DebugUI.EnumField {
                            displayName = "Lit Shader Mode", getter = () => (int)frameSettings.shaderLitMode, setter = value => frameSettings.shaderLitMode = (LitShaderMode)value, autoEnum = typeof(LitShaderMode)
                        },
                        new DebugUI.BoolField {
                            displayName = "Deferred Depth Prepass", getter = () => frameSettings.enableDepthPrepassWithDeferredRendering, setter = value => frameSettings.enableDepthPrepassWithDeferredRendering = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Opaque Objects", getter = () => frameSettings.enableOpaqueObjects, setter = value => frameSettings.enableOpaqueObjects = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Transparent Objects", getter = () => frameSettings.enableTransparentObjects, setter = value => frameSettings.enableTransparentObjects = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Realtime Planar Reflection", getter = () => frameSettings.enableRealtimePlanarReflection, setter = value => frameSettings.enableRealtimePlanarReflection = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable MSAA", getter = () => frameSettings.enableMSAA, setter = value => frameSettings.enableMSAA = value
                        },
                    }
                },
                new DebugUI.Foldout
                {
                    displayName = "Lighting Settings",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Enable SSR", getter = () => frameSettings.enableSSR, setter = value => frameSettings.enableSSR = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable SSAO", getter = () => frameSettings.enableSSAO, setter = value => frameSettings.enableSSAO = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable SubsurfaceScattering", getter = () => frameSettings.enableSubsurfaceScattering, setter = value => frameSettings.enableSubsurfaceScattering = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Transmission", getter = () => frameSettings.enableTransmission, setter = value => frameSettings.enableTransmission = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Shadows", getter = () => frameSettings.enableShadow, setter = value => frameSettings.enableShadow = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Contact Shadows", getter = () => frameSettings.enableContactShadows, setter = value => frameSettings.enableContactShadows = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable ShadowMask", getter = () => frameSettings.enableShadowMask, setter = value => frameSettings.enableShadowMask = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Atmospheric Scattering", getter = () => frameSettings.enableAtmosphericScattering, setter = value => frameSettings.enableAtmosphericScattering = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Volumetrics", getter = () => frameSettings.enableVolumetrics, setter = value => frameSettings.enableVolumetrics = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Reprojection For Volumetrics", getter = () => frameSettings.enableReprojectionForVolumetrics, setter = value => frameSettings.enableReprojectionForVolumetrics = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable LightLayers", getter = () => frameSettings.enableLightLayers, setter = value => frameSettings.enableLightLayers = value
                        },
                    }
                },
                new DebugUI.Foldout
                {
                    displayName = "Async Compute Settings",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Enable Async Compute", getter = () => frameSettings.enableAsyncCompute, setter = value => frameSettings.enableAsyncCompute = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Run Build Light List Async", getter = () => frameSettings.runLightListAsync, setter = value => frameSettings.runLightListAsync = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Run SSR Async", getter = () => frameSettings.runSSRAsync, setter = value => frameSettings.runSSRAsync = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Run SSAO Async", getter = () => frameSettings.runSSAOAsync, setter = value => frameSettings.runSSAOAsync = value
                        },
                    }
                }
            });

            LightLoopSettings.RegisterDebug(frameSettings.lightLoopSettings, widgets);

            var panel = DebugManager.instance.GetPanel(menuName, true);

            panel.children.Add(widgets.ToArray());
        }
Exemple #20
0
        public static void RegisterDebug(string menuName, FrameSettings frameSettings)
        {
            List <DebugUI.Widget> widgets = new List <DebugUI.Widget>();

            widgets.AddRange(
                new DebugUI.Widget[]
            {
                new DebugUI.Container
                {
                    displayName = "Rendering Passes",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Enable Transparent Prepass", getter = () => frameSettings.enableTransparentPrepass, setter = value => frameSettings.enableTransparentPrepass = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Transparent Postpass", getter = () => frameSettings.enableTransparentPostpass, setter = value => frameSettings.enableTransparentPostpass = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Motion Vectors", getter = () => frameSettings.enableMotionVectors, setter = value => frameSettings.enableMotionVectors = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Object Motion Vectors", getter = () => frameSettings.enableObjectMotionVectors, setter = value => frameSettings.enableObjectMotionVectors = value
                        },
//forest-begin: G-Buffer motion vectors
                        new DebugUI.BoolField {
                            displayName = "Enable G-Buffer Motion Vectors", getter = () => frameSettings.enableGBufferMotionVectors, setter = value => frameSettings.enableGBufferMotionVectors = value
                        },
//forest-end:
                        new DebugUI.BoolField {
                            displayName = "Enable DBuffer", getter = () => frameSettings.enableDBuffer, setter = value => frameSettings.enableDBuffer = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Rough Refraction", getter = () => frameSettings.enableRoughRefraction, setter = value => frameSettings.enableRoughRefraction = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Distortion", getter = () => frameSettings.enableDistortion, setter = value => frameSettings.enableDistortion = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Postprocess", getter = () => frameSettings.enablePostprocess, setter = value => frameSettings.enablePostprocess = value
                        },
                    }
                },
                new DebugUI.Container
                {
                    displayName = "Rendering Settings",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Forward Only", getter = () => frameSettings.enableForwardRenderingOnly, setter = value => frameSettings.enableForwardRenderingOnly = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Deferred Depth Prepass", getter = () => frameSettings.enableDepthPrepassWithDeferredRendering, setter = value => frameSettings.enableDepthPrepassWithDeferredRendering = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Async Compute", getter = () => frameSettings.enableAsyncCompute, setter = value => frameSettings.enableAsyncCompute = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Opaque Objects", getter = () => frameSettings.enableOpaqueObjects, setter = value => frameSettings.enableOpaqueObjects = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Transparent Objects", getter = () => frameSettings.enableTransparentObjects, setter = value => frameSettings.enableTransparentObjects = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable MSAA", getter = () => frameSettings.enableMSAA, setter = value => frameSettings.enableMSAA = value
                        },
                    }
                },
                new DebugUI.Container
                {
                    displayName = "XR Settings",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Enable Stereo Rendering", getter = () => frameSettings.enableStereo, setter = value => frameSettings.enableStereo = value
                        }
                    }
                },
                new DebugUI.Container
                {
                    displayName = "Lighting Settings",
                    children    =
                    {
                        new DebugUI.BoolField {
                            displayName = "Enable SSR", getter = () => frameSettings.enableSSR, setter = value => frameSettings.enableSSR = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable SSAO", getter = () => frameSettings.enableSSAO, setter = value => frameSettings.enableSSAO = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable SubsurfaceScattering", getter = () => frameSettings.enableSubsurfaceScattering, setter = value => frameSettings.enableSubsurfaceScattering = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Transmission", getter = () => frameSettings.enableTransmission, setter = value => frameSettings.enableTransmission = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Shadows", getter = () => frameSettings.enableShadow, setter = value => frameSettings.enableShadow = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Contact Shadows", getter = () => frameSettings.enableContactShadows, setter = value => frameSettings.enableContactShadows = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable ShadowMask", getter = () => frameSettings.enableShadowMask, setter = value => frameSettings.enableShadowMask = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Atmospheric Scattering", getter = () => frameSettings.enableAtmosphericScattering, setter = value => frameSettings.enableAtmosphericScattering = value
                        },
                        new DebugUI.BoolField {
                            displayName = "Enable Volumetrics", getter = () => frameSettings.enableVolumetrics, setter = value => frameSettings.enableVolumetrics = value
                        },
//forest-begin: Explicit reflection probe tracking
                        new DebugUI.BoolField {
                            displayName = "Disable ReflectionProbe Culling", getter = () => frameSettings.disableReflectionProbeCulling, setter = value => frameSettings.disableReflectionProbeCulling = value
                        },
//forest-end:
                    }
                }
//forest-begin: customizable sorting flags
                ,
                new DebugUI.Container
                {
                    displayName = "Sorting Flags",
                    children    =
                    {
                        new DebugUI.EnumField {
                            displayName = "Depth Prepass", getter = () => (int)frameSettings.sortFlagsDepthPrepass, setter = value => frameSettings.sortFlagsDepthPrepass = (SortFlags)value
                        },
                        new DebugUI.EnumField {
                            displayName = "G-Buffer", getter = () => (int)frameSettings.sortFlagsGBuffer, setter = value => frameSettings.sortFlagsGBuffer = (SortFlags)value
                        },
                        new DebugUI.EnumField {
                            displayName = "Forward", getter = () => (int)frameSettings.sortFlagsForward, setter = value => frameSettings.sortFlagsForward = (SortFlags)value
                        },
                        new DebugUI.EnumField {
                            displayName = "Object Motion Vectors", getter = () => (int)frameSettings.sortFlagsObjectMotionVectors, setter = value => frameSettings.sortFlagsObjectMotionVectors = (SortFlags)value
                        },
                    }
                }
//forest-end:
            });

            LightLoopSettings.RegisterDebug(frameSettings.lightLoopSettings, widgets);

            var panel = DebugManager.instance.GetPanel(menuName, true);

            panel.children.Add(widgets.ToArray());
        }