Skip to content

Commit 4e35bef

Browse files
Internal/6000.0/staging
Internal/6000.0/staging
2 parents 4063d2d + a727be6 commit 4e35bef

File tree

1,541 files changed

+223220
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,541 files changed

+223220
-112
lines changed

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.Placement.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static ProbeSubdivisionResult GetWorldSubdivision(ref bool canceledByUser)
164164
return GetBricksFromLoaded();
165165

166166
var ctx = PrepareProbeSubdivisionContext();
167-
return BakeBricks(ctx, m_BakingBatch.contributors, ref canceledByUser);
167+
return BakeBricks(ctx, m_BakingBatch.contributors, showProgress: true, ref canceledByUser);
168168
}
169169

170170
static NativeList<Vector3> ApplySubdivisionResults(ProbeSubdivisionResult results, ref bool canceledByUser)
@@ -303,7 +303,7 @@ static internal ProbeSubdivisionContext PrepareProbeSubdivisionContext(bool live
303303
return ctx;
304304
}
305305

306-
static internal ProbeSubdivisionResult BakeBricks(ProbeSubdivisionContext ctx, in GIContributors contributors, ref bool canceledByUser)
306+
static internal ProbeSubdivisionResult BakeBricks(ProbeSubdivisionContext ctx, in GIContributors contributors, bool showProgress, ref bool canceledByUser)
307307
{
308308
var result = new ProbeSubdivisionResult();
309309

@@ -318,7 +318,7 @@ static internal ProbeSubdivisionResult BakeBricks(ProbeSubdivisionContext ctx, i
318318
// subdivide all the cells and generate brick positions
319319
foreach (var cell in ctx.cells)
320320
{
321-
if (cellIdx++ % freq == 0) // Don't refresh progress bar at every iteration because it's slow
321+
if (showProgress && cellIdx++ % freq == 0) // Don't refresh progress bar at every iteration because it's slow
322322
{
323323
if (EditorUtility.DisplayCancelableProgressBar("Generating Probe Volume Bricks", $"Processing cell {cellIdx} out of {ctx.cells.Count}", Mathf.Lerp(progress0, progress1, cellIdx / (float)ctx.cells.Count)))
324324
{

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeSubdivisionContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static void UpdateRealtimeSubdivisionDebug()
5353
if (s_CurrentSubdivision == null)
5454
{
5555
// Start a new Subdivision
56-
s_CurrentSubdivision = Subdivide();
56+
s_CurrentSubdivision = Subdivide(showProgress: false);
5757
}
5858

5959
// Step the subdivision with the amount of cell per frame in debug menu
@@ -71,7 +71,7 @@ static void UpdateRealtimeSubdivisionDebug()
7171
}
7272
}
7373

74-
IEnumerator Subdivide()
74+
IEnumerator Subdivide(bool showProgress)
7575
{
7676
var ctx = AdaptiveProbeVolumes.PrepareProbeSubdivisionContext(true);
7777
var contributors = GIContributors.Find(GIContributors.ContributorFilter.All);
@@ -115,7 +115,7 @@ IEnumerator Subdivide()
115115
ctx.cells.Add(cell);
116116

117117
bool canceledByUser = false;
118-
var result = AdaptiveProbeVolumes.BakeBricks(ctx, contributors, ref canceledByUser);
118+
var result = AdaptiveProbeVolumes.BakeBricks(ctx, contributors, showProgress, ref canceledByUser);
119119

120120
if (result.cells.Count != 0)
121121
ProbeReferenceVolume.instance.realtimeSubdivisionInfo[cell.bounds] = result.cells[0].bricks;

Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareComponentSRP.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace UnityEngine.Rendering
1313
/// </summary>
1414
[ExecuteAlways]
1515
[AddComponentMenu("Rendering/Lens Flare (SRP)")]
16+
[CurrentPipelineHelpURL("shared/lens-flare/lens-flare-component")]
1617
public sealed class LensFlareComponentSRP : MonoBehaviour
1718
{
1819
[SerializeField]

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/PassesData.cs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using UnityEngine.Rendering;
66
using System.Collections.Generic;
77
using Unity.Collections;
8+
using UnityEngine.Experimental.Rendering;
89

910
namespace UnityEngine.Rendering.RenderGraphModule.NativeRenderPassCompiler
1011
{
@@ -665,7 +666,7 @@ public static PassBreakAudit CanMerge(CompilerContextData contextData, int activ
665666
return new PassBreakAudit(PassBreakReason.NonRasterPass, passIdToMerge);
666667
}
667668

668-
ref readonly var nativePass = ref contextData.nativePassData.ElementAt(activeNativePassId);
669+
ref var nativePass = ref contextData.nativePassData.ElementAt(activeNativePassId);
669670

670671
// If a pass has no fragment attachments a lot of the tests can be skipped
671672
// You could argue that a raster pass with no fragments is not allowed but why not?
@@ -805,6 +806,12 @@ public static PassBreakAudit CanMerge(CompilerContextData contextData, int activ
805806
}
806807
}
807808

809+
// Determines if the pixel storage limit is reached after adding the new 'pass to merge' attachments to the current native render pass.
810+
if (TotalAttachmentsSizeExceedPixelStorageLimit(contextData, ref nativePass, ref attachmentsToTryAdding))
811+
{
812+
return new PassBreakAudit(PassBreakReason.AttachmentLimitReached, passIdToMerge);
813+
}
814+
808815
bool canMergeNativeSubPass = CanMergeNativeSubPass(contextData, nativePass, passToMerge);
809816
if (!canMergeNativeSubPass && nativePass.numGraphPasses + 1 > NativePassCompiler.k_MaxSubpass)
810817
{
@@ -815,6 +822,34 @@ public static PassBreakAudit CanMerge(CompilerContextData contextData, int activ
815822
return new PassBreakAudit(PassBreakReason.Merged, passIdToMerge);
816823
}
817824

825+
static bool TotalAttachmentsSizeExceedPixelStorageLimit(CompilerContextData contextData, ref NativePassData nativePass, ref FixedAttachmentArray<PassFragmentData> attachmentsToTryAdding)
826+
{
827+
// TODO: We are currently only checking for iOS GPU Family 1 to 3 since the storage size is much more restricted (16 bytes for Family 1 and 32 for Family 2 & 3).
828+
// This is temporary. Later on, we should check all iOS GPU Families but also Android (Vulkan) to avoid the same potential restrictions.
829+
if (Application.platform == RuntimePlatform.IPhonePlayer && SystemInfo.maxTiledPixelStorageSize <= 32)
830+
{
831+
int totalSize = 0;
832+
833+
// Iterate over current attachments
834+
for (int i = 0; i < nativePass.fragments.size; ++i)
835+
{
836+
ref readonly var unvResource = ref contextData.UnversionedResourceData(nativePass.fragments[i].resource);
837+
totalSize += SystemInfo.GetTiledRenderTargetStorageSize(unvResource.graphicsFormat, unvResource.msaaSamples);
838+
}
839+
840+
// Iterate over new attachments to add
841+
for (int i = 0; i < attachmentsToTryAdding.size; ++i)
842+
{
843+
ref readonly var unvResource = ref contextData.UnversionedResourceData(attachmentsToTryAdding[i].resource);
844+
totalSize += SystemInfo.GetTiledRenderTargetStorageSize(unvResource.graphicsFormat, unvResource.msaaSamples);
845+
}
846+
847+
return totalSize > SystemInfo.maxTiledPixelStorageSize;
848+
}
849+
850+
return false;
851+
}
852+
818853
// This function follows the structure of TryMergeNativeSubPass but only tests if the new native subpass can be
819854
// merged with the last one, allowing for early returns. It does not modify the state
820855
static bool CanMergeNativeSubPass(CompilerContextData contextData, NativePassData nativePass, PassData passToMerge)

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/Compiler/ResourcesData.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Runtime.CompilerServices;
33
using Unity.Collections;
44
using UnityEngine.Rendering;
5+
using UnityEngine.Experimental.Rendering;
56

67
namespace UnityEngine.Rendering.RenderGraphModule.NativeRenderPassCompiler
78
{
@@ -29,6 +30,7 @@ internal struct ResourceUnversionedData
2930
public readonly int height;
3031
public readonly int volumeDepth;
3132
public readonly int msaaSamples;
33+
public readonly GraphicsFormat graphicsFormat;
3234

3335
public int latestVersionNumber; // mostly readonly, can be decremented only if all passes using the last version are culled
3436

@@ -59,6 +61,7 @@ public ResourceUnversionedData(IRenderGraphResource rll, ref RenderTargetInfo in
5961
clear = desc.clearBuffer;
6062
discard = desc.discardBuffer;
6163
bindMS = info.bindMS;
64+
graphicsFormat = desc.format;
6265
}
6366

6467
public ResourceUnversionedData(IRenderGraphResource rll, ref BufferDesc _, bool isResourceShared)
@@ -83,6 +86,7 @@ public ResourceUnversionedData(IRenderGraphResource rll, ref BufferDesc _, bool
8386
clear = false;
8487
discard = false;
8588
bindMS = false;
89+
graphicsFormat = GraphicsFormat.None;
8690
}
8791

8892
public ResourceUnversionedData(IRenderGraphResource rll, ref RayTracingAccelerationStructureDesc _, bool isResourceShared)
@@ -107,6 +111,7 @@ public ResourceUnversionedData(IRenderGraphResource rll, ref RayTracingAccelerat
107111
clear = false;
108112
discard = false;
109113
bindMS = false;
114+
graphicsFormat = GraphicsFormat.None;
110115
}
111116

112117
public void InitializeNullResource()

Packages/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@
437437
* [StackLit Master Stack reference](stacklit-master-stack-reference.md)
438438
* [Canvas Master Stack reference](canvas-master-stack-reference.md)
439439
* [Fog Volume Master Stack reference](fog-volume-master-stack-reference.md)
440+
* [Six Way Master Stack reference](six-way-master-stack-reference.md)
440441
* [Water Master Stack reference](master-stack-water.md)
441442
* [Environmental effects reference](reference-environmental-effects.md)
442443
* [Sky reference](reference-sky.md)

Packages/com.unity.render-pipelines.high-definition/Documentation~/lightmapping-improve-visual-fidelity.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ To use bicubic sampling in your project, enable the **Use Bicubic Lightmap Sampl
2020

2121
## Fix texture bleeding
2222

23-
Bicubic sampling can cause texture bleeding, where Unity samples unintended texels from neighboring regions of a texture, leading to visual artifacts. To prevent texture bleeding, there needs to be enough padding between [lightmap UV charts](https://docs.unity3d.com/Manual/LightingGiUvs-landing.html). To fully remove texture bleeding artifacts, set the number of texels between each UV chart to at least 2 for bilinear filtering and at least 4 for bicubic filtering.
23+
Bicubic sampling can cause texture bleeding, where Unity samples unintended texels from neighboring regions of a texture, leading to visual artifacts. To prevent texture bleeding, there needs to be enough margin between [lightmap UV charts](LightingGiUvs-landing). To fully remove texture bleeding artifacts, set the number of texels between each UV chart to at least 2 for bilinear filtering and at least 4 for bicubic filtering.
2424

25-
To change the padding in or between charts, refer to [Fix light bleeding in lightmaps](https://docs.unity3d.com/Manual/ProgressiveLightmapper-UVOverlap.html).
25+
To change the margin between charts, refer to [Fix light bleeding in lightmaps](ProgressiveLightmapper-UVOverlap).
2626

2727
## Additional resources
2828

29-
* [Introduction to lightmaps and baking](https://docs.unity3d.com/Manual/Lightmappers.html)
30-
* [Configuring lightmaps and baking](https://docs.unity3d.com/Manual/Lightmapping-configure.html)
31-
* [Optimize baking](https://docs.unity3d.com/Manual/GPUProgressiveLightmapper.html)
32-
* [Introduction to lightmap UVs](https://docs.unity3d.com/Manual/LightingGiUvs.html)
29+
* [Introduction to lightmaps and baking](Lightmappers)
30+
* [Configuring lightmaps and baking](Lightmapping-configure)
31+
* [Optimize baking](GPUProgressiveLightmapper)
32+
* [Introduction to lightmap UVs](LightingGiUvs)

Packages/com.unity.render-pipelines.high-definition/Documentation~/shader-graph-materials-reference.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Learn about the properties and behavior of HDRP Shader Graph contexts and master
1616
|[StackLit Master Stack reference](stacklit-master-stack-reference.md)|Properties and options in the StackLit master stack.|
1717
|[Canvas Master Stack reference](canvas-master-stack-reference.md)|Properties and options in the Canvas master stack.|
1818
|[Fog Volume Master Stack reference](fog-volume-master-stack-reference.md)|Properties and options in the Fog Volume master stack.|
19+
|[Six Way Master Stack reference](six-way-master-stack-reference.md)|Properties and options in the Six Way master stack.|
1920

2021
## Additional resources
2122

22-
- [Shader graph](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest?subfolder=/manual/index.html)
23+
- [Shader graph](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest?subfolder=/manual/index.html)

0 commit comments

Comments
 (0)