Skip to content

Commit 4390ca9

Browse files
authored
Merge pull request #8267 from Unity-Technologies/internal/6000.3/staging
Mirror Internal/6000.3/staging
2 parents 7dea519 + 70d51c3 commit 4390ca9

File tree

79 files changed

+948
-1097
lines changed

Some content is hidden

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

79 files changed

+948
-1097
lines changed

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/DynamicGI/DynamicGISkyOcclusion.urtshader

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
UNIFIED_RT_DECLARE_ACCEL_STRUCT(_AccelStruct);
1313

14-
1514
int _SampleCount;
1615
int _SampleId;
1716
int _MaxBounces;
@@ -34,11 +33,13 @@ void RayGenExecute(UnifiedRT::DispatchInfo dispatchInfo)
3433
QrngSobol rngState;
3534
rngState.Init(uint2((uint)probeId, 0), _SampleId);
3635

37-
if (_SampleId==0)
36+
float4 skyOcclusionEstimate = 0;
37+
float3 skyShadingEstimate = 0;
38+
if (_SampleId != 0)
3839
{
39-
_SkyOcclusionOut[probeId] = float4(0,0,0,0);
40+
skyOcclusionEstimate = _SkyOcclusionOut[probeId];
4041
if (_BakeSkyShadingDirection > 0)
41-
_SkyShadingOut[probeId] = float3(0,0,0);
42+
skyShadingEstimate = _SkyShadingOut[probeId];
4243
}
4344

4445
UnifiedRT::RayTracingAccelStruct accelStruct = UNIFIED_RT_GET_ACCEL_STRUCT(_AccelStruct);
@@ -107,47 +108,50 @@ void RayGenExecute(UnifiedRT::DispatchInfo dispatchInfo)
107108
rayFirstDirection.y * norm * kSHBasis1,
108109
rayFirstDirection.z * norm * kSHBasis1);
109110

110-
_SkyOcclusionOut[probeId] += tempSH;
111+
skyOcclusionEstimate += tempSH;
112+
111113
if(_BakeSkyShadingDirection > 0)
112-
_SkyShadingOut[probeId] += ray.direction / _SampleCount;
114+
skyShadingEstimate += ray.direction / _SampleCount;
113115

114-
// break the loop;
115-
bounceIndex = _MaxBounces + 2;
116+
break;
116117
}
117118
}
118119

119120
// Last sample
120121
if (_SampleId == _SampleCount - 1)
121122
{
122123
// Window L1 coefficients to make sure no value is negative when sampling SH, layout is DC, x, y, z
123-
float4 SHData = _SkyOcclusionOut[probeId];
124124
// find main direction for light
125125
float3 mainDir;
126-
mainDir.x = SHData.y;
127-
mainDir.y = SHData.z;
128-
mainDir.z = SHData.w;
126+
mainDir.x = skyOcclusionEstimate.y;
127+
mainDir.y = skyOcclusionEstimate.z;
128+
mainDir.z = skyOcclusionEstimate.w;
129129
mainDir = normalize(mainDir);
130130

131131
// find the value in the opposite direction, which is the lowest value in the SH
132132
float4 temp2 = float4(kSHBasis0, kSHBasis1 * -mainDir.x, kSHBasis1 * -mainDir.y, kSHBasis1 * -mainDir.z);
133-
float value = dot(temp2, SHData);
133+
float value = dot(temp2, skyOcclusionEstimate);
134134
float windowL1 = 1.0f;
135135

136136
if (value < 0.0f)
137137
{
138138
// find the L1 factor for this value to be null instead of negative
139-
windowL1 = -(temp2.x * SHData.x) / dot(temp2.yzw, SHData.yzw);
139+
windowL1 = -(temp2.x * skyOcclusionEstimate.x) / dot(temp2.yzw, skyOcclusionEstimate.yzw);
140140
windowL1 = saturate(windowL1);
141141
}
142142

143-
_SkyOcclusionOut[probeId].yzw *= windowL1;
143+
skyOcclusionEstimate.yzw *= windowL1;
144144

145145
float radianceToIrradianceFactor = 2.0f / 3.0f;
146146
// This is a hacky solution for mitigating the radianceToIrradianceFactor based on the previous windowing operation.
147147
// The 1.125f exponent comes from experimental testing. It's the value that works the best when trying to match a bake and deringing done with the lightmapper, but it has no theoretical explanation.
148148
// In the future, we should replace these custom windowing and deringing operations with the ones used in the lightmapper to implement a more academical solution.
149-
_SkyOcclusionOut[probeId].yzw *= lerp(1.0f, radianceToIrradianceFactor, pow(windowL1, 1.125f));
149+
skyOcclusionEstimate.yzw *= lerp(1.0f, radianceToIrradianceFactor, pow(windowL1, 1.125f));
150150
}
151+
152+
_SkyOcclusionOut[probeId] = skyOcclusionEstimate;
153+
if(_BakeSkyShadingDirection > 0)
154+
_SkyShadingOut[probeId] = skyShadingEstimate;
151155
}
152156

153157
#ifdef UNIFIED_RT_BACKEND_COMPUTE

Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,7 @@ struct APVResources
7777

7878
struct APVResourcesRW
7979
{
80-
#ifdef SHADER_API_METAL
81-
// We need to use float4 on Metal, since HLSLcc will generate invalid MSL otherwise.
82-
// See https://jira.unity3d.com/browse/UUM-127198
83-
RWTexture3D<float4> L0_L1Rx;
84-
#else
8580
RWTexture3D<half4> L0_L1Rx;
86-
#endif
8781
RWTexture3D<unorm float4> L1G_L1Ry;
8882
RWTexture3D<unorm float4> L1B_L1Rz;
8983
RWTexture3D<unorm float4> L2_0;

Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBlendStates.compute

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@ Texture3D<float4> _State1_L0_L1Rx;
1515
Texture3D<float4> _State1_L1G_L1Ry;
1616
Texture3D<float4> _State1_L1B_L1Rz;
1717

18-
#ifdef SHADER_API_METAL
19-
// We need to use float4 on Metal, since HLSLcc will generate invalid MSL otherwise.
20-
// See https://jira.unity3d.com/browse/UUM-127198
21-
RWTexture3D<float4> _Out_L0_L1Rx;
22-
#else
2318
RWTexture3D<half4> _Out_L0_L1Rx;
24-
#endif
2519
RWTexture3D<unorm float4> _Out_L1G_L1Ry;
2620
RWTexture3D<unorm float4> _Out_L1B_L1Rz;
2721

Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeUploadData.compute

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@
99
#pragma multi_compile_local _ PROBE_VOLUMES_SKY_SHADING_DIRECTION
1010
#pragma multi_compile_local _ PROBE_VOLUMES_PROBE_OCCLUSION
1111

12-
#ifdef SHADER_API_METAL
13-
// We need to use float4 on Metal, since HLSLcc will generate invalid MSL otherwise.
14-
// See https://jira.unity3d.com/browse/UUM-127198
15-
RWTexture3D<float4> _Out_L0_L1Rx;
16-
#else
1712
RWTexture3D<half4> _Out_L0_L1Rx;
18-
#endif
1913
RWTexture3D<unorm float4> _Out_L1G_L1Ry;
2014
RWTexture3D<unorm float4> _Out_L1B_L1Rz;
2115

Packages/com.unity.render-pipelines.high-definition/Documentation~/getting-started-in-hdrp.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ Set up a project to use the High Definition Render Pipeline (HDRP), and use Volu
1010
## Additional resources
1111

1212
- [HDRP overview](HDRP-Features.md)
13-
- [Achieving High Fidelity Graphics for Games with HDRP](https://resources.unity.com/unitenow/onlinesessions/achieving-high-fidelity-graphics-for-games-with-hdrp)

Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ internal static class Styles
5555
public static readonly GUIContent lightProbeSystemContent = EditorGUIUtility.TrTextContent("Light Probe System", "What system to use for Light Probes.");
5656
public static readonly GUIContent probeVolumeMemoryBudget = EditorGUIUtility.TrTextContent("Memory Budget", "Determines the width and height of the 3D textures used to store lighting data from probes. Depth is fixed.");
5757
public static readonly GUIContent probeVolumeBlendingMemoryBudget = EditorGUIUtility.TrTextContent("Blending Memory Budget", "Determines the width and height of the 3D textures used to store light scenario blending data from probes. Depth is fixed.");
58-
public static readonly GUIContent supportProbeVolumeGPUStreaming = EditorGUIUtility.TrTextContent("Enable GPU Streaming", "Enable steaming of Cells for Adaptive Probe Volumes.");
59-
public static readonly GUIContent supportProbeVolumeDiskStreaming = EditorGUIUtility.TrTextContent("Enable Disk Streaming", "Enable steaming of Cells from disk for Adaptive Probe Volumes.");
58+
public static readonly GUIContent supportProbeVolumeGPUStreaming = EditorGUIUtility.TrTextContent("Enable GPU Streaming", "Enable streaming of Cells for Adaptive Probe Volumes.");
59+
public static readonly GUIContent supportProbeVolumeDiskStreaming = EditorGUIUtility.TrTextContent("Enable Disk Streaming", "Enable streaming of Cells from disk for Adaptive Probe Volumes.");
6060
public static readonly GUIContent supportProbeVolumeScenarios = EditorGUIUtility.TrTextContent("Enable Lighting Scenarios", "Enable Lighting Scenario Baking for Adaptive Probe Volumes.");
6161
public static readonly GUIContent supportProbeVolumeScenarioBlending = EditorGUIUtility.TrTextContent("Enable Lighting Scenario Blending", "Enable Lighting Scenario Blending for Adaptive Probe Volumes.\nNote: Lighting Scenario Blending requires Compute Shader support.");
6262
public static readonly GUIContent probeVolumeSHBands = EditorGUIUtility.TrTextContent("SH Bands", "The number of Spherical Harmonic bands used by Adaptive Probe Volumes to store lighting data. Choosing L2 provides better quality but with higher memory and runtime costs.");

Packages/com.unity.render-pipelines.universal/Runtime/Data/PostProcessData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public sealed class TextureResources : IRenderPipelineResources
233233
/// <summary>
234234
/// Pre-baked Blue noise textures.
235235
/// </summary>
236-
// [ResourceFormattedPaths("Textures/BlueNoise16/L/LDR_LLL1_{0}.png", 0, 32)]
236+
[ResourceFormattedPaths("Textures/BlueNoise16/L/LDR_LLL1_{0}.png", 0, 32)]
237237
public Texture2D[] blueNoise16LTex;
238238

239239
/// <summary>

Packages/com.unity.render-pipelines.universal/Runtime/Settings/URPReflectionProbeSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class URPReflectionProbeSettings : IRenderPipelineGraphicsSettings
1818
[SerializeField, HideInInspector] private int version = 1;
1919

2020
int IRenderPipelineGraphicsSettings.version => version;
21+
bool IRenderPipelineGraphicsSettings.isAvailableInPlayerBuild => true;
2122

2223
[SerializeField, Tooltip("Use ReflectionProbe rotation. Enabling this will improve the appearance of reflections when the ReflectionProbe isn't axis aligned, but may worsen performance on lower end platforms.")]
2324
private bool useReflectionProbeRotation = true;

Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderVariablesFunctions.hlsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ uint Select4(uint4 v, uint i)
591591
(((v.y & mask0) | (v.x & ~mask0)) & ~mask1);
592592
}
593593

594-
#if SHADER_TARGET < 45
594+
#if SHADER_TARGET < 45 && !defined UNITY_COMPILER_DXC
595+
// Workaround is only technically required for GL Core <4.0 and GLES <3.1
595596
uint URP_FirstBitLow(uint m)
596597
{
597598
// http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightFloatCast

Packages/com.unity.shadergraph/Documentation~/Blackboard.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Description
44
You can use the Blackboard to define, order, and categorize the [Properties](Property-Types.md) and [Keywords](Keywords.md) in a graph. From the Blackboard, you can also edit the path for the selected Shader Graph Asset or Sub Graph.
55

6-
![image](images/blackboardcategories1.png)
6+
![The blackboard layout with properties, keywords, and categories.](images/blackboardcategories1.png)
77

88
## Accessing the Blackboard
99
The Blackboard is visible by default, and you cannot drag it off the graph and lose it. However, you are able to position it anywhere in the [Shader Graph Window](Shader-Graph-Window.md). It always maintains the same distance from the nearest corner, even if you resize the window.
@@ -42,8 +42,6 @@ To make the properties in your shader more discoverable, organize them into cate
4242
### Adding, removing, and reordering properties and keywords
4343
* To add a property or keyword to a category, expand the category with the foldout (⌄) symbol, then drag and drop the property or keyword onto the expanded category.
4444

45-
![image](images/blackboardcategories2.png)
46-
4745
* To remove a property or keyword, select it and press **Delete**, or right-click and select **Delete**.
4846
* To re-order properties or keywords, drag and drop them within a category or move them into other categories.
4947

@@ -66,9 +64,6 @@ To copy a specific set of properties:
6664
### Using categories in the Material Inspector
6765
To modify a material you have created with a Shader Graph, you can adjust specific property or keyword values in the Material Inspector, or edit the graph itself.
6866

69-
![image](images/blackboardcategories3.png)
70-
71-
7267
#### Working with Streaming Virtual Textures
7368
[Streaming Virtual Texture Properties](https://docs.unity3d.com/Documentation/Manual/svt-use-in-shader-graph.html) sample texture layers. To access these layers in the Material Inspector, expand the relevant **Virtual Texture** section with the ⌄ symbol next to its name. You can add and remove layers via the Inspector.
7469

0 commit comments

Comments
 (0)