Skip to content

Fix Generates Include command issue with Physically Based Sky #908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,60 +286,6 @@ public bool Update(BuiltinSkyParameters builtinParams, PhysicallyBasedSky pbrSky
}
}

[GenerateHLSL]
public enum PbrSkyConfig
{
// Tiny
GroundIrradianceTableSize = 256, // <N, L>

// 32 MiB
InScatteredRadianceTableSizeX = 128, // <N, V>
InScatteredRadianceTableSizeY = 32, // height
InScatteredRadianceTableSizeZ = 16, // AzimuthAngle(L) w.r.t. the view vector
InScatteredRadianceTableSizeW = 64, // <N, L>,
}

[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;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
namespace UnityEngine.Rendering.HighDefinition
{
[GenerateHLSL]
public enum PbrSkyConfig
{
// Tiny
GroundIrradianceTableSize = 256, // <N, L>

// 32 MiB
InScatteredRadianceTableSizeX = 128, // <N, V>
InScatteredRadianceTableSizeY = 32, // height
InScatteredRadianceTableSizeZ = 16, // AzimuthAngle(L) w.r.t. the view vector
InScatteredRadianceTableSizeW = 64, // <N, L>,
}

[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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
// 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)
#define PBRSKYCONFIG_IN_SCATTERED_RADIANCE_TABLE_SIZE_Y (32)
#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;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.