Skip to content
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

Internal/2023.2/staging #8037

Merged
merged 22 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9f3a335
[Port] [2023.2] Disable the culling mask setting when only Forward+ i…
svc-reach-platform-support Feb 9, 2024
0f6c6f8
[2023.2][URP] Changing check for Auto Mode in ShAutoDetect.
ellioman Feb 9, 2024
af54814
[Port] [2023.2] Fixed highlighting on HLSL code samples in URP Docs
svc-reach-platform-support Feb 10, 2024
1a35590
[2023.2][URP] Ensure vertex SH is initialized in terrain when SH PerV…
svc-reach-platform-support Feb 13, 2024
14327f5
[Port] [2023.2] [VFX][Fix] Disable SDF Baker for GLES3
svc-reach-platform-support Feb 14, 2024
b637cfa
[23.2] Optimize sky precomputation and memory usage
adrien-de-tocqueville Feb 14, 2024
befdadf
[VFX] Fix VFXRenderer listing in Animation (to 2023.2)
PaulDemeulenaere Feb 14, 2024
b5041d8
[Port] [2023.2] Fix perf when disabling decals
svc-reach-platform-support Feb 14, 2024
ffa954d
2023.2/2d/staging/tilemap/uum62066
ChuanXin-Unity Feb 15, 2024
a3a355f
[Port] [2023.2] Fix GPU crash by fixing out-of-bounds buffer access
ApoorvaJ Feb 15, 2024
47ce5c6
[Port] [2023.2] Add link from URP to error shader page and back
svc-reach-platform-support Feb 16, 2024
d8afed8
Fix display Global Settings due to invalid access to pipeline type.
alex-vazquez-unity3d Feb 17, 2024
18c1327
[VFX] Fix HLSL 2021 Incompatibility (to 2023.2)
PaulDemeulenaere Feb 17, 2024
7b71340
[Port] [2023.2] [VFX] PropertyBinder ExecuteInEditMode in ExecuteAlways
svc-reach-platform-support Feb 19, 2024
a4be88a
[2023.2][UUM-63214] Fix missing draw calls for stencil pass for Sprit…
kennytann Feb 19, 2024
e5b5bb1
[Port] [2023.2] Improve URP light masking UI
svc-reach-platform-support Feb 21, 2024
58250b4
[Port] [2023.2] [URP] Fix FinalPost running before passes injected in…
svc-reach-platform-support Feb 21, 2024
5a38c7e
2023.2: Fix for URP Unlit Shader Graph which does not render correctl…
Saiprasad945 Feb 21, 2024
9c554e7
[Port] [2023.2] DOCG-1025 Improvements to screen space shadows page, …
svc-reach-platform-support Feb 21, 2024
85c4594
[Port] [2023.2] Fix Broken Links in URP Docs
svc-reach-platform-support Feb 21, 2024
ace41b8
[Port] [2023.2] UUM-61466 Set depth format for cameras with motion ve…
svc-reach-platform-support Feb 22, 2024
f5adf46
[2023.2][URP] Fixing an issue with Alpha clipping and Depth Priming (…
svc-reach-platform-support Feb 23, 2024
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 @@ -15,8 +15,8 @@ class DefaultVolumeProfileCategories

public DefaultVolumeProfileCategories(VolumeProfile profile, Editor baseEditor)
{
var pipelineType = RenderPipelineManager.currentPipeline.GetType();
var volumeComponentTypeList = VolumeManager.instance.GetVolumeComponentsForDisplay(pipelineType);
var volumeComponentTypeList = VolumeManager.instance
.GetVolumeComponentsForDisplay(GraphicsSettings.currentRenderPipelineAssetType);

foreach (var defaultCategory in s_DefaultCategoryNames)
categories.Add(defaultCategory, new());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void DrawEditor(VolumeComponentEditor editor, int index = -1)
private void CreateEditorsByCategory()
{
var volumeComponentTypeList =
VolumeManager.instance.GetVolumeComponentsForDisplay(RenderPipelineManager.currentPipeline.GetType());
VolumeManager.instance.GetVolumeComponentsForDisplay(GraphicsSettings.currentRenderPipelineAssetType);

m_EditorsByCategory.Clear();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,18 @@ MonoBehaviour:
material:
m_OverrideState: 1
m_Value: {fileID: -876546973899608171, guid: 02532cbb810fb404db49da84f1efe41e, type: 3}
sphericalMode:
m_OverrideState: 0
m_Value: 1
seaLevel:
m_OverrideState: 0
m_Value: 0
planetaryRadius:
m_OverrideState: 0
m_Value: 6378100
planetCenterPosition:
m_OverrideState: 0
m_Value: {x: 0, y: -6378100, z: 0}
airDensityR:
m_OverrideState: 0
m_Value: 0.04534
Expand Down Expand Up @@ -443,9 +455,6 @@ MonoBehaviour:
aerosolAnisotropy:
m_OverrideState: 0
m_Value: 0.7
numberOfBounces:
m_OverrideState: 0
m_Value: 3
groundTint:
m_OverrideState: 0
m_Value: {r: 0.4, g: 0.25, b: 0.15, a: 1}
Expand Down Expand Up @@ -488,22 +497,13 @@ MonoBehaviour:
horizonZenithShift:
m_OverrideState: 0
m_Value: 0
numberOfBounces:
m_OverrideState: 0
m_Value: 3
m_SkyVersion: 3
m_ObsoleteEarthPreset:
m_OverrideState: 0
m_Value: 1
sphericalMode:
m_OverrideState: 0
m_Value: 1
seaLevel:
m_OverrideState: 0
m_Value: 0
planetaryRadius:
m_OverrideState: 0
m_Value: 6378100
planetCenterPosition:
m_OverrideState: 0
m_Value: {x: 0, y: -6378100, z: 0}
--- !u!114 &5305602202033311358
MonoBehaviour:
m_ObjectHideFlags: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class PhysicallyBasedSkyEditor : SkySettingsEditor
SerializedDataParameter m_ZenithTint;
SerializedDataParameter m_HorizonZenithShift;

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") };
Expand Down Expand Up @@ -94,8 +92,6 @@ public override void OnEnable()
m_HorizonTint = Unpack(o.Find(x => x.horizonTint));
m_ZenithTint = Unpack(o.Find(x => x.zenithTint));
m_HorizonZenithShift = Unpack(o.Find(x => x.horizonZenithShift));

m_NumberOfBounces = Unpack(o.Find(x => x.numberOfBounces));
}

public override void OnInspectorGUI()
Expand Down Expand Up @@ -190,7 +186,6 @@ public override void OnInspectorGUI()

EditorGUILayout.Space();
DrawHeader("Miscellaneous");
PropertyField(m_NumberOfBounces);

base.CommonSkySettingsGUI();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl"
#endif

StructuredBuffer<CelestialBodyData> _CelestialBodyDatas;

TEXTURE3D(_VBufferLighting);

float3 ExpLerp(float3 A, float3 B, float t, float x, float y)
Expand Down Expand Up @@ -121,26 +123,20 @@ void EvaluatePbrAtmosphere(float3 worldSpaceCameraPos, float3 V, float distAlong

skyOpacity = 1 - TransmittanceFromOpticalDepth(optDepth); // from 'tEntry' to 'tFrag'


for (uint i = 0; i < _DirectionalLightCount; i++)
for (uint i = 0; i < _CelestialLightCount; i++)
{
DirectionalLightData light = _DirectionalLightDatas[i];

// Use scalar or integer cores (more efficient).
bool interactsWithSky = asint(light.distanceFromCamera) >= 0;

if (!interactsWithSky) continue;
CelestialBodyData light = _CelestialBodyDatas[i];

float3 L = -light.forward.xyz;

// The sun disk hack causes some issues when applied to nearby geometry, so don't do that.
if (renderSunDisk && asint(light.angularDiameter) != 0 && light.distanceFromCamera <= tFrag)
if (renderSunDisk && asint(light.angularRadius) != 0 && light.distanceFromCamera <= tFrag)
{
float c = dot(L, -V);

if (-0.99999 < c && c < 0.99999)
{
float alpha = 0.5 * light.angularDiameter;
float alpha = light.angularRadius;
float beta = acos(c);
float gamma = min(alpha, beta);

Expand Down Expand Up @@ -185,7 +181,7 @@ void EvaluatePbrAtmosphere(float3 worldSpaceCameraPos, float3 V, float distAlong
// MS.
radiance += lerp(SAMPLE_TEXTURE3D_LOD(_MultipleScatteringTexture, s_linear_clamp_sampler, float3(tc.u, tc.v, tc.w0), 0).rgb,
SAMPLE_TEXTURE3D_LOD(_MultipleScatteringTexture, s_linear_clamp_sampler, float3(tc.u, tc.v, tc.w1), 0).rgb,
tc.a);
tc.a) * MS_EXPOSURE_INV;

if (rayEndsInsideAtmosphere)
{
Expand Down Expand Up @@ -218,7 +214,7 @@ void EvaluatePbrAtmosphere(float3 worldSpaceCameraPos, float3 V, float distAlong
// MS.
radiance1 += lerp(SAMPLE_TEXTURE3D_LOD(_MultipleScatteringTexture, s_linear_clamp_sampler, float3(tc.u, tc.v, tc.w0), 0).rgb,
SAMPLE_TEXTURE3D_LOD(_MultipleScatteringTexture, s_linear_clamp_sampler, float3(tc.u, tc.v, tc.w1), 0).rgb,
tc.a);
tc.a) * MS_EXPOSURE_INV;

// L(tEntry, tFrag) = L(tEntry, tExit) - T(tEntry, tFrag) * L(tFrag, tExit)
radiance = max(0, radiance - (1 - skyOpacity) * radiance1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ void InitMaterial()

#if UNITY_EDITOR
static List<DecalProjector> m_DecalProjectorInstances; // List of decal projectors that have had OnEnable() called on them
[NonSerialized] int m_EditorInstanceIndex = -1;
#endif
void OnEnable()
{
Expand Down Expand Up @@ -393,6 +394,7 @@ void OnEnable()
if (PrefabStageUtility.GetCurrentPrefabStage() != null) // In case the prefab stage is already opened when enabling the decal
RegisterDecalVisibilityUpdatePrefabStage();
}
m_EditorInstanceIndex = m_DecalProjectorInstances.Count;
m_DecalProjectorInstances.Add(this);
#endif
}
Expand Down Expand Up @@ -489,8 +491,9 @@ void OnDisable()
#if UNITY_EDITOR
// Remove this instance from the list tracking active decal projectors.
// We do this by swapping the last element of the array into the slot we are deleting rather than shuffling the entire contents above the slot down as it's faster and the actual ordering is not significant
int instanceIndex = m_DecalProjectorInstances.FindIndex((x) => ReferenceEquals(x, this));
m_DecalProjectorInstances[instanceIndex] = m_DecalProjectorInstances[m_DecalProjectorInstances.Count - 1];
var movedInstance = m_DecalProjectorInstances[m_EditorInstanceIndex] = m_DecalProjectorInstances[m_DecalProjectorInstances.Count - 1];
movedInstance.m_EditorInstanceIndex = m_EditorInstanceIndex;
m_EditorInstanceIndex = -1;
m_DecalProjectorInstances.RemoveAt(m_DecalProjectorInstances.Count - 1);

// If the list of active instances is now empty delete it and un-register our event handlers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1583,10 +1583,10 @@ public void UpdateTextureAtlas(CommandBuffer cmd)
AddTexture(cmd, textureScaleBias);
}

#if UNITY_EDITOR || DEVELOPMENT_BUILD
if (!m_AllocationSuccess && m_PrevAllocationSuccess) // still failed to allocate, decal atlas size needs to increase, debounce so that we don't spam the console with warnings
{
Debug.LogWarning(s_AtlasSizeWarningMessage);
}
#endif
}
m_PrevAllocationSuccess = m_AllocationSuccess;
// now that textures have been stored in the atlas we can update their location info in decal data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ public sealed class ShaderResources
public Shader gradientSkyPS;
[Reload("Runtime/Sky/AmbientProbeConvolution.compute")]
public ComputeShader ambientProbeConvolutionCS;
[Reload("Runtime/Sky/PhysicallyBasedSky/SkyLUTGenerator.compute")]
public ComputeShader skyLUTGenerator;
[Reload("Runtime/Sky/PhysicallyBasedSky/GroundIrradiancePrecomputation.compute")]
public ComputeShader groundIrradiancePrecomputationCS;
[Reload("Runtime/Sky/PhysicallyBasedSky/InScatteredRadiancePrecomputation.compute")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ static class HDShaderIDs
public static readonly int _MaxZMaskTexture = Shader.PropertyToID("_MaxZMaskTexture");
public static readonly int _DilationWidth = Shader.PropertyToID("_DilationWidth");

public static readonly int _MultiScatteringLUT_RW = Shader.PropertyToID("_MultiScatteringLUT_RW");
public static readonly int _MultiScatteringLUT = Shader.PropertyToID("_MultiScatteringLUT");
public static readonly int _GroundIrradianceTexture = Shader.PropertyToID("_GroundIrradianceTexture");
public static readonly int _GroundIrradianceTable = Shader.PropertyToID("_GroundIrradianceTable");
public static readonly int _GroundIrradianceTableOrder = Shader.PropertyToID("_GroundIrradianceTableOrder");
Expand All @@ -694,7 +696,6 @@ static class HDShaderIDs
public static readonly int _AerosolSingleScatteringTable = Shader.PropertyToID("_AerosolSingleScatteringTable");
public static readonly int _MultipleScatteringTexture = Shader.PropertyToID("_MultipleScatteringTexture");
public static readonly int _MultipleScatteringTable = Shader.PropertyToID("_MultipleScatteringTable");
public static readonly int _MultipleScatteringTableOrder = Shader.PropertyToID("_MultipleScatteringTableOrder");

public static readonly int _PlanetaryRadius = Shader.PropertyToID("_PlanetaryRadius");
public static readonly int _RcpPlanetaryRadius = Shader.PropertyToID("_RcpPlanetaryRadius");
Expand Down
Loading
Loading