From 2fc4c697f87dce46d197133519e94eda75eebb76 Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Fri, 24 Apr 2020 14:56:14 +0200 Subject: [PATCH 1/2] Made the static lighting sky public so that users can change it by script for baking purpose. --- .../RenderPipeline/Settings/FrameSettings.cs | 1 + .../Runtime/Sky/StaticLightingSky.cs | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs index d8a304d40f6..fd48e4900f2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs @@ -339,6 +339,7 @@ public enum FrameSettingsField /// When enabled, HDRP uses material variant classification to compute lighting. [FrameSettingsField(3, autoName: ComputeMaterialVariants, positiveDependencies: new[] { DeferredTile })] ComputeMaterialVariants = 125, + /// When enabled, HDRP uses probe volumes for baked lighting. [FrameSettingsField(1, autoName: ProbeVolume)] ProbeVolume = 127, diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs index d3aa6bb1293..d2cb6061cc2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/StaticLightingSky.cs @@ -4,10 +4,13 @@ namespace UnityEngine.Rendering.HighDefinition { + /// + /// Class controlling which sky is used for static and baked lighting. + /// [HelpURL(Documentation.baseURL + Documentation.version + Documentation.subURL + "Static-Lighting-Sky" + Documentation.endURL)] [ExecuteAlways] [AddComponentMenu("")] // Hide this object from the Add Component menu - class StaticLightingSky : MonoBehaviour + public class StaticLightingSky : MonoBehaviour { [SerializeField] VolumeProfile m_Profile; @@ -16,12 +19,10 @@ class StaticLightingSky : MonoBehaviour int m_LastComputedHash; bool m_NeedUpdateStaticLightingSky; - [NonSerialized] - public SkySettings m_SkySettings; // This one contain only property values from overridden properties in the original profile component - [NonSerialized] - public SkySettings m_SkySettingsFromProfile; + SkySettings m_SkySettings; // This one contain only property values from overridden properties in the original profile component + SkySettings m_SkySettingsFromProfile; - public SkySettings skySettings + internal SkySettings skySettings { get { @@ -42,7 +43,9 @@ public SkySettings skySettings List m_VolumeSkyList = new List(); - + /// + /// Volume profile where the sky settings used for static lighting will be fetched. + /// public VolumeProfile profile { get @@ -69,6 +72,10 @@ public VolumeProfile profile } } + /// + /// Unique ID of the sky used for static lighting. + /// The unique ID should be for a sky that is present in the profile. See SkySettings.GetUniqueID to get the ID per sky type. + /// public int staticLightingSkyUniqueID { get From a298a0ca2abab1e593df7c6122ee51fbe38fd869 Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Fri, 24 Apr 2020 14:57:01 +0200 Subject: [PATCH 2/2] Update changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 893e4da11a5..9a44d272973 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -686,6 +686,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Merged material samples and shader samples - Update material samples scene visuals - Use multi_compile API for deferred compute shader with shadow mask. +- Made the StaticLightingSky class public so that users can change it by script for baking purpose. ## [7.1.1] - 2019-09-05