From a444b2209381b2638834871cf9b275735c302678 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Mon, 15 Jun 2020 19:09:42 +0200 Subject: [PATCH 1/4] Split GenerateHLSL code from PhysicallyBasedSkyRenderer in a separate file to fix Generator Includes tool --- .../PhysicallyBasedSkyCommon.hlsl | 2 +- .../PhysicallyBasedSkyRenderer.cs | 54 ------------------ .../ShaderVariablesPhysicallyBasedSky.cs | 56 +++++++++++++++++++ ...ShaderVariablesPhysicallyBasedSky.cs.hlsl} | 0 ...rVariablesPhysicallyBasedSky.cs.hlsl.meta} | 3 +- .../ShaderVariablesPhysicallyBasedSky.cs.meta | 11 ++++ 6 files changed, 70 insertions(+), 56 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs rename com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/{PhysicallyBasedSkyRenderer.cs.hlsl => ShaderVariablesPhysicallyBasedSky.cs.hlsl} (100%) rename com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/{PhysicallyBasedSkyRenderer.cs.hlsl.meta => ShaderVariablesPhysicallyBasedSky.cs.hlsl.meta} (71%) create mode 100644 com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyCommon.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyCommon.hlsl index bdc2e64d12f..ab74d59a506 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyCommon.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyCommon.hlsl @@ -6,7 +6,7 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/VolumeRendering.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Sampling.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesGlobal.hlsl" -#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl" TEXTURE2D(_GroundIrradianceTexture); 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 cb55197192f..5f79f09fac6 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 @@ -286,60 +286,6 @@ public bool Update(BuiltinSkyParameters builtinParams, PhysicallyBasedSky pbrSky } } - [GenerateHLSL] - public enum PbrSkyConfig - { - // Tiny - GroundIrradianceTableSize = 256, // - - // 32 MiB - InScatteredRadianceTableSizeX = 128, // - InScatteredRadianceTableSizeY = 32, // height - InScatteredRadianceTableSizeZ = 16, // AzimuthAngle(L) w.r.t. the view vector - InScatteredRadianceTableSizeW = 64, // , - } - - [GenerateHLSL(needAccessors = false, generateCBuffer = true, constantRegister = (int)ConstantRegister.PBRSky)] - unsafe struct ShaderVariablesPhysicallyBasedSky - { - // All the distance-related entries use SI units (meter, 1/meter, etc). - public float _PlanetaryRadius; - public float _RcpPlanetaryRadius; - public float _AtmosphericDepth; - public float _RcpAtmosphericDepth; - - public float _AtmosphericRadius; - public float _AerosolAnisotropy; - public float _AerosolPhasePartConstant; - public float _Unused; - - public float _AirDensityFalloff; - public float _AirScaleHeight; - public float _AerosolDensityFalloff; - public float _AerosolScaleHeight; - - public Vector3 _AirSeaLevelExtinction; - public float _AerosolSeaLevelExtinction; - - public Vector3 _AirSeaLevelScattering; - public float _IntensityMultiplier; - - public Vector3 _AerosolSeaLevelScattering; - public float _ColorSaturation; - - public Vector3 _GroundAlbedo; - public float _AlphaSaturation; - - public Vector3 _PlanetCenterPosition; // Not used during the precomputation, but needed to apply the atmospheric effect - public float _AlphaMultiplier; - - public Vector3 _HorizonTint; - public float _HorizonZenithShiftPower; - - public Vector3 _ZenithTint; - public float _HorizonZenithShiftScale; - } - // Store the hash of the parameters each time precomputation is done. // If the hash does not match, we must recompute our data. int m_LastPrecomputationParamHash; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs new file mode 100644 index 00000000000..a9f62b941b8 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs @@ -0,0 +1,56 @@ +namespace UnityEngine.Rendering.HighDefinition +{ + [GenerateHLSL] + public enum PbrSkyConfig + { + // Tiny + GroundIrradianceTableSize = 256, // + + // 32 MiB + InScatteredRadianceTableSizeX = 128, // + InScatteredRadianceTableSizeY = 32, // height + InScatteredRadianceTableSizeZ = 16, // AzimuthAngle(L) w.r.t. the view vector + InScatteredRadianceTableSizeW = 64, // , + } + + [GenerateHLSL(needAccessors = false, generateCBuffer = true, constantRegister = (int)ConstantRegister.PBRSky)] + unsafe struct ShaderVariablesPhysicallyBasedSky + { + // All the distance-related entries use SI units (meter, 1/meter, etc). + public float _PlanetaryRadius; + public float _RcpPlanetaryRadius; + public float _AtmosphericDepth; + public float _RcpAtmosphericDepth; + + public float _AtmosphericRadius; + public float _AerosolAnisotropy; + public float _AerosolPhasePartConstant; + public float _Unused; + + public float _AirDensityFalloff; + public float _AirScaleHeight; + public float _AerosolDensityFalloff; + public float _AerosolScaleHeight; + + public Vector3 _AirSeaLevelExtinction; + public float _AerosolSeaLevelExtinction; + + public Vector3 _AirSeaLevelScattering; + public float _IntensityMultiplier; + + public Vector3 _AerosolSeaLevelScattering; + public float _ColorSaturation; + + public Vector3 _GroundAlbedo; + public float _AlphaSaturation; + + public Vector3 _PlanetCenterPosition; // Not used during the precomputation, but needed to apply the atmospheric effect + public float _AlphaMultiplier; + + public Vector3 _HorizonTint; + public float _HorizonZenithShiftPower; + + public Vector3 _ZenithTint; + public float _HorizonZenithShiftScale; + } +} diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl similarity index 100% rename from com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs.hlsl rename to com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs.hlsl.meta b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl.meta similarity index 71% rename from com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs.hlsl.meta rename to com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl.meta index fee555962d4..b278d6eb91a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyRenderer.cs.hlsl.meta +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl.meta @@ -1,9 +1,10 @@ fileFormatVersion: 2 -guid: 624d0563b7421a0449bb42de55f13373 +guid: 00814db4df51a384ca9afeb24fb8e791 ShaderImporter: externalObjects: {} defaultTextures: [] nonModifiableTextures: [] + preprocessorOverride: 0 userData: assetBundleName: assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.meta b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.meta new file mode 100644 index 00000000000..f6bdf1fb9f7 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 87ef1aaabcfcf6b4dba0dffa4d16fc00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 38516696702fdef86e340d212a9088e3530721ce Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Mon, 15 Jun 2020 19:11:30 +0200 Subject: [PATCH 2/4] Update ShaderVariablesPhysicallyBasedSky.cs.hlsl --- .../ShaderVariablesPhysicallyBasedSky.cs.hlsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl index 69644bc7a6a..4ea7a08d2cf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl @@ -2,10 +2,10 @@ // This file was automatically generated. Please don't edit by hand. // -#ifndef PHYSICALLYBASEDSKYRENDERER_CS_HLSL -#define PHYSICALLYBASEDSKYRENDERER_CS_HLSL +#ifndef SHADERVARIABLESPHYSICALLYBASEDSKY_CS_HLSL +#define SHADERVARIABLESPHYSICALLYBASEDSKY_CS_HLSL // -// UnityEngine.Rendering.HighDefinition.PhysicallyBasedSkyRenderer+PbrSkyConfig: static fields +// UnityEngine.Rendering.HighDefinition.PbrSkyConfig: static fields // #define PBRSKYCONFIG_GROUND_IRRADIANCE_TABLE_SIZE (256) #define PBRSKYCONFIG_IN_SCATTERED_RADIANCE_TABLE_SIZE_X (128) @@ -13,7 +13,7 @@ #define PBRSKYCONFIG_IN_SCATTERED_RADIANCE_TABLE_SIZE_Z (16) #define PBRSKYCONFIG_IN_SCATTERED_RADIANCE_TABLE_SIZE_W (64) -// Generated from UnityEngine.Rendering.HighDefinition.PhysicallyBasedSkyRenderer+ShaderVariablesPhysicallyBasedSky +// Generated from UnityEngine.Rendering.HighDefinition.ShaderVariablesPhysicallyBasedSky // PackingRules = Exact GLOBAL_CBUFFER_START(ShaderVariablesPhysicallyBasedSky, b2) float _PlanetaryRadius; From 01eca6b99b9af70be03400481f4acc6dec0eb13b Mon Sep 17 00:00:00 2001 From: Jesse Barker Date: Mon, 15 Jun 2020 10:43:00 -0700 Subject: [PATCH 3/4] Fix constant buffer layout for physically based sky - Update Vector3 to Vector4 to reflect actual padding/layout for non-DX platforms (both are 16 bytes in the shader space, but 12 bytes in C#) - Updates to shader code to reference only the float3 data being set up --- .../AtmosphericScattering.hlsl | 6 +++--- .../Runtime/Lighting/LightEvaluation.hlsl | 2 +- .../InScatteredRadiancePrecomputation.compute | 2 +- .../PhysicallyBasedSkyCommon.hlsl | 6 +++--- .../PhysicallyBasedSkyRenderer.cs | 1 + .../ShaderVariablesPhysicallyBasedSky.cs | 21 ++++++++----------- .../ShaderVariablesPhysicallyBasedSky.cs.hlsl | 15 ++++++------- 7 files changed, 26 insertions(+), 27 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl index 82ed08476d1..7b4921dcff6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl @@ -55,7 +55,7 @@ void EvaluatePbrAtmosphere(float3 worldSpaceCameraPos, float3 V, float distAlong // TODO: Not sure it's possible to precompute cam rel pos since variables // in the two constant buffers may be set at a different frequency? - const float3 O = worldSpaceCameraPos - _PlanetCenterPosition; + const float3 O = worldSpaceCameraPos - _PlanetCenterPosition.xyz; const float tFrag = abs(distAlongRay); // Clear the "hit ground" flag float3 N; float r; // These params correspond to the entry point @@ -115,7 +115,7 @@ void EvaluatePbrAtmosphere(float3 worldSpaceCameraPos, float3 V, float distAlong // We may have swapped X and Y. float2 ch = abs(ch0 - ch1); - float3 optDepth = ch.x * H.x * _AirSeaLevelExtinction + float3 optDepth = ch.x * H.x * _AirSeaLevelExtinction.xyz + ch.y * H.y * _AerosolSeaLevelExtinction; skyOpacity = 1 - TransmittanceFromOpticalDepth(optDepth); // from 'tEntry' to 'tFrag' @@ -242,7 +242,7 @@ void EvaluatePbrAtmosphere(float3 worldSpaceCameraPos, float3 V, float distAlong float nrmAngle = Remap01(chiAngle, rcpLen, start * rcpLen); // float angle = saturate((0.5 * PI) - acos(cosChi) * rcp(0.5 * PI)); - skyColor *= ExpLerp(_HorizonTint, _ZenithTint, nrmAngle, _HorizonZenithShiftPower, _HorizonZenithShiftScale); + skyColor *= ExpLerp(_HorizonTint.rgb, _ZenithTint.rgb, nrmAngle, _HorizonZenithShiftPower, _HorizonZenithShiftScale); } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl index e7269e379a1..706a9e1787b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl @@ -201,7 +201,7 @@ float4 EvaluateLight_Directional(LightLoopContext lightLoopContext, PositionInpu // TODO: Not sure it's possible to precompute cam rel pos since variables // in the two constant buffers may be set at a different frequency? float3 X = GetAbsolutePositionWS(posInput.positionWS); - float3 C = _PlanetCenterPosition; + float3 C = _PlanetCenterPosition.xyz; float r = distance(X, C); float cosHoriz = ComputeCosineOfHorizonAngle(r); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/InScatteredRadiancePrecomputation.compute b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/InScatteredRadiancePrecomputation.compute index 75d8cd3d558..ee9b7f40823 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/InScatteredRadiancePrecomputation.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/InScatteredRadiancePrecomputation.compute @@ -258,7 +258,7 @@ void main(uint3 dispatchThreadId : SV_DispatchThreadID) float3 gN = normalize(gP); // Shade the ground. - const float3 gBrdf = INV_PI * _GroundAlbedo; + const float3 gBrdf = INV_PI * _GroundAlbedo.rgb; // TODO: we compute the same thing for many voxels, // the only real difference is the phase function... diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyCommon.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyCommon.hlsl index ab74d59a506..cee55d86c5f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyCommon.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/PhysicallyBasedSkyCommon.hlsl @@ -27,7 +27,7 @@ float DifferenceOfSquares(float a, float b) float3 AirScatter(float height) { - return _AirSeaLevelScattering * exp(-height * _AirDensityFalloff); + return _AirSeaLevelScattering.rgb * exp(-height * _AirDensityFalloff); } float AirPhase(float LdotV) @@ -37,7 +37,7 @@ float AirPhase(float LdotV) float3 AerosolScatter(float height) { - return _AerosolSeaLevelScattering * exp(-height * _AerosolDensityFalloff); + return _AerosolSeaLevelScattering.rgb * exp(-height * _AerosolDensityFalloff); } float AerosolPhase(float LdotV) @@ -285,7 +285,7 @@ float3 ComputeAtmosphericOpticalDepth(float r, float cosTheta, bool aboveHorizon float2 optDepth = ch * H; - return optDepth.x * _AirSeaLevelExtinction + optDepth.y * _AerosolSeaLevelExtinction; + return optDepth.x * _AirSeaLevelExtinction.xyz + optDepth.y * _AerosolSeaLevelExtinction; } float3 ComputeAtmosphericOpticalDepth1(float r, float cosTheta) 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 5f79f09fac6..640191e213c 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 @@ -384,6 +384,7 @@ void UpdateGlobalConstantBuffer(CommandBuffer cmd, BuiltinSkyParameters builtinP m_ConstantBuffer._AerosolAnisotropy = pbrSky.aerosolAnisotropy.value; m_ConstantBuffer._AerosolPhasePartConstant = CornetteShanksPhasePartConstant(pbrSky.aerosolAnisotropy.value); m_ConstantBuffer._Unused = 0.0f; // Warning fix + m_ConstantBuffer._Unused2 = 0.0f; // Warning fix m_ConstantBuffer._AirDensityFalloff = 1.0f / airH; m_ConstantBuffer._AirScaleHeight = airH; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs index a9f62b941b8..7e8ba755c84 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs @@ -32,25 +32,22 @@ unsafe struct ShaderVariablesPhysicallyBasedSky public float _AerosolDensityFalloff; public float _AerosolScaleHeight; - public Vector3 _AirSeaLevelExtinction; - public float _AerosolSeaLevelExtinction; + public Vector4 _AirSeaLevelExtinction; + public Vector4 _AirSeaLevelScattering; + public Vector4 _AerosolSeaLevelScattering; + public Vector4 _GroundAlbedo; + public Vector4 _PlanetCenterPosition; // Not used during the precomputation, but needed to apply the atmospheric effect + public Vector4 _HorizonTint; + public Vector4 _ZenithTint; - public Vector3 _AirSeaLevelScattering; + public float _AerosolSeaLevelExtinction; public float _IntensityMultiplier; - - public Vector3 _AerosolSeaLevelScattering; public float _ColorSaturation; - - public Vector3 _GroundAlbedo; public float _AlphaSaturation; - public Vector3 _PlanetCenterPosition; // Not used during the precomputation, but needed to apply the atmospheric effect public float _AlphaMultiplier; - - public Vector3 _HorizonTint; public float _HorizonZenithShiftPower; - - public Vector3 _ZenithTint; public float _HorizonZenithShiftScale; + public float _Unused2; } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl index 4ea7a08d2cf..b7df04f15ca 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/PhysicallyBasedSky/ShaderVariablesPhysicallyBasedSky.cs.hlsl @@ -28,20 +28,21 @@ GLOBAL_CBUFFER_START(ShaderVariablesPhysicallyBasedSky, b2) float _AirScaleHeight; float _AerosolDensityFalloff; float _AerosolScaleHeight; - float3 _AirSeaLevelExtinction; + float4 _AirSeaLevelExtinction; + float4 _AirSeaLevelScattering; + float4 _AerosolSeaLevelScattering; + float4 _GroundAlbedo; + float4 _PlanetCenterPosition; + float4 _HorizonTint; + float4 _ZenithTint; float _AerosolSeaLevelExtinction; - float3 _AirSeaLevelScattering; float _IntensityMultiplier; - float3 _AerosolSeaLevelScattering; float _ColorSaturation; - float3 _GroundAlbedo; float _AlphaSaturation; - float3 _PlanetCenterPosition; float _AlphaMultiplier; - float3 _HorizonTint; float _HorizonZenithShiftPower; - float3 _ZenithTint; float _HorizonZenithShiftScale; + float _Unused2; CBUFFER_END From 9d0d7759991dfc97730400f78516dac326d1cb74 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Mon, 15 Jun 2020 23:51:11 +0200 Subject: [PATCH 4/4] Update references screenshots --- .../OSXEditor/Metal/None/5004_Pbr_Sky_High_Altitude.png | 4 ++-- .../Linear/OSXEditor/Metal/None/5005_Pbr_Sky_Med_Altitude.png | 4 ++-- .../Linear/OSXEditor/Metal/None/5006_Pbr_Sky_Low_Altitude.png | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5004_Pbr_Sky_High_Altitude.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5004_Pbr_Sky_High_Altitude.png index 2b423b45c63..b5182262ac6 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5004_Pbr_Sky_High_Altitude.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5004_Pbr_Sky_High_Altitude.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c723af154dbb7ffcc7eae1c1a5810846517df5c3fbad0aefb0101d318c7fe36f -size 712864 +oid sha256:aa2586bc9a522e81bd7914c5c603d07ef80f85c93d45c452296b3525a7c16838 +size 701578 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5005_Pbr_Sky_Med_Altitude.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5005_Pbr_Sky_Med_Altitude.png index dc99e209b23..ff42408aa5b 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5005_Pbr_Sky_Med_Altitude.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5005_Pbr_Sky_Med_Altitude.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4e3296ee5a7447a53b6ca1ff47e1342de52b3e474fe5e3526f43a6bd572480a4 -size 34558 +oid sha256:3b251e69e598fb07a8541dfa06ea7ad5fcd836de08aa00dd09dfc9bf4f885fc0 +size 208550 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5006_Pbr_Sky_Low_Altitude.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5006_Pbr_Sky_Low_Altitude.png index dc99e209b23..ec3a216e548 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5006_Pbr_Sky_Low_Altitude.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/5006_Pbr_Sky_Low_Altitude.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4e3296ee5a7447a53b6ca1ff47e1342de52b3e474fe5e3526f43a6bd572480a4 -size 34558 +oid sha256:e52ec8d9e57626d175f26ce3303ff38abd57b1204543ef0d5e6375b523baae40 +size 74986