Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
6464293
Add obsolete attribute to GetInstanceID
EmilieThaulow Oct 21, 2025
50a755e
Fix XBox performance issue with UIToolkit shader.
ncerone-unity Oct 21, 2025
2c40ca5
Fixed Additional Data missing warning from Debug UI when Build
kirill-titov-u Oct 21, 2025
9098eeb
Add correct docs link for ProbeVolumeBakingSet
laylaarab Oct 21, 2025
3a8c08f
URP Remove dead code and hide obsolete IntermediateTextureMode setting
UnityAljosha Oct 21, 2025
ba4a180
Removed temp empty stubs for URP comp mode
kirill-titov-u Oct 21, 2025
1cdc4ea
[VFX/SG] Update Label when Name changes
Oct 22, 2025
d386a6f
fix: Fix null reference exception in ShadowMesh2D and add 2D tests
karasusan Oct 22, 2025
fc243ac
Make sure the lambdas are static in URP and HDRP
kirill-titov-u Oct 22, 2025
c4c2942
docg-7965: shader graph asset inspector properties
ocarrere Oct 22, 2025
ea28f74
[VFX] Fix errors when undoing moving a property into the output categ…
julienamsellem Oct 22, 2025
84064ca
fix BRG failing test on android samsung s21
arnaudcarre Oct 22, 2025
212765d
Documentation feedback improvements 20 Oct
markg-unity Oct 22, 2025
6f7ad11
[VFX] Remove deprecated UxmlFactory and use the new approach
ludovic-theobald Oct 22, 2025
96c5451
Update UX and docs for advanced properties to show the global behavior
jenniferd-unity Oct 22, 2025
36907a1
docg-8045: Harmonize six-way lighting TOC entry and section title
ocarrere Oct 22, 2025
19d35f0
[Port 6000.4] URP Fix partial prepass in deferred - should not be dep…
UnityAljosha Oct 23, 2025
efd9cd8
[Port] [6000.4] Streamline the Shader Graph's Get started instruction…
svc-reach-platform-support Oct 24, 2025
700dbcf
Bugfix/uum 118991
SebastienLa Oct 24, 2025
9d6bae4
[Port] [6000.4] [VFX] Fix Install Learning Template
svc-reach-platform-support Oct 24, 2025
e2c060b
Revert "Bugfix/uum 118991"
ggkarm-u Oct 27, 2025
6204618
[Port] [6000.4] Fix MacOS memory regression by removing unexpected cs…
svc-reach-platform-support Oct 27, 2025
fb50c3d
[Port] [6000.4] DOCG-7982 Move and restructure metallic, specular, an…
svc-reach-platform-support Oct 27, 2025
5cfb4ea
[Port] [6000.4] [VFX] Allow Template Icons having a light/dark skin
svc-reach-platform-support Oct 28, 2025
31e1947
[Port] [6000.4] [IUpscaler] fix error when NVIDIA package not enabled
svc-reach-platform-support Oct 28, 2025
ad776e1
[Port] [6000.4] [HDRP] fix assertion when HDCamera.allowDynamicResolu…
svc-reach-platform-support Oct 28, 2025
9ea377b
[Port] [6000.4] UUM-122571: Fix reflection probe keyword warnings
svc-reach-platform-support Oct 28, 2025
d49988b
[Port] [6000.4] Modify FirstPersonController to use Input system
svc-reach-platform-support Oct 28, 2025
87e7bd6
[Port] [6000.4] [6.5][URP 2D] Remove internal texture only used in co…
svc-reach-platform-support Oct 29, 2025
da08e24
[Port] [6000.4] Graphics/SRP/RenderGraph - Various Small Main thread …
svc-reach-platform-support Oct 29, 2025
95a11c4
[Port] [6000.4] PostProcessPass API fixes.
svc-reach-platform-support Oct 30, 2025
1faea5f
[Port] [6000.4] [VFX] Fix global texture binding in VFX
svc-reach-platform-support Oct 30, 2025
294d40d
[Port] [6000.4][Tests] HDRP Tests: fix DLSS debug view memory allocat…
volkan-unity Oct 31, 2025
46a75a8
[Port] [6000.4] [VFX] Two issues with groups and sticky notes
svc-reach-platform-support Oct 31, 2025
1b9197c
[Port] [6000.4] Fix out of bounds access in Path Tracing Core which c…
svc-reach-platform-support Oct 31, 2025
6aa391d
[Port] [6000.4] UUM-112854 : Split GPUOcclusionCulling indirect args …
svc-reach-platform-support Oct 31, 2025
7ef177f
[Port] [6000.4] [VFX] Safe normalize in LookAt operator to prevent NaN
svc-reach-platform-support Oct 31, 2025
3548d1c
[Port] [6000.4] docg-7699: Update Keyword and Property parameter ref …
svc-reach-platform-support Oct 31, 2025
761de63
[Port] [6000.4] Make EntityId implicit Conversion to int Obsolete
EmilieThaulow Oct 31, 2025
f687a37
[Port] [6000.4] [WBTR] Terrain SG config node doc
svc-reach-platform-support Oct 31, 2025
6917c30
[Port] [6000.4] docg-7817: Add 3 new options in Shader Graph preferen…
svc-reach-platform-support Oct 31, 2025
c501cb4
[UUM-125567] Disable unstable test
Daniel-Dobzinski Oct 31, 2025
974562b
[Port] [6000.4] Fix unassigned rendertarget color & depth in OnRender…
svc-reach-platform-support Nov 3, 2025
03882fd
[Port] [6000.4] Fix cyclic asset references in Lens Flares
svc-reach-platform-support Nov 3, 2025
5251596
[Port] [6000.4] [VFX] Detect and break cycles when doing a new connec…
svc-reach-platform-support Nov 4, 2025
605ff56
[Port] [6000.4] DOCG-7799 Update Rendering Statistics window reference
svc-reach-platform-support Nov 4, 2025
4d27406
[Port] [6000.4] Graphics docs feedback tickets
svc-reach-platform-support Nov 4, 2025
d4fcf6c
[Port] [6000.4] [UUM-122631][6000.5][URP 2D] Fix Sprite Skinning for …
svc-reach-platform-support Nov 4, 2025
e83ed9d
[Port] [6000.4] Graphics/SRP/RPF - [UUM-122102] Optimize check for Ne…
svc-reach-platform-support Nov 5, 2025
168ad8b
[Port] [6000.4] [VFX] Duplicated property was not properly ordered in…
svc-reach-platform-support Nov 5, 2025
e939254
[Port] [6000.4] [VFX] Prevent minimum value to be greater than maximu…
svc-reach-platform-support Nov 5, 2025
9ef8dd8
Refactored UI Toolkit URP Gfx Tests
alexandret-unity Nov 5, 2025
60dfe42
[Port] [6000.4] Render Graph - Fix the Frame Debugger error by adding…
svc-reach-platform-support Nov 5, 2025
070d127
[Port] [6000.4] DOCG-7704 Clarify Rounded Rectangle node
svc-reach-platform-support Nov 5, 2025
0e34003
[Port] [6000.4] [VFX] Rename property in blackboard for a template ca…
svc-reach-platform-support Nov 5, 2025
e0477c2
[Port] [6000.4] [VFX] Improved inspector UI consistency
svc-reach-platform-support Nov 5, 2025
f6d0e10
[Port] [6000.4] [VFX] ColorField get lost after domain reload
svc-reach-platform-support Nov 5, 2025
ee7885a
[Port] [6000.4] [VFX] Fixed capitalization issue and also white space…
svc-reach-platform-support Nov 5, 2025
256a70c
[Port] [6000.4] Fix HDRP undo light crash
svc-reach-platform-support Nov 6, 2025
f392f86
[Port] [6000.4] DOCG-7818 + DOCG-7919 Update URP and HDRP Materials f…
svc-reach-platform-support Nov 6, 2025
0462bc0
[Port] [6000.4] [ShaderGraph] "View Generated Shader" button in Shade…
svc-reach-platform-support Nov 7, 2025
9551c60
[Port] [6000.4] Fix thread issue with underline
svc-reach-platform-support Nov 9, 2025
7d5199a
6000.4/uitech/uum 119998 filter color space
alexandret-unity Nov 10, 2025
147a298
[Port] [6000.4] Fix for inconsistant API access to SpriteMaskInteraction
svc-reach-platform-support Nov 11, 2025
023f107
[Port] [6000.4] Fixed disable light settings
svc-reach-platform-support Nov 11, 2025
363bcd9
[Port] [6000.4] Documentation feedback improvements November 2025
svc-reach-platform-support Nov 11, 2025
dfee00b
[Backport] More EntityId changes (Mostly Profiler) #80523
Daxode Nov 12, 2025
953c19b
[Port] [6000.4] Fix for incorrect buffer size when switching XR On/Off
svc-reach-platform-support Nov 13, 2025
2d95f11
[Port] [6000.4] [APV] Loading a baking set using the Load Baking Set …
svc-reach-platform-support Nov 13, 2025
fc92690
[Port] [6000.4] [UUM-126295] Fix for issues with with sprite mask int…
svc-reach-platform-support Nov 13, 2025
6271a92
[Port] [6000.4] UUM-120684 : Fixed Scene Visibility toggle button not…
svc-reach-platform-support Nov 13, 2025
8fc3dfc
[Port] [6000.4] docg-7322: Clarify Keyword node behavior
svc-reach-platform-support Nov 13, 2025
0c31e9a
[Port] [6000.4] [URP] [XR] Fixed transient textures dynamic scaling w…
svc-reach-platform-support Nov 14, 2025
b8f92e8
[Port] [6000.4] [D2D-7776][URP 2D] Improve extensibility - expose tex…
svc-reach-platform-support Nov 14, 2025
a53207d
[Port] [6000.4] UUM-126128: Fix warning when building Mixed Reality t…
svc-reach-platform-support Nov 14, 2025
9cbb1dd
[Port] [6000.4] DOCG-7161 - Update VFX Graph reference content about …
svc-reach-platform-support Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* [Customize the UI of a setting](customize-ui-for-a-setting.md)
* [Get custom graphics settings](get-custom-graphics-settings.md)
* [Include or exclude a setting in your build](choose-whether-unity-includes-a-graphics-setting-in-your-build.md)
* [Advanced Properties](advanced-properties.md)
* [Shaders](shaders.md)
* [Use shader methods from the SRP Core shader library](built-in-shader-methods.md)
* [Synchronizing shader code and C#](generating-shader-includes.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ There is a global state per user that stores if Unity displays **advanced proper
## Exposing advanced properties within the inspector

Not every component or Volume Override includes advanced properties.
If one does, it has a contextual menu to the right of each property section header that includes additional properties. To expose advanced properties for that section, open the contextual menu and click **Advanced Properties**.
If one does, it has a contextual menu to the right of each property section header that includes additional properties. To expose advanced properties for that section, open the contextual menu and click **Show All Advanced Properties**.

For an example, refer to the **Water Surface** component in [High Definition Render Pipeline (HDRP)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/settings-and-properties-related-to-the-water-system.html).

By default only standard properties are shown.

![](Images/Preferences/HDRP_WaterSurface_General.png)

When you select **Advanced Properties**:
When you select **Show All Advanced Properties**:

![](Images/Preferences/PopUpAdvanced.png)

**Advanced Properties** become visible:

![](Images/Preferences/HDRP_WaterSurface_General_Visible.png)

For Volume Overrides, the already existing contextual menu has a **Advanced Properties** toggle as well.
For Volume Overrides, the already existing contextual menu has a **Show All Advanced Properties** toggle as well.

## Exposing advanced properties on preferences

You can also access to this global preference by:

1. Open the **Graphics** tab in the **Preferences** window (menu: **Edit > Preferences > Graphics**).
2. Under **Properties**. Set **Advanced Properties** to **All Visible**.
1. Open the **Graphics** tab in the **Preferences** window (menu: **Edit > Preferences**, macOS: **Unity > Settings**).
2. Under **Graphics**, select **Properties**. Set **Advanced Properties** to **All Visible**.

![](Images/Preferences/AdvancedProperties_Settings.png)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
[assembly: InternalsVisibleTo("Unity.RenderPipelines.Core.Editor.Tests")]
[assembly: InternalsVisibleTo("Unity.RenderPipelines.HighDefinition.Editor.Tests")]
[assembly: InternalsVisibleTo("Unity.RenderPipelines.Universal.Editor.Tests")]
[assembly: InternalsVisibleTo("Unity.Testing.VisualEffectGraph.EditorTests")]
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor-testable")]

Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private void CheckGPUResidentDrawerUsage()
return;

GraphicsSettings.GetRenderPipelineSettings<GPUResidentDrawerResources>()
.ForEachFieldOfType<ComputeShader>(computeShader => computeShaderCache.Add(computeShader.GetInstanceID(), computeShader));
.ForEachFieldOfType<ComputeShader>(computeShader => computeShaderCache.Add(computeShader.GetEntityId(), computeShader));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ class SRPDisabledComputeShaderVariantStripper : IComputeShaderVariantStripper
public bool active => !CoreBuildData.instance.buildingPlayerForRenderPipeline;

public bool CanRemoveVariant([DisallowNull] ComputeShader shader, string _, ShaderCompilerData __)
=> CoreBuildData.instance.computeShaderCache.ContainsKey(shader.GetInstanceID());
=> CoreBuildData.instance.computeShaderCache.ContainsKey(shader.GetEntityId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public int selectedPanel
get => Mathf.Max(0, DebugManager.instance.PanelIndex(selectedPanelDisplayName));
set
{
var displayName = DebugManager.instance.PanelDiplayName(value);
var displayName = DebugManager.instance.PanelDisplayName(value);
if (!string.IsNullOrEmpty(displayName))
selectedPanelDisplayName = displayName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ static AccelStructAdapter BuildAccelerationStructure()
Span<bool> perSubMeshOpaqueness = stackalloc bool[subMeshCount];
perSubMeshOpaqueness.Fill(true);

accelStruct.AddInstance(renderer.component.GetInstanceID(), renderer.component, perSubMeshMask, matIndices, perSubMeshOpaqueness, 1);
accelStruct.AddInstance(renderer.component.GetEntityId(), renderer.component, perSubMeshMask, matIndices, perSubMeshOpaqueness, 1);
}

foreach (var terrain in contributors.terrains)
{
uint mask = GetInstanceMask(terrain.component.shadowCastingMode);
uint materialID = terrain.component.renderingLayerMask; // repurpose the material id as we don't need it here
accelStruct.AddInstance(terrain.component.GetInstanceID(), terrain.component, new uint[1] { mask }, new uint[1] { materialID }, new bool[1] { true }, 1);
accelStruct.AddInstance(terrain.component.GetEntityId(), terrain.component, new uint[1] { mask }, new uint[1] { materialID }, new bool[1] { true }, 1);
}

return accelStruct;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ static AccelStructAdapter BuildAccelerationStructure()
Span<bool> perSubMeshOpaqueness = stackalloc bool[subMeshCount];
perSubMeshOpaqueness.Fill(true);

accelStruct.AddInstance(renderer.component.GetInstanceID(), renderer.component, perSubMeshMask, matIndices, perSubMeshOpaqueness, 1);
accelStruct.AddInstance((int)renderer.component.GetEntityId().GetRawData(), renderer.component, perSubMeshMask, matIndices, perSubMeshOpaqueness, 1);
}

foreach (var terrain in contributors.terrains)
{
uint mask = GetInstanceMask(terrain.component.shadowCastingMode);
accelStruct.AddInstance(terrain.component.GetInstanceID(), terrain.component, new uint[1] { mask }, new uint[1] { 0 }, new bool[1] { true }, 1);
accelStruct.AddInstance(terrain.component.GetEntityId(), terrain.component, new uint[1] { mask }, new uint[1] { 0 }, new bool[1] { true }, 1);
}

return accelStruct;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static AccelStructAdapter BuildAccelerationStructure(int mask)
Span<bool> perSubMeshOpaqueness = stackalloc bool[subMeshCount];
perSubMeshOpaqueness.Fill(true);

accelStruct.AddInstance(renderer.component.GetInstanceID(), renderer.component, maskAndMatDummy, maskAndMatDummy, perSubMeshOpaqueness, 1);
accelStruct.AddInstance(renderer.component.GetEntityId(), renderer.component, maskAndMatDummy, maskAndMatDummy, perSubMeshOpaqueness, 1);
}

foreach (var terrain in contributors.terrains)
Expand All @@ -158,7 +158,7 @@ static AccelStructAdapter BuildAccelerationStructure(int mask)
if ((layerMask & mask) == 0)
continue;

accelStruct.AddInstance(terrain.component.GetInstanceID(), terrain.component, new uint[1] { 0xFFFFFFFF }, new uint[1] { 0xFFFFFFFF }, new bool[1] { true }, 1);
accelStruct.AddInstance(terrain.component.GetEntityId(), terrain.component, new uint[1] { 0xFFFFFFFF }, new uint[1] { 0xFFFFFFFF }, new bool[1] { true }, 1);
}

return accelStruct;
Expand Down Expand Up @@ -350,7 +350,7 @@ static internal void RecomputeVOForDebugOnly()
var chunkSizeInProbes = ProbeBrickPool.GetChunkSizeInProbeCount();
var hasVirtualOffsets = m_BakingSet.settings.virtualOffsetSettings.useVirtualOffset;
var hasRenderingLayers = m_BakingSet.useRenderingLayers;

if (ValidateBakingCellsSize(bakingCellsArray, chunkSizeInProbes, hasVirtualOffsets, hasRenderingLayers))
{
// Write back the assets.
Expand Down Expand Up @@ -480,7 +480,7 @@ static uint[] GetMaterialIndices(Renderer renderer)
for (int i = 0; i < matIndices.Length; ++i)
{
if (i < renderer.sharedMaterials.Length && renderer.sharedMaterials[i] != null)
matIndices[i] = (uint)renderer.sharedMaterials[i].GetInstanceID();
matIndices[i] = (uint)renderer.sharedMaterials[i].GetEntityId().GetRawData();
else
matIndices[i] = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ void BakingGUI()
activeSet = newSet;

ProbeReferenceVolume.instance.Clear();
ProbeReferenceVolume.instance.SetActiveBakingSet(newSet);
}

if (activeSet != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public void UpdateViewedObject(GameObject viewedObject)

bool fromHierarchy = viewedObject.scene.IsValid();
if (fromHierarchy)
viewedObjecHierarchytEntityId = viewedObject.GetInstanceID();
viewedObjecHierarchytEntityId = viewedObject.GetEntityId();
else
viewedObjectAssetGUID = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(viewedObject));
viewedObjectReference = viewedObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public static void CreateAndAssignTo(ObjectField field)
var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon");
var assetCreator = ScriptableObject.CreateInstance<EnvironmentLibraryCreator>();
assetCreator.SetField(field);
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(assetCreator.GetInstanceID(), assetCreator, "New EnvironmentLibrary.asset", icon, null);
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(assetCreator.GetEntityId(), assetCreator, "New EnvironmentLibrary.asset", icon, null);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ internal static bool Bake(string bakeInputPath, string lightmapRequestsPath, str
// Read BakeInput and requests from LightBaker
if (!BakeInputSerialization.Deserialize(bakeInputPath, out BakeInput bakeInput))
return false;
if (!BakeInputSerialization.Deserialize(lightmapRequestsPath, out LightmapRequestData lightmapRequestData))
if (!BakeInputSerialization.Deserialize(lightmapRequestsPath, out LightmapRequestData lightmapRequestData))
return false;
if (!BakeInputSerialization.Deserialize(lightProbeRequestsPath, out ProbeRequestData probeRequestData))
return false;
Expand Down Expand Up @@ -400,33 +400,33 @@ internal static bool Bake(string bakeInputPath, string lightmapRequestsPath, str
using UnityComputeWorld world = new();
world.Init(rayTracingContext, worldResources);

using var samplingResources = new UnityEngine.Rendering.Sampling.SamplingResources();
samplingResources.Load((uint)UnityEngine.Rendering.Sampling.SamplingResources.ResourceType.All);
using var samplingResources = new UnityEngine.Rendering.Sampling.SamplingResources();
samplingResources.Load((uint)UnityEngine.Rendering.Sampling.SamplingResources.ResourceType.All);

// Deserialize BakeInput, inject data into world
const bool useLegacyBakingBehavior = true;
const bool autoEstimateLUTRange = true;
BakeInputToWorldConversion.InjectBakeInputData(world.PathTracingWorld, autoEstimateLUTRange, in bakeInput,
// Deserialize BakeInput, inject data into world
const bool useLegacyBakingBehavior = true;
const bool autoEstimateLUTRange = true;
BakeInputToWorldConversion.InjectBakeInputData(world.PathTracingWorld, autoEstimateLUTRange, in bakeInput,
out Bounds sceneBounds, out world.Meshes, out FatInstance[] fatInstances, out world.LightHandles,
world.TemporaryObjects, UnityComputeWorld.RenderingObjectLayer);

// Add instances to world
WorldHelpers.AddContributingInstancesToWorld(world.PathTracingWorld, in fatInstances, out var lodInstances, out var lodgroupToContributorInstances);
WorldHelpers.AddContributingInstancesToWorld(world.PathTracingWorld, in fatInstances, out var lodInstances, out var lodgroupToContributorInstances);

// Build world with extracted data
const bool emissiveSampling = true;
world.PathTracingWorld.Build(sceneBounds, deviceContext.GetCommandBuffer(), ref world.ScratchBuffer, samplingResources, emissiveSampling);
// Build world with extracted data
const bool emissiveSampling = true;
world.PathTracingWorld.Build(sceneBounds, deviceContext.GetCommandBuffer(), ref world.ScratchBuffer, samplingResources, emissiveSampling);

LightmapBakeSettings lightmapBakeSettings = GetLightmapBakeSettings(bakeInput);
// Build array of lightmap descriptors based on the atlassing data and instances.
LightmapDesc[] lightmapDescriptors = PopulateLightmapDescsFromAtlassing(in lightmapRequestData.atlassing, in fatInstances);
LightmapDesc[] lightmapDescriptors = PopulateLightmapDescsFromAtlassing(in lightmapRequestData.atlassing, in fatInstances);
SortInstancesByMeshAndResolution(lightmapDescriptors);

ulong probeWorkSteps = CalculateWorkStepsForProbeRequests(in bakeInput, in probeRequestData);
ulong lightmapWorkSteps = CalculateWorkStepsForLightmapRequests(in lightmapRequestData, lightmapDescriptors, lightmapBakeSettings);
ulong lightmapWorkSteps = CalculateWorkStepsForLightmapRequests(in lightmapRequestData, lightmapDescriptors, lightmapBakeSettings);
progressState.SetTotalWorkSteps(probeWorkSteps + lightmapWorkSteps);

if (!ExecuteProbeRequests(in bakeInput, in probeRequestData, deviceContext, useLegacyBakingBehavior, world, bakeInput.lightingSettings.maxBounces, progressState, samplingResources))
if (!ExecuteProbeRequests(in bakeInput, in probeRequestData, deviceContext, useLegacyBakingBehavior, world, bakeInput.lightingSettings.maxBounces, progressState, samplingResources))
return false;

if (lightmapRequestData.requests.Length <= 0)
Expand All @@ -436,7 +436,7 @@ internal static bool Bake(string bakeInputPath, string lightmapRequestsPath, str
LightmapResourceLibrary resources = new();
resources.Load(world.RayTracingContext);

if (ExecuteLightmapRequests(in lightmapRequestData, deviceContext, world, in fatInstances, in lodInstances, in lodgroupToContributorInstances, integrationSettings, useLegacyBakingBehavior, resources, progressState, lightmapDescriptors, lightmapBakeSettings, samplingResources) != Result.Success)
if (ExecuteLightmapRequests(in lightmapRequestData, deviceContext, world, in fatInstances, in lodInstances, in lodgroupToContributorInstances, integrationSettings, useLegacyBakingBehavior, resources, progressState, lightmapDescriptors, lightmapBakeSettings, samplingResources) != Result.Success)
return false;

CoreUtils.Destroy(resources.UVFallbackBufferGenerationMaterial);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ void DrawSummary(Rect summaryRect, SerializedProperty element, int index)
{
SerializedProperty lensFlareDataSRP = element.FindPropertyRelative("lensFlareDataSRP");
fieldRect.MoveNext();
EditorGUI.PropertyField(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP);
DrawLensFlareDataSRPFieldWithCycleDetection(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP);
EditorGUIUtility.labelWidth = oldLabelWidth;
return;
}
Expand Down Expand Up @@ -923,7 +923,7 @@ void DrawTypeCathegory(ref Rect remainingRect, SerializedProperty element)
{
SerializedProperty lensFlareDataSRP = element.FindPropertyRelative("lensFlareDataSRP");
fieldRect.MoveNext();
EditorGUI.PropertyField(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP);
DrawLensFlareDataSRPFieldWithCycleDetection(fieldRect.Current, lensFlareDataSRP, Styles.lensFlareDataSRP);
}
break;
}
Expand Down Expand Up @@ -1252,6 +1252,67 @@ T GetEnum<T>(SerializedProperty property)

void SetEnum<T>(SerializedProperty property, T value)
=> property.intValue = (int)(object)value;

void DrawLensFlareDataSRPFieldWithCycleDetection(Rect rect, SerializedProperty lensFlareDataSRPProperty, GUIContent label)
{
LensFlareDataSRP currentAsset = target as LensFlareDataSRP;

EditorGUI.BeginChangeCheck();
LensFlareDataSRP newValue = EditorGUI.ObjectField(rect, label, lensFlareDataSRPProperty.objectReferenceValue, typeof(LensFlareDataSRP), false) as LensFlareDataSRP;

if (EditorGUI.EndChangeCheck())
{
// Check for cycles before setting the value
bool wouldCreateCycle = false;

if (newValue != null && currentAsset != null)
{
// Direct self-reference check
if (currentAsset == newValue)
{
wouldCreateCycle = true;
}
else
{
// Multi-level cycle check - see if newValue already references currentAsset
HashSet<LensFlareDataSRP> visited = new HashSet<LensFlareDataSRP>();

// Recursive function to check if targetAsset is found in asset's dependency chain
bool CheckCycle(LensFlareDataSRP asset, LensFlareDataSRP targetAsset)
{
if (asset == null || visited.Contains(asset))
return false;

visited.Add(asset);

foreach (var element in asset.elements)
{
if (element.flareType == SRPLensFlareType.LensFlareDataSRP && element.lensFlareDataSRP != null)
{
if (element.lensFlareDataSRP == targetAsset || CheckCycle(element.lensFlareDataSRP, targetAsset))
return true;
}
}
return false;
}

wouldCreateCycle = CheckCycle(newValue, currentAsset);
}
}

if (wouldCreateCycle)
{
// Cycle detected - set to null and show a warning
lensFlareDataSRPProperty.objectReferenceValue = null;
Debug.LogWarning($"Cannot assign lens flare asset '{newValue.name}' because it would create a cyclic dependency. Setting to null to prevent infinite loop.");
}
else
{
lensFlareDataSRPProperty.objectReferenceValue = newValue;
}
}
}

#endregion
}
}
Loading