Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
fdce9f3
[Port] [6000.3] [2d] Fix (Case UUM-116057) Fix Assertion error when v…
svc-reach-platform-support Oct 21, 2025
e1cac3a
[Port] [6000.3] Graphics/SRP/RPF - [UUM-119778] Async compute fixes i…
svc-reach-platform-support Oct 22, 2025
e163216
[Port] [6000.3] UUM-84218: Baked shadows do not appear in the Player …
svc-reach-platform-support Oct 22, 2025
0e8725c
[Port] [6000.3] Don't throw exception when trying to bake APV for sce…
svc-reach-platform-support Oct 22, 2025
7716418
[Port] [6000.3] [VFX] Test if data is compatible when propagating
svc-reach-platform-support Oct 22, 2025
b8b0260
[Port] [6000.3] [VFX] Limit Visual Effect asset prewarm step count
svc-reach-platform-support Oct 22, 2025
97b9707
[Port] [6000.3] [VFX] Fix Space Inspector with ShaderGraph Output
svc-reach-platform-support Oct 23, 2025
6856b09
6000.3/bugfix/uum 107028
SebastienLa Oct 23, 2025
ee2b215
[Port] [6000.3] [VFX] Fix Opening Twice with Subgraph
svc-reach-platform-support Oct 23, 2025
871b1e4
[Port] [6000.3] [VFX] Fix Instability Check_Additional_Doesnt_Generat…
svc-reach-platform-support Oct 23, 2025
f1ea698
[Port] [6000.3] Fixed Additional Data missing warning from Debug UI w…
svc-reach-platform-support Oct 23, 2025
a2247d7
[Port] [6000.3] [URP] Adjusted max render scale value from 2.0 to 3.0.
svc-reach-platform-support Oct 23, 2025
687951a
[Port] [6000.3] docg-7965: shader graph asset inspector properties
svc-reach-platform-support Oct 23, 2025
e059d6d
[Port] [6000.3] docg-8045: Harmonize six-way lighting TOC entry and s…
svc-reach-platform-support Oct 23, 2025
39adb13
[Port] [6000.3] Documentation feedback improvements 20 Oct
svc-reach-platform-support Oct 23, 2025
ddece64
[Port] [6000.3] [UUM-121472][6000.4][URP 2D] Fix mesh and sprite norm…
svc-reach-platform-support Oct 23, 2025
00b0bec
[Port] [6000.3] [UUM-116762][UUM-116667][6000.4] Fix Custom Render Te…
svc-reach-platform-support Oct 23, 2025
3d28467
Made ProbeVolumeBakingSet.SyncBakingSets() run on-demand [COPT-3619] …
John-Whigham Oct 23, 2025
0c9f635
[Port] [6000.3] Streamline the Shader Graph's Get started instruction…
sebastienduverne Oct 23, 2025
aee3a37
[Port 6000.3] Provide depth texture when doing CopyDepthPass on Direc…
Oct 23, 2025
273913f
[Port] [6000.3] Add correct docs link for ProbeVolumeBakingSet
svc-reach-platform-support Oct 23, 2025
5f8d673
[Port] [6000.3] [VFX] Expandable properties can now be expanded/colla…
svc-reach-platform-support Oct 23, 2025
2e5424c
[Port] [6000.3] [VFX] Set the VFXParameter help url
svc-reach-platform-support Oct 23, 2025
7260ffc
[Port] [6000.3] Update area light color when intensity is changed via…
svc-reach-platform-support Oct 23, 2025
d05fe6e
[Port 6000.3] URP Fix partial prepass in deferred - should not be dep…
UnityAljosha Oct 24, 2025
a6daeca
[Port] [6000.3] URP Fix ZWrite in Forward Pass
svc-reach-platform-support Oct 24, 2025
21b1c39
6000.3 backport - Code cleanup - Move backbuffer/y-flip logic over to…
robinb-u3d Oct 24, 2025
6af04d0
[Port] [6000.3] [VFX] Preview too bright in HDRP
svc-reach-platform-support Oct 24, 2025
4d497d4
[Port] [6000.3] [URP] Logged HDR Output events when changing to a RP …
svc-reach-platform-support Oct 24, 2025
60a27d0
[Port] [6000.3] fix: Fix null reference exception in ShadowMesh2D and…
svc-reach-platform-support Oct 24, 2025
47c9ffd
[Port] [6000.3] Update UX and docs for advanced properties to show th…
svc-reach-platform-support Oct 25, 2025
20597c4
[Port] [6000.3] [VFX] Fix Install Learning Template
PaulDemeulenaere Oct 25, 2025
e3c8b54
[Port] [6000.3] [VFX] Some links were not disconnected when an incomp…
svc-reach-platform-support Oct 27, 2025
15a323c
[Backport 6000.3] Fix XBox performance issue with UIToolkit shader.
ncerone-unity Oct 27, 2025
f8effdd
[Port] [6000.3] [VFX] Exposed property value not properly restored wi…
svc-reach-platform-support Oct 28, 2025
e256035
[Backport] Avoid heap allocations when drawing APV gizmos (UUM-121201)
urasmus Oct 28, 2025
a9f1d7c
[Port] [6000.3] DOCG-7982 Move and restructure metallic, specular, an…
svc-reach-platform-support Oct 28, 2025
1499ced
[Port] [6000.3] [VFX] Allow Template Icons having a light/dark skin
svc-reach-platform-support Oct 28, 2025
d746721
[Port] [6000.3] Force fixed exposure in the editor while scene view f…
svc-reach-platform-support Oct 29, 2025
4ea3bf8
[Port] [6000.3] UUM-122571: Fix reflection probe keyword warnings
svc-reach-platform-support Oct 29, 2025
cc97cb3
[Port] [6000.3] DOCG-7803: Add references for Custom interpolator ver…
svc-reach-platform-support Oct 29, 2025
79d82d8
[Port] [6000.3] [VFX] Prevent multiple outputs in a same graph to hav…
svc-reach-platform-support Oct 30, 2025
a4e89a4
[Port] [6000.3] [UUM-119276] Fixed sky contribution missing in fog wh…
svc-reach-platform-support Oct 30, 2025
6a770e8
[Port] [6000.3] Clustering no longer uses probes with null texture
svc-reach-platform-support Oct 30, 2025
aea0a1a
[Port] [6000.3] [HDRP] fix assertion when HDCamera.allowDynamicResolu…
svc-reach-platform-support Oct 30, 2025
2fbb093
[Port] [6000.3] [VFX] Fix errors when undoing moving a property into …
svc-reach-platform-support Oct 30, 2025
2f693ed
[Port] [6000.3] [VFX] Do not delete existing empty groups when grouping
svc-reach-platform-support Oct 30, 2025
ecd3dba
[Port] [6000.3] [VFX] Restore panels visibility when the VFX Graph ed…
svc-reach-platform-support Oct 30, 2025
8e77bdd
[Port] [6000.3] [VFX] Fix global texture binding in VFX
svc-reach-platform-support Oct 30, 2025
9ca47fc
[Port] [6000.3] [VFX] Fix output properties order in CustomHLSL operator
svc-reach-platform-support Oct 30, 2025
adbc017
6000.3 Backport Render as 2d prefab fix
unity-cchu Oct 31, 2025
ada754c
[Port] [6000.3] [VFX][Fix] Prevent warning about pow with potential n…
svc-reach-platform-support Oct 31, 2025
8caaaee
[Port] [6000.3] [VFX] Update VFX Ray tracing docs + filter out settin…
svc-reach-platform-support Oct 31, 2025
8c82b28
[Port] [6000.3][Tests] HDRP Tests: fix DLSS debug view memory allocat…
volkan-unity Oct 31, 2025
5bceaef
[Port] [6000.3] [VFX] Two issues with groups and sticky notes
svc-reach-platform-support Oct 31, 2025
6129cb2
[Port] [6000.3] UUM-112854 : Split GPUOcclusionCulling indirect args …
svc-reach-platform-support Oct 31, 2025
c11891e
[Port] [6000.3] [HDRP] Fix perceptual smoothness in Specular occlusio…
svc-reach-platform-support Oct 31, 2025
6f2c49b
[Port] [6000.3] [VFX] Safe normalize in LookAt operator to prevent NaN
svc-reach-platform-support Nov 1, 2025
e5f123a
[Port] [6000.3] docg-7699: Update Keyword and Property parameter ref …
svc-reach-platform-support Nov 1, 2025
b558b61
[Port] [6000.3] docg-7817: Add 3 new options in Shader Graph preferen…
svc-reach-platform-support Nov 1, 2025
eaf2dd9
[Port] [6000.3] Graphics/SRP/RenderGraph - Various Small Main thread …
svc-reach-platform-support Nov 3, 2025
42213dd
[Port] [6000.3] Fix unassigned rendertarget color & depth in OnRender…
svc-reach-platform-support Nov 4, 2025
1016663
[Port] [6000.3] fix BRG failing test on android samsung s21
svc-reach-platform-support Nov 4, 2025
b1a2ca7
[Port] [6000.3] [Fix] Add HDRPHelpURL to HighQualityLineRenderingVolu…
svc-reach-platform-support Nov 4, 2025
fd0e3b1
[Port] [6000.3] Fix for inconsistant API access to SpriteMaskInteraction
svc-reach-platform-support Nov 4, 2025
be3af07
[Port] [6000.3] Graphics docs feedback tickets
svc-reach-platform-support Nov 4, 2025
603b44c
[Port] [6000.3] UUM-114203: Fixed Performance Regressions
jrs-unity Nov 4, 2025
85eeced
[Port] [6000.3] [VFX] Duplicated property was not properly ordered in…
svc-reach-platform-support Nov 4, 2025
8703000
[Port] [6000.3] [VFX] Fixed wrapping issue and added missing tooltips…
svc-reach-platform-support Nov 4, 2025
93b8f40
[Port] [6000.3] [VFX] Do not close editor when save as under the same…
svc-reach-platform-support Nov 4, 2025
639f90a
[Port] [6000.3] Graphics/SRP/RPF - [UUM-122102] Optimize check for Ne…
svc-reach-platform-support Nov 5, 2025
b715ade
Refactored UI Toolkit URP Gfx Tests
alexandret-unity Nov 5, 2025
d34e476
[Port] [6000.3] DOCG-7704 Clarify Rounded Rectangle node
svc-reach-platform-support Nov 5, 2025
6fbbf43
[Port] [6000.3] [UUM-122631][6000.5][URP 2D] Fix Sprite Skinning for …
kennytann Nov 5, 2025
7fc0f6a
[Port] [6000.3] [VFX] Rename property in blackboard for a template ca…
svc-reach-platform-support Nov 5, 2025
aa63c4a
[Port] [6000.3] [VFX] ColorField get lost after domain reload
svc-reach-platform-support Nov 5, 2025
d626041
[Port] [6000.3] [VFX] Fixed capitalization issue and also white space…
svc-reach-platform-support Nov 5, 2025
575eede
[Port] [6000.3] Update UnityInput.hlsl to remove incorrect comment ab…
svc-reach-platform-support Nov 6, 2025
722b256
[Port] [6000.3] Fix HDRP undo light crash
svc-reach-platform-support Nov 7, 2025
b045bd4
[6000.3] [UITK] Blending fixes for custom shaders and filters
alexandret-unity Nov 7, 2025
4cc7f2f
[Port] [6000.3] Fix thread issue with underline
svc-reach-platform-support Nov 7, 2025
9221ebf
[Port] [6000.3] Fix cyclic asset references in Lens Flares
svc-reach-platform-support Nov 10, 2025
f2fb1f3
[Backport] [6000.3] Backport improvements & Aniso fix.
YohannVaastUnity Nov 10, 2025
7a66e47
[Port] [6000.3] DOCG-7818 + DOCG-7919 Update URP and HDRP Materials f…
svc-reach-platform-support Nov 10, 2025
1dee078
[Port] [6000.3] Update Time Node page
svc-reach-platform-support Nov 11, 2025
ed8d8bd
[Port] [6000.3] Documentation feedback improvements November 2025
svc-reach-platform-support Nov 11, 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 @@ -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 @@ -116,6 +116,9 @@ static AccelStructAdapter BuildAccelerationStructure()
if (mesh == null)
continue;

if (renderer.component is SkinnedMeshRenderer)
continue;

int subMeshCount = mesh.subMeshCount;
var matIndices = new uint[subMeshCount];
Array.Fill(matIndices, renderer.component.renderingLayerMask); // repurpose the material id as we don't need it here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ static AccelStructAdapter BuildAccelerationStructure()
if (!s_TracingContext.TryGetMeshForAccelerationStructure(renderer.component, out var mesh))
continue;

if (renderer.component is SkinnedMeshRenderer)
continue;

int subMeshCount = mesh.subMeshCount;
var matIndices = GetMaterialIndices(renderer.component);
var perSubMeshMask = new uint[subMeshCount];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ static AccelStructAdapter BuildAccelerationStructure(int mask)
if (!s_TracingContext.TryGetMeshForAccelerationStructure(renderer.component, out var mesh))
continue;

if (renderer.component is SkinnedMeshRenderer)
continue;

int subMeshCount = mesh.subMeshCount;
var maskAndMatDummy = new uint[subMeshCount];
System.Array.Fill(maskAndMatDummy, 0xFFFFFFFF);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,21 @@ static void BakeDelegate(ref float progress, ref bool done)
}
}

// Required by native side.
[Scripting.Preserve]
static bool CurrentSceneHasBakedData()
{
if (!ProbeReferenceVolume.instance.isInitialized || !ProbeReferenceVolume.instance.enabledBySRP)
return false;

string sceneGUID = SceneManager.GetActiveScene().GetGUID();
ProbeReferenceVolume.instance.TryGetPerSceneData(sceneGUID, out var sceneData);
if (sceneData == null || sceneData.bakingSet == null)
return false;

return sceneData.bakingSet.HasBeenBaked();
}

static void FinalizeBake(bool cleanup = true)
{
using (new BakingCompleteProfiling(BakingCompleteProfiling.Stages.FinalizingBake))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,24 @@ IEnumerator Subdivide(bool showProgress)
var ctx = AdaptiveProbeVolumes.PrepareProbeSubdivisionContext(perSceneDataList, true);
var contributors = GIContributors.Find(GIContributors.ContributorFilter.All);

var cullCtx = new ProbeVolume.CellCullingContext
{
ActiveCamera = null,
FrustumPlanes = stackalloc Plane[6]
};
ProbeVolume.PrepareCellCulling(ref cullCtx);

var sceneToBakingSetMap = ProbeVolumeBakingSet.SceneToBakingSet.Instance;
var probeRefVol = ProbeReferenceVolume.instance;

// Cull all the cells that are not visible (we don't need them for realtime debug)
ctx.cells.RemoveAll(c =>
for (int i = ctx.cells.Count - 1; i >= 0; i--)
{
return probeVolume.ShouldCullCell(c.position);
});
var cell = ctx.cells[i];
bool shouldRemove = probeVolume.ShouldCullCell(cullCtx, sceneToBakingSetMap, probeRefVol, cell.position);
if (shouldRemove)
ctx.cells.RemoveAt(i);
}

Camera activeCamera = Camera.current ?? SceneView.lastActiveSceneView.camera;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
using System.Collections.Generic;
using UnityEditor;

namespace UnityEngine.Rendering
{
internal static class ProbeVolumeGizmos
{
static MeshGizmo _brickMeshGizmo;
static MeshGizmo _cellMeshGizmo;
static double _lastDrawAt = 0;

static readonly string _gizmoPath = "Packages/com.unity.render-pipelines.core/Editor/Resources/Gizmos";
static readonly string _probeAdjustmentVolumeIconPath = _gizmoPath + "/ProbeTouchupVolume.png";
static readonly string _probeVolumeIconPath = _gizmoPath + "/ProbeVolume.png";

static ProbeVolumeGizmos()
{
EditorApplication.update += Update;
}

static void Update()
{
bool resourcesAllocated = _brickMeshGizmo != null || _cellMeshGizmo != null;

if (resourcesAllocated)
{
bool shouldCleanUp = EditorApplication.timeSinceStartup - _lastDrawAt > 1.0;
if (shouldCleanUp)
{
_brickMeshGizmo?.Dispose();
_brickMeshGizmo = null;
_cellMeshGizmo?.Dispose();
_cellMeshGizmo = null;
}
}
}

[DrawGizmo(GizmoType.Active | GizmoType.Selected | GizmoType.NonSelected)]
static void DrawProbeAdjustmentVolumes(ProbeAdjustmentVolume volume, GizmoType gizmoType)
{
Gizmos.DrawIcon(volume.transform.position, _probeAdjustmentVolumeIconPath, true);
}

[DrawGizmo(GizmoType.Active | GizmoType.Selected | GizmoType.NonSelected)]
static void DrawProbeVolumeGizmos(ProbeVolume volume, GizmoType gizmoType)
{
_lastDrawAt = EditorApplication.timeSinceStartup;

Gizmos.DrawIcon(volume.transform.position, _probeVolumeIconPath, true);

var probeRefVolume = ProbeReferenceVolume.instance;
var sceneToBakingSetMap = ProbeVolumeBakingSet.SceneToBakingSet.Instance;
var allVolumes = ProbeVolume.instances;

if (!probeRefVolume.isInitialized || allVolumes.Count == 0)
return;

// Only the first PV of the available ones will draw gizmos.
if (allVolumes[0] != volume)
return;

var debugDisplay = probeRefVolume.probeVolumeDebug;

float minBrickSize = probeRefVolume.MinBrickSize();
var cellSizeInMeters = probeRefVolume.MaxBrickSize();
var probeOffset = probeRefVolume.ProbeOffset() + ProbeVolumeDebug.currentOffset;
if (debugDisplay.realtimeSubdivision)
{
var bakingSet = ProbeVolumeBakingSet.GetBakingSetForScene(volume.gameObject.scene);
if (bakingSet == null)
return;

// Overwrite settings with data from profile
minBrickSize = ProbeVolumeBakingSet.GetMinBrickSize(bakingSet.minDistanceBetweenProbes);
cellSizeInMeters = ProbeVolumeBakingSet.GetCellSizeInBricks(bakingSet.simplificationLevels) * minBrickSize;
probeOffset = bakingSet.probeOffset;
}

if (debugDisplay.drawBricks)
{
var subDivColors = probeRefVolume.subdivisionDebugColors;

if (_brickMeshGizmo == null)
_brickMeshGizmo = new MeshGizmo((int)(Mathf.Pow(3, ProbeBrickIndex.kMaxSubdivisionLevels) * MeshGizmo.vertexCountPerCube));
_brickMeshGizmo.Clear();

if (debugDisplay.realtimeSubdivision)
{
// realtime subdiv cells are already culled
foreach (var kp in probeRefVolume.realtimeSubdivisionInfo)
{
var cellVolume = kp.Key;

foreach (var brick in kp.Value)
DrawAndAddBrick(_brickMeshGizmo, brick, minBrickSize, probeOffset, subDivColors);
}
}
else
{
var cullCtx = new ProbeVolume.CellCullingContext
{
ActiveCamera = null,
FrustumPlanes = stackalloc Plane[6]
};
ProbeVolume.PrepareCellCulling(ref cullCtx);

foreach (var cell in probeRefVolume.cells.Values)
{
if (!cell.loaded)
continue;

if (volume.ShouldCullCell(cullCtx, sceneToBakingSetMap, probeRefVolume, cell.desc.position))
continue;

if (cell.data.bricks == null)
continue;

foreach (var brick in cell.data.bricks)
DrawAndAddBrick(_brickMeshGizmo, brick, minBrickSize, probeOffset, subDivColors);
}
}

_brickMeshGizmo.RenderWireframe(Matrix4x4.identity, gizmoName: "Brick Gizmo Rendering");
}

if (debugDisplay.drawCells)
{
Color s_LoadedColor = new Color(0, 1, 0.5f, 0.2f);
Color s_UnloadedColor = new Color(1, 0.0f, 0.0f, 0.2f);
Color s_StreamingColor = new Color(0.0f, 0.0f, 1.0f, 0.2f);
Color s_LowScoreColor = new Color(0, 0, 0, 0.2f);
Color s_HighScoreColor = new Color(1, 1, 0, 0.2f);

var oldGizmoMatrix = Gizmos.matrix;
Gizmos.matrix = Matrix4x4.identity;

if (_cellMeshGizmo == null)
_cellMeshGizmo = new MeshGizmo();
_cellMeshGizmo.Clear();

float minStreamingScore = probeRefVolume.minStreamingScore;
float streamingScoreRange = probeRefVolume.maxStreamingScore - probeRefVolume.minStreamingScore;

if (debugDisplay.realtimeSubdivision)
{
foreach (var kp in probeRefVolume.realtimeSubdivisionInfo)
{
DrawAndAddCell(_cellMeshGizmo, kp.Key.center, s_LoadedColor, cellSizeInMeters);
}
}
else
{
var cullCtx = new ProbeVolume.CellCullingContext
{
ActiveCamera = null,
FrustumPlanes = stackalloc Plane[6]
};
ProbeVolume.PrepareCellCulling(ref cullCtx);

foreach (var cell in probeRefVolume.cells.Values)
{
if (volume.ShouldCullCell(cullCtx, sceneToBakingSetMap, probeRefVolume, cell.desc.position))
continue;

Color color;
if (debugDisplay.displayCellStreamingScore)
{
float lerpFactor = (cell.streamingInfo.streamingScore - minStreamingScore) / streamingScoreRange;
color = Color.Lerp(s_HighScoreColor, s_LowScoreColor, lerpFactor);
}
else
{
if (cell.streamingInfo.IsStreaming())
color = s_StreamingColor;
else
color = cell.loaded ? s_LoadedColor : s_UnloadedColor;
}

var positionF = new Vector4(cell.desc.position.x, cell.desc.position.y, cell.desc.position.z, 0.0f);
var center = (Vector4)probeOffset + positionF * cellSizeInMeters + cellSizeInMeters * 0.5f * Vector4.one;
DrawAndAddCell(_cellMeshGizmo, center, color, cellSizeInMeters);
}
}

_cellMeshGizmo.RenderWireframe(Gizmos.matrix, gizmoName: "Brick Gizmo Rendering");
Gizmos.matrix = oldGizmoMatrix;
}
}

static void DrawAndAddCell(MeshGizmo meshGizmo, Vector4 center, Color color, float cellSizeInMeters)
{
Gizmos.color = color;
Gizmos.DrawCube(center, Vector3.one * cellSizeInMeters);
var wireColor = color;
wireColor.a = 1.0f;
meshGizmo.AddWireCube(center, Vector3.one * cellSizeInMeters, wireColor);
}

static void DrawAndAddBrick(MeshGizmo meshGizmo, ProbeBrickIndex.Brick brick, float minBrickSize, Vector3 probeOffset, Color[] subDivColors)
{
if (brick.subdivisionLevel < 0)
return;

float brickSize = minBrickSize * ProbeReferenceVolume.CellSize(brick.subdivisionLevel);
Vector3 scaledSize = new Vector3(brickSize, brickSize, brickSize);
Vector3 scaledPos = probeOffset + new Vector3(brick.position.x * minBrickSize, brick.position.y * minBrickSize, brick.position.z * minBrickSize) + scaledSize / 2;
meshGizmo.AddWireCube(scaledPos, scaledSize, subDivColors[brick.subdivisionLevel]);
}
}
}

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

Loading