From 58a95773263a4793601cccf69a0c82144a77058b Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Thu, 10 Sep 2020 10:05:20 +0200 Subject: [PATCH 1/3] Added Simple Earth Mode to PBR Sky --- .../PhysicallyBasedSkyEditor.cs | 91 +++++++++++++------ .../PhysicallyBasedSky.Migration.cs | 45 +++++++++ .../PhysicallyBasedSky.Migration.cs.meta | 11 +++ .../PhysicallyBasedSky/PhysicallyBasedSky.cs | 84 ++++++++++++++--- .../PhysicallyBasedSkyRenderer.cs | 15 +-- 5 files changed, 202 insertions(+), 44 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.Migration.cs create mode 100644 com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.Migration.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs index b2f4882127f..a2490a76a33 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs @@ -1,4 +1,5 @@ using UnityEditor.Rendering; +using UnityEngine; using UnityEngine.Rendering.HighDefinition; namespace UnityEditor.Rendering.HighDefinition @@ -7,7 +8,7 @@ namespace UnityEditor.Rendering.HighDefinition [VolumeComponentEditor(typeof(PhysicallyBasedSky))] class PhysicallyBasedSkyEditor : SkySettingsEditor { - SerializedDataParameter m_EarthPreset; + SerializedDataParameter m_Type; SerializedDataParameter m_SphericalMode; SerializedDataParameter m_SeaLevel; SerializedDataParameter m_PlanetaryRadius; @@ -42,6 +43,11 @@ class PhysicallyBasedSkyEditor : SkySettingsEditor SerializedDataParameter m_NumberOfBounces; + GUIContent m_ModelTypeLabel = new GUIContent("Type", "Specifies a preset to simplify the interface."); + + GUIContent[] m_ModelTypes = { new GUIContent("Earth (Simple)"), new GUIContent("Earth (Advanced)"), new GUIContent("Custom Planet") }; + int[] m_ModelTypeValues = { (int)PhysicallyBasedSkyModel.EarthSimple, (int)PhysicallyBasedSkyModel.EarthAdvanced, (int)PhysicallyBasedSkyModel.Custom }; + public override void OnEnable() { base.OnEnable(); @@ -52,7 +58,7 @@ public override void OnEnable() var o = new PropertyFetcher(serializedObject); - m_EarthPreset = Unpack(o.Find(x => x.earthPreset)); + m_Type = Unpack(o.Find(x => x.type)); m_SphericalMode = Unpack(o.Find(x => x.sphericalMode)); m_SeaLevel = Unpack(o.Find(x => x.seaLevel)); m_PlanetaryRadius = Unpack(o.Find(x => x.planetaryRadius)); @@ -90,37 +96,63 @@ public override void OnEnable() public override void OnInspectorGUI() { + EditorGUILayout.LabelField("Model"); + + using (new EditorGUILayout.HorizontalScope()) + { + DrawOverrideCheckbox(m_Type); + + using (new EditorGUI.DisabledScope(!m_Type.overrideState.boolValue)) + { + m_Type.value.intValue = EditorGUILayout.IntPopup(m_ModelTypeLabel, m_Type.value.intValue, m_ModelTypes, m_ModelTypeValues); + } + } + + PhysicallyBasedSkyModel type = (PhysicallyBasedSkyModel)m_Type.value.intValue; + + EditorGUILayout.Space(); EditorGUILayout.LabelField("Planet"); - PropertyField(m_EarthPreset); - bool isEarth = !m_EarthPreset.overrideState.boolValue || m_EarthPreset.value.boolValue; - if (!isEarth) + + if (type == PhysicallyBasedSkyModel.EarthSimple) + PropertyField(m_SeaLevel); + else { - PropertyField(m_PlanetaryRadius); + PropertyField(m_SphericalMode); + EditorGUI.indentLevel++; + bool isSpherical = !m_SphericalMode.overrideState.boolValue || m_SphericalMode.value.boolValue; + if (isSpherical) + { + PropertyField(m_PlanetCenterPosition); + if (type == PhysicallyBasedSkyModel.Custom) + PropertyField(m_PlanetaryRadius); + } + else + PropertyField(m_SeaLevel); + EditorGUI.indentLevel--; + + PropertyField(m_PlanetRotation); + PropertyField(m_GroundColorTexture); } - PropertyField(m_SphericalMode); - bool isSpherical = !m_SphericalMode.overrideState.boolValue || m_SphericalMode.value.boolValue; - if (isSpherical) + PropertyField(m_GroundTint); + if (type != PhysicallyBasedSkyModel.EarthSimple) { - PropertyField(m_PlanetCenterPosition); + PropertyField(m_GroundEmissionTexture); + PropertyField(m_GroundEmissionMultiplier); } - else + + if (type != PhysicallyBasedSkyModel.EarthSimple) { - PropertyField(m_SeaLevel); + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Space"); + PropertyField(m_SpaceRotation); + PropertyField(m_SpaceEmissionTexture); + PropertyField(m_SpaceEmissionMultiplier); } - PropertyField(m_PlanetRotation); - PropertyField(m_GroundColorTexture); - PropertyField(m_GroundTint); - PropertyField(m_GroundEmissionTexture); - PropertyField(m_GroundEmissionMultiplier); - - EditorGUILayout.LabelField("Space"); - PropertyField(m_SpaceRotation); - PropertyField(m_SpaceEmissionTexture); - PropertyField(m_SpaceEmissionMultiplier); - if (!isEarth) + if (type == PhysicallyBasedSkyModel.Custom) { + EditorGUILayout.Space(); EditorGUILayout.LabelField("Air"); PropertyField(m_AirMaximumAltitude); PropertyField(m_AirDensityR); @@ -128,12 +160,18 @@ public override void OnInspectorGUI() PropertyField(m_AirDensityB); PropertyField(m_AirTint); } + + EditorGUILayout.Space(); EditorGUILayout.LabelField("Aerosols"); - PropertyField(m_AerosolMaximumAltitude); PropertyField(m_AerosolDensity); - PropertyField(m_AerosolTint); - PropertyField(m_AerosolAnisotropy); + PropertyField(m_AerosolTint); + if (type != PhysicallyBasedSkyModel.EarthSimple) + { + PropertyField(m_AerosolAnisotropy); + PropertyField(m_AerosolMaximumAltitude); + } + EditorGUILayout.Space(); EditorGUILayout.LabelField("Artistic Overrides"); PropertyField(m_ColorSaturation); PropertyField(m_AlphaSaturation); @@ -142,6 +180,7 @@ public override void OnInspectorGUI() PropertyField(m_HorizonZenithShift); PropertyField(m_ZenithTint); + EditorGUILayout.Space(); EditorGUILayout.LabelField("Miscellaneous"); PropertyField(m_NumberOfBounces); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.Migration.cs new file mode 100644 index 00000000000..98f7a6d8051 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.Migration.cs @@ -0,0 +1,45 @@ +using System; +using UnityEngine.Serialization; + +namespace UnityEngine.Rendering.HighDefinition +{ + public partial class PhysicallyBasedSky : IVersionable + { + /// + /// The version used during the migration + /// + protected enum Version + { + /// Version Step + Initial, + /// Version Step + TypeEnum, + } + + /// + /// The migration steps for PhysicallyBasedSky + /// + protected static readonly MigrationDescription k_Migration = MigrationDescription.New( + MigrationStep.New(Version.TypeEnum, (PhysicallyBasedSky p) => + { +#pragma warning disable 618 // Type or member is obsolete + p.type.value = p.m_ObsoleteEarthPreset.value ? PhysicallyBasedSkyModel.EarthAdvanced : PhysicallyBasedSkyModel.Custom; + p.type.overrideState = p.m_ObsoleteEarthPreset.overrideState; +#pragma warning restore 618 + }) + ); + + void Awake() + { + k_Migration.Migrate(this); + } + + [SerializeField] + Version m_SkyVersion; + Version IVersionable.version { get => m_SkyVersion; set => m_SkyVersion = value; } + + /// Obsolete field. Simplifies the interface by using parameters suitable to simulate Earth. + [SerializeField, FormerlySerializedAs("earthPreset"), Obsolete("For Data Migration")] + BoolParameter m_ObsoleteEarthPreset = new BoolParameter(true); + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.Migration.cs.meta b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.Migration.cs.meta new file mode 100644 index 00000000000..ef4420f1ccb --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.Migration.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 45bc62b4afbb25045aedc5ade0f680ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs index 03bb3b49385..9ab77a5063a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs @@ -1,13 +1,42 @@ using System; +using System.Diagnostics; namespace UnityEngine.Rendering.HighDefinition { + /// + /// The model used to control the complexity of the simulation. + /// + public enum PhysicallyBasedSkyModel + { + /// Suitable to simulate Earth + EarthSimple, + /// Suitable to simulate Earth + EarthAdvanced, + /// Suitable to simulate any planet + Custom + }; + + /// + /// Physically Based Sky model volume parameter. + /// + [Serializable, DebuggerDisplay(k_DebuggerDisplay)] + public sealed class PhysicallyBasedSkyModelParameter : VolumeParameter + { + /// + /// constructor. + /// + /// Model parameter. + /// Initial override state. + public PhysicallyBasedSkyModelParameter(PhysicallyBasedSkyModel value, bool overrideState = false) + : base(value, overrideState) {} + } + /// /// Physically Based Sky Volume Component. /// [VolumeComponentMenu("Sky/Physically Based Sky")] [SkyUniqueID((int)SkyType.PhysicallyBased)] - public class PhysicallyBasedSky : SkySettings + public partial class PhysicallyBasedSky : SkySettings { /* We use the measurements from Earth as the defaults. */ const float k_DefaultEarthRadius = 6.3781f * 1000000; @@ -18,10 +47,13 @@ public class PhysicallyBasedSky : SkySettings const float k_DefaultAirAlbedoR = 0.9f; // BS values to account for absorption const float k_DefaultAirAlbedoG = 0.9f; // due to the ozone layer. We assume that ozone const float k_DefaultAirAlbedoB = 1.0f; // has the same height distribution as air (most certainly WRONG). + const float k_DefaultAerosolScaleHeight = 1200; + static readonly float k_DefaultAerosolMaximumAltitude = LayerDepthFromScaleHeight(k_DefaultAerosolScaleHeight); + /// Simplifies the interface by using parameters suitable to simulate Earth. [Tooltip("When enabled, Unity simplifies the interface and only exposes properties suitable to simulate Earth.")] - public BoolParameter earthPreset = new BoolParameter(true); + public PhysicallyBasedSkyModelParameter type = new PhysicallyBasedSkyModelParameter(PhysicallyBasedSkyModel.EarthAdvanced); /// Allows to specify the location of the planet. If disabled, the planet is always below the camera in the world-space X-Z plane. [Tooltip("When enabled, you can define the planet in terms of a world-space position and radius. Otherwise, the planet is always below the Camera in the world-space x-z plane.")] @@ -64,7 +96,7 @@ public class PhysicallyBasedSky : SkySettings /// Opacity of aerosols as measured by an observer on the ground looking towards the zenith. [Tooltip("Controls the opacity of aerosols at the point in the sky directly above the observer (zenith).")] // Note: aerosols are (fairly large) solid or liquid particles suspended in the air. - public ClampedFloatParameter aerosolDensity = new ClampedFloatParameter(ZenithOpacityFromExtinctionAndScaleHeight(10.0f / 1000000, 1200), 0, 1); + public ClampedFloatParameter aerosolDensity = new ClampedFloatParameter(ZenithOpacityFromExtinctionAndScaleHeight(10.0f / 1000000, k_DefaultAerosolScaleHeight), 0, 1); /// Single scattering albedo of aerosol molecules (per color channel). The value of 0 results in absorbing molecules, and the value of 1 results in scattering ones. [Tooltip("Specifies the color that HDRP tints aerosols to. This controls the single scattering albedo of aerosol molecules (per color channel). A value of 0 results in absorbing molecules, and a value of 1 results in scattering ones.")] @@ -74,7 +106,7 @@ public class PhysicallyBasedSky : SkySettings [Tooltip("Sets the depth, in meters, of the atmospheric layer, from sea level, composed of aerosol particles. Controls the rate of height-based density falloff.")] // We assume the exponential falloff of density w.r.t. the height. // We can interpret the depth as the height at which the density drops to 0.1% of the initial (sea level) value. - public MinFloatParameter aerosolMaximumAltitude = new MinFloatParameter(LayerDepthFromScaleHeight(1200), 0); + public MinFloatParameter aerosolMaximumAltitude = new MinFloatParameter(k_DefaultAerosolMaximumAltitude, 0); /// Positive values for forward scattering, 0 for isotropic scattering. negative values for backward scattering. [Tooltip("Controls the direction of anisotropy. Set this to a positive value for forward scattering, a negative value for backward scattering, or 0 for isotropic scattering.")] @@ -170,7 +202,7 @@ static internal float ZenithOpacityFromExtinctionAndScaleHeight(float ext, float internal float GetAirScaleHeight() { - if (earthPreset.value) + if (type.value != PhysicallyBasedSkyModel.Custom) { return k_DefaultAirScaleHeight; } @@ -180,9 +212,18 @@ internal float GetAirScaleHeight() } } + internal float GetMaximumAltitude() + { + if (type.value == PhysicallyBasedSkyModel.Custom) + return Mathf.Max(airMaximumAltitude.value, aerosolMaximumAltitude.value); + + float aerosolMaxAltitude = (type.value == PhysicallyBasedSkyModel.EarthSimple) ? k_DefaultAerosolMaximumAltitude : aerosolMaximumAltitude.value; + return Mathf.Max(LayerDepthFromScaleHeight(k_DefaultAirScaleHeight), aerosolMaxAltitude); + } + internal float GetPlanetaryRadius() { - if (earthPreset.value) + if (type.value != PhysicallyBasedSkyModel.Custom) { return k_DefaultEarthRadius; } @@ -194,7 +235,7 @@ internal float GetPlanetaryRadius() internal Vector3 GetPlanetCenterPosition(Vector3 camPosWS) { - if (sphericalMode.value) + if (sphericalMode.value && (type.value != PhysicallyBasedSkyModel.EarthSimple)) { return planetCenterPosition.value; } @@ -211,7 +252,7 @@ internal Vector3 GetAirExtinctionCoefficient() { Vector3 airExt = new Vector3(); - if (earthPreset.value) + if (type.value != PhysicallyBasedSkyModel.Custom) { airExt.x = k_DefaultAirScatteringR; airExt.y = k_DefaultAirScatteringG; @@ -231,7 +272,7 @@ internal Vector3 GetAirAlbedo() { Vector3 airAlb = new Vector3(); - if (earthPreset.value) + if (type.value != PhysicallyBasedSkyModel.Custom) { airAlb.x = k_DefaultAirAlbedoR; airAlb.y = k_DefaultAirAlbedoG; @@ -260,7 +301,26 @@ internal Vector3 GetAirScatteringCoefficient() internal float GetAerosolScaleHeight() { - return ScaleHeightFromLayerDepth(aerosolMaximumAltitude.value); + if (type.value == PhysicallyBasedSkyModel.EarthSimple) + { + return k_DefaultAerosolScaleHeight; + } + else + { + return ScaleHeightFromLayerDepth(aerosolMaximumAltitude.value); + } + } + + internal float GetAerosolAnisotropy() + { + if (type.value == PhysicallyBasedSkyModel.EarthSimple) + { + return 0; + } + else + { + return aerosolAnisotropy.value; + } } internal float GetAerosolExtinctionCoefficient() @@ -290,7 +350,7 @@ internal int GetPrecomputationHashCode() { #if UNITY_2019_3 // In 2019.3, when we call GetHashCode on a VolumeParameter it generate garbage (due to the boxing of the generic parameter) // These parameters affect precomputation. - hash = hash * 23 + earthPreset.overrideState.GetHashCode(); + hash = hash * 23 + type.overrideState.GetHashCode(); hash = hash * 23 + planetaryRadius.overrideState.GetHashCode(); hash = hash * 23 + groundTint.overrideState.GetHashCode(); @@ -308,7 +368,7 @@ internal int GetPrecomputationHashCode() hash = hash * 23 + numberOfBounces.overrideState.GetHashCode(); #else // These parameters affect precomputation. - hash = hash * 23 + earthPreset.GetHashCode(); + hash = hash * 23 + type.GetHashCode(); hash = hash * 23 + planetaryRadius.GetHashCode(); hash = hash * 23 + groundTint.GetHashCode(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs index 01c708534ba..2354ee73925 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs @@ -368,9 +368,10 @@ void UpdateGlobalConstantBuffer(CommandBuffer cmd, BuiltinSkyParameters builtinP var pbrSky = builtinParams.skySettings as PhysicallyBasedSky; float R = pbrSky.GetPlanetaryRadius(); - float D = Mathf.Max(pbrSky.airMaximumAltitude.value, pbrSky.aerosolMaximumAltitude.value); + float D = pbrSky.GetMaximumAltitude(); float airH = pbrSky.GetAirScaleHeight(); float aerH = pbrSky.GetAerosolScaleHeight(); + float aerA = pbrSky.GetAerosolAnisotropy(); float iMul = GetSkyIntensity(pbrSky, builtinParams.debugSettings); Vector2 expParams = ComputeExponentialInterpolationParams(pbrSky.horizonZenithShift.value); @@ -381,8 +382,8 @@ void UpdateGlobalConstantBuffer(CommandBuffer cmd, BuiltinSkyParameters builtinP m_ConstantBuffer._RcpAtmosphericDepth = 1.0f / D; m_ConstantBuffer._AtmosphericRadius = R + D; - m_ConstantBuffer._AerosolAnisotropy = pbrSky.aerosolAnisotropy.value; - m_ConstantBuffer._AerosolPhasePartConstant = CornetteShanksPhasePartConstant(pbrSky.aerosolAnisotropy.value); + m_ConstantBuffer._AerosolAnisotropy = aerA; + m_ConstantBuffer._AerosolPhasePartConstant = CornetteShanksPhasePartConstant(aerA); m_ConstantBuffer._Unused = 0.0f; // Warning fix m_ConstantBuffer._Unused2 = 0.0f; // Warning fix @@ -451,6 +452,8 @@ public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderFo float r = cameraToPlanetCenter.magnitude; cameraPos = planetCenter - Mathf.Max(R, r) * cameraToPlanetCenter.normalized; + bool simpleEarthMode = pbrSky.type.value == PhysicallyBasedSkyModel.EarthSimple; + CommandBuffer cmd = builtinParams.commandBuffer; // Precomputation is done, shading is next. @@ -472,7 +475,7 @@ public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderFo int hasGroundAlbedoTexture = 0; - if (pbrSky.groundColorTexture.value != null) + if (pbrSky.groundColorTexture.value != null && !simpleEarthMode) { hasGroundAlbedoTexture = 1; s_PbrSkyMaterialProperties.SetTexture(HDShaderIDs._GroundAlbedoTexture, pbrSky.groundColorTexture.value); @@ -481,7 +484,7 @@ public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderFo int hasGroundEmissionTexture = 0; - if (pbrSky.groundEmissionTexture.value != null) + if (pbrSky.groundEmissionTexture.value != null && !simpleEarthMode) { hasGroundEmissionTexture = 1; s_PbrSkyMaterialProperties.SetTexture(HDShaderIDs._GroundEmissionTexture, pbrSky.groundEmissionTexture.value); @@ -491,7 +494,7 @@ public override void RenderSky(BuiltinSkyParameters builtinParams, bool renderFo int hasSpaceEmissionTexture = 0; - if (pbrSky.spaceEmissionTexture.value != null) + if (pbrSky.spaceEmissionTexture.value != null && !simpleEarthMode) { hasSpaceEmissionTexture = 1; s_PbrSkyMaterialProperties.SetTexture(HDShaderIDs._SpaceEmissionTexture, pbrSky.spaceEmissionTexture.value); From ce6049cddefcab7671418b02b86b780f21df3a88 Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Mon, 14 Sep 2020 15:04:50 +0200 Subject: [PATCH 2/3] Update doc --- .../CHANGELOG.md | 1 + .../Documentation~/Override-Physically-Based-Sky.md | 11 +++++++++-- .../Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs | 4 +--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index a723a62412a..ff55ef7e144 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added remapping options for Depth Pyramid debug view mode - Added an option to support AOV shader at runtime in HDRP settings (case 1265070) - Added support of SSGI in the render graph mode. +- Added Simple mode to Earth Preset for PBR Sky ### Fixed - Fixed several issues with physically-based DoF (TAA ghosting of the CoC buffer, smooth layer transitions, etc) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md index 6445ef13651..581c11b74b5 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md @@ -33,11 +33,16 @@ To change how much the atmosphere attenuates light, you can change the density o [!include[](snippets/Volume-Override-Enable-Properties.md)] +### Model + +| **Property** | **Description** | +| ------------------------------ | ------------------------------------------------------- | +| **Type** | Indicates a preset HDRP uses to simplify the Inspector. Selecting Earth will only show properties suitable to simulate Earth. | + ### Planet | **Property** | **Description** | | ------------------------------ | ------------------------------------------------------------ | -| **Earth Preset** | Indicates whether HDRP should simplify the Inspector and only show properties suitable to simulate Earth. | | **Spherical Mode** | Enables **Spherical Mode**. When in Spherical Mode, you can specify the location of the planet. Otherwise, the planet is always below the Camera in the world-space x-z plane. | | **Planetary Radius** | The radius of the planet in meters. The radius is the distance from the center of the planet to the sea level. Only available in **Spherical Mode**. | | **Planet Center Position** | The world-space position of the planet's center in meters. This does not affect the precomputation. Only available in **Spherical Mode**. | @@ -50,6 +55,8 @@ To change how much the atmosphere attenuates light, you can change the density o ### Space +To make this section visible, set **Type** to **Earth (Advanced)** or **Custom Planet**. + | **Property** | **Description** | | ----------------------------- | ------------------------------------------------------------ | | **Space Rotation** | The orientation of space. | @@ -58,7 +65,7 @@ To change how much the atmosphere attenuates light, you can change the density o ### Air -To make this section visible, disable **Earth Preset**. +To make this section visible, set **Type** to **Custom Planet**. | **Property** | **Description** | | ------------------------ | ------------------------------------------------------------ | diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs index 9ab77a5063a..c711d07870a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSky.cs @@ -50,9 +50,7 @@ public partial class PhysicallyBasedSky : SkySettings const float k_DefaultAerosolScaleHeight = 1200; static readonly float k_DefaultAerosolMaximumAltitude = LayerDepthFromScaleHeight(k_DefaultAerosolScaleHeight); - - /// Simplifies the interface by using parameters suitable to simulate Earth. - [Tooltip("When enabled, Unity simplifies the interface and only exposes properties suitable to simulate Earth.")] + /// Simplifies the interface by reducing the number of parameters available. public PhysicallyBasedSkyModelParameter type = new PhysicallyBasedSkyModelParameter(PhysicallyBasedSkyModel.EarthAdvanced); /// Allows to specify the location of the planet. If disabled, the planet is always below the camera in the world-space X-Z plane. From 898db33bcd0825cfdae5891d8e7dea088395c19b Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Fri, 18 Sep 2020 09:50:22 +0200 Subject: [PATCH 3/3] update doc --- .../Documentation~/Override-Physically-Based-Sky.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md index 581c11b74b5..0a9cb0955eb 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-Physically-Based-Sky.md @@ -37,7 +37,7 @@ To change how much the atmosphere attenuates light, you can change the density o | **Property** | **Description** | | ------------------------------ | ------------------------------------------------------- | -| **Type** | Indicates a preset HDRP uses to simplify the Inspector. Selecting Earth will only show properties suitable to simulate Earth. | +| **Type** | Indicates a preset HDRP uses to simplify the Inspector. If you select **Earth (Simple)** or **Earth (Advanced)**, the Inspector only shows properties suitable to simulate Earth. | ### Planet