Skip to content

Commit 6287617

Browse files
2 parents 0972839 + 653bb2d commit 6287617

File tree

259 files changed

+14493
-7550
lines changed

Some content is hidden

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

259 files changed

+14493
-7550
lines changed

.yamato/upm-ci-universal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ Build_{{ project.name }}_Android_{{ android_api.name }}_{{ editor.version }}:
391391
{% endif %}
392392
commands:
393393
- git clone [email protected]:unity/utr.git utr
394-
- pip install unity-downloader-cli --extra-index-url https://artifactory.eu-cph-1.unityops.net/api/pypi/common-python/simple --upgrade
394+
- pip install unity-downloader-cli --extra-index-url https://artifactory.internal.unity3d.com/api/pypi/common-python/simple --upgrade
395395
- unity-downloader-cli --source-file %YAMATO_SOURCE_DIR%/unity_revision.txt -p WindowsEditor {% for component in platform.components %}-c {{ component }} {% endfor %}--wait --published-only
396396
- mklink /d WindowsEditor\Data\PlaybackEngines\AndroidPlayer\OpenJDK %JAVA_HOME%
397397
- mklink /d WindowsEditor\Data\PlaybackEngines\AndroidPlayer\SDK %ANDROID_SDK_ROOT%

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The above list is a guideline for major versions of SRP, but there are often mul
4545

4646
After you decide which version of SRP to use:
4747

48-
1. Go to the [Scriptable Render Pipeline repository](https://github.com/Unity-Technologies/ScriptableRenderPipeline).
48+
1. Go to the [Unity Grpahics repository](https://github.com/Unity-Technologies/Graphics).
4949
2. Click the **Branch** drop-down then click the **Tags** tab.
5050
3. Find the tag that corresponds to the version of SRP you want to use. When you clone the repository, you use this tag to check out the correct branch.
5151

@@ -58,11 +58,11 @@ After you clone the repository, you can install the package into your Unity Proj
5858
### Cloning the repository using the GitHub Desktop App:
5959

6060
1. Open the GitHub Desktop App and click **File > Clone repository**.
61-
2. Click the **URL** tab and enter the following URL: https://github.com/Unity-Technologies/ScriptableRenderPipeline.
61+
2. Click the **URL** tab and enter the following URL: https://github.com/Unity-Technologies/Graphics.
6262
3. Click the **Choose…** button and navigate to your Unity Project’s base folder.
6363
4. Click the **Clone** button.
6464

65-
After you clone the repository, open your console application of choice in the ScriptableRenderPipeline folder and run the following console command:
65+
After you clone the repository, open your console application of choice in the Graphics folder and run the following console command:
6666

6767
`\> git checkout v7.1.8 (or the latest tag)`
6868

@@ -75,13 +75,13 @@ Open your console application of choice and run the following console commands:
7575
```
7676
\> cd <Path to your Unity project>
7777
78-
\> git clone https://github.com/Unity-Technologies/ScriptableRenderPipeline
78+
\> git clone https://github.com/Unity-Technologies/Graphics
7979
80-
\> cd ScriptableRenderPipeline
80+
\> cd Graphics
8181
8282
\> git checkout v7.1.8 (or the latest tag)
8383
```
8484

85-
## Sample Scenes in ScriptableRenderPipelineData
85+
## Sample Scenes in Graphics
8686

87-
Unity provides sample Scenes to use with SRP. You can find these Scenes in the [ScriptableRenderPipelineData GitHub repository](https://github.com/Unity-Technologies/ScriptableRenderPipelineData). To add the Scenes to your Project, clone the repository into your Project's Assets folder.
87+
Unity provides sample Scenes to use with SRP. You can find these Scenes in the [Graphics GitHub repository](https://github.com/Unity-Technologies/Graphics). To add the Scenes to your Project, clone the repository into your Project's Assets folder.

TestProjects/HDRP_DXR_Tests/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ public enum HDShadowFilteringQuality
1212
High = 2,
1313
}
1414

15+
[GenerateHLSL(PackingRules.Exact)]
16+
public enum ProbeVolumesEvaluationModes
17+
{
18+
Disabled = 0,
19+
LightLoop = 1,
20+
MaterialPass = 2,
21+
}
22+
1523
[GenerateHLSL(PackingRules.Exact)]
1624
public enum ShaderOptions
1725
{
@@ -28,10 +36,22 @@ public enum ShaderOptions
2836
#else
2937
XrMaxViews = 1,
3038
#endif
39+
40+
// Warning: Probe Volumes is a highly experimental feature. It is disabled by default for this reason.
41+
// It's functionality is subject to breaking changes and whole sale removal.
42+
// It is not recommended for use outside of for providing feedback. It should not be used in production.
43+
// To enable, set:
44+
// ProbeVolumesEvaluationMode = ProbeVolumesEvaluationModes.MaterialPass
45+
// and inside of the editor run:
46+
// Edit->Render Pipeline->Generate Shader Includes
47+
// Probe Volumes feature must also be enabled inside of your HDRenderPipelineAsset.
48+
ProbeVolumesEvaluationMode = ProbeVolumesEvaluationModes.Disabled,
49+
ProbeVolumesAdditiveBlending = 1,
50+
3151
AreaLights = 1,
3252

3353
DeferredShadowFiltering = HDShadowFilteringQuality.Medium,
34-
BarnDoor = 0
54+
BarnDoor = 0
3555
};
3656

3757
// Note: #define can't be use in include file in C# so we chose this way to configure both C# and hlsl
@@ -42,8 +62,10 @@ public class ShaderConfig
4262
public static int s_PreExposition = (int)ShaderOptions.PreExposition;
4363
public static int s_XrMaxViews = (int)ShaderOptions.XrMaxViews;
4464
public static int s_PrecomputedAtmosphericAttenuation = (int)ShaderOptions.PrecomputedAtmosphericAttenuation;
65+
public static ProbeVolumesEvaluationModes s_ProbeVolumesEvaluationMode = (ProbeVolumesEvaluationModes)ShaderOptions.ProbeVolumesEvaluationMode;
66+
public static int s_ProbeVolumesAdditiveBlending = (int)ShaderOptions.ProbeVolumesAdditiveBlending;
4567
public static int s_AreaLights = (int)ShaderOptions.AreaLights;
46-
public static int s_BarnDoor = (int)ShaderOptions.BarnDoor;
68+
public static int s_BarnDoor = (int)ShaderOptions.BarnDoor;
4769
public static HDShadowFilteringQuality s_DeferredShadowFiltering = (HDShadowFilteringQuality)ShaderOptions.DeferredShadowFiltering;
4870
}
4971
}

TestProjects/HDRP_DXR_Tests/LocalPackages/com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs.hlsl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
#define HDSHADOWFILTERINGQUALITY_MEDIUM (1)
1212
#define HDSHADOWFILTERINGQUALITY_HIGH (2)
1313

14+
//
15+
// UnityEngine.Rendering.HighDefinition.ProbeVolumesEvaluationModes: static fields
16+
//
17+
#define PROBEVOLUMESEVALUATIONMODES_DISABLED (0)
18+
#define PROBEVOLUMESEVALUATIONMODES_LIGHT_LOOP (1)
19+
#define PROBEVOLUMESEVALUATIONMODES_MATERIAL_PASS (2)
20+
1421
//
1522
// UnityEngine.Rendering.HighDefinition.ShaderOptions: static fields
1623
//
@@ -19,6 +26,8 @@
1926
#define SHADEROPTIONS_PRECOMPUTED_ATMOSPHERIC_ATTENUATION (0)
2027
#define SHADEROPTIONS_RAYTRACING (1)
2128
#define SHADEROPTIONS_XR_MAX_VIEWS (2)
29+
#define SHADEROPTIONS_PROBE_VOLUMES_EVALUATION_MODE (0)
30+
#define SHADEROPTIONS_PROBE_VOLUMES_ADDITIVE_BLENDING (1)
2231
#define SHADEROPTIONS_AREA_LIGHTS (1)
2332
#define SHADEROPTIONS_DEFERRED_SHADOW_FILTERING (1)
2433
#define SHADEROPTIONS_BARN_DOOR (0)
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using UnityEngine;
1+
using UnityEngine;
22
using UnityEngine.Rendering;
33
using UnityEngine.Rendering.Universal;
44

@@ -15,40 +15,40 @@ internal class CopyToViewportRenderPass : ScriptableRenderPass
1515
Material m_CopyToViewportMaterial;
1616

1717
Rect m_Viewport;
18-
19-
public CopyToViewportRenderPass(Material copyToViewportMaterial)
18+
19+
public CopyToViewportRenderPass(Material copyToViewportMaterial)
2020
{
2121
m_CopyToViewportMaterial = copyToViewportMaterial;
2222
renderPassEvent = RenderPassEvent.BeforeRenderingTransparents;
23-
}
24-
25-
public void Setup(RenderTargetIdentifier source, RenderTargetHandle destination, Rect viewport)
26-
{
27-
m_Source = source;
23+
}
24+
25+
public void Setup(RenderTargetIdentifier source, RenderTargetHandle destination, Rect viewport)
26+
{
27+
m_Source = source;
2828
m_Destination = destination;
29-
m_Viewport = viewport;
30-
}
31-
32-
public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor)
33-
{
34-
cmd.GetTemporaryRT(m_Destination.id, cameraTextureDescriptor, FilterMode.Point);
29+
m_Viewport = viewport;
30+
}
31+
32+
public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor)
33+
{
34+
cmd.GetTemporaryRT(m_Destination.id, cameraTextureDescriptor, FilterMode.Point);
3535
}
36-
37-
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
38-
{
39-
CommandBuffer cmd = CommandBufferPool.Get(m_ProfilerTag);
36+
37+
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
38+
{
39+
CommandBuffer cmd = CommandBufferPool.Get(m_ProfilerTag);
4040

4141
cmd.SetRenderTarget(m_Destination.Identifier());
4242
cmd.SetGlobalTexture(m_SrcTexShaderPropertyId, m_Source);
4343
cmd.SetViewport(m_Viewport); // cmd.Blit would override SetViewport with the Rect of m_Destination
4444
cmd.DrawMesh(RenderingUtils.fullscreenMesh, Matrix4x4.identity, m_CopyToViewportMaterial);
4545

46-
context.ExecuteCommandBuffer(cmd);
47-
CommandBufferPool.Release(cmd);
48-
}
49-
50-
public override void FrameCleanup(CommandBuffer cmd)
51-
{
52-
cmd.ReleaseTemporaryRT(m_Destination.id);
46+
context.ExecuteCommandBuffer(cmd);
47+
CommandBufferPool.Release(cmd);
48+
}
49+
50+
public override void OnCameraCleanup(CommandBuffer cmd)
51+
{
52+
cmd.ReleaseTemporaryRT(m_Destination.id);
5353
}
5454
}

TestProjects/UniversalGraphicsTest/Assets/Scenes/105_MRT/OutputColorsToMRTsRenderPass.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using UnityEngine;
1+
using UnityEngine;
22
using UnityEngine.Rendering;
33
using UnityEngine.Rendering.Universal;
44

@@ -57,15 +57,15 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData
5757
{
5858
CommandBuffer cmd = CommandBufferPool.Get(profilerTag);
5959

60-
cmd.SetViewProjectionMatrices(Matrix4x4.identity, Matrix4x4.identity);
60+
cmd.SetViewProjectionMatrices(Matrix4x4.identity, Matrix4x4.identity);
6161
// cmd.SetGlobalTexture(shaderPropertyId_srcTex, source);
6262
cmd.DrawMesh(RenderingUtils.fullscreenMesh, scaleMatrix, colorToMrtMaterial);
6363

6464
context.ExecuteCommandBuffer(cmd);
6565
CommandBufferPool.Release(cmd);
6666
}
6767

68-
public override void FrameCleanup(CommandBuffer cmd)
68+
public override void OnCameraCleanup(CommandBuffer cmd)
6969
{
7070
cmd.ReleaseTemporaryRT(destination[1].id);
7171
cmd.ReleaseTemporaryRT(destination[0].id);

TestProjects/UniversalGraphicsTest/Assets/Test/Runtime/CameraCallbackTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData
150150
CommandBufferPool.Release(cmd);
151151
}
152152

153-
public override void FrameCleanup(CommandBuffer cmd)
153+
public override void OnCameraCleanup(CommandBuffer cmd)
154154
{
155155
if (cmd == null)
156156
throw new ArgumentNullException("cmd");
157157

158-
base.FrameCleanup(cmd);
158+
base.OnCameraCleanup(cmd);
159159
}
160160
}
161161
}

com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ public static TextureDimension dimension
9191
/// <returns>The default magenta texture.</returns>
9292
public static RTHandle GetMagentaTexture() { return useTexArray ? m_MagentaTexture2DArrayRTH : m_MagentaTextureRTH; }
9393

94+
static Texture3D m_BlackTexture3D;
9495
static Texture2DArray m_BlackTexture2DArray;
9596
static RTHandle m_BlackTexture2DArrayRTH;
9697
static RTHandle m_BlackTextureRTH;
98+
static RTHandle m_BlackTexture3DRTH;
9799
/// <summary>
98100
/// Default black texture.
99101
/// </summary>
@@ -104,6 +106,11 @@ public static TextureDimension dimension
104106
/// </summary>
105107
/// <returns>The default black texture array.</returns>
106108
public static RTHandle GetBlackTextureArray() { return m_BlackTexture2DArrayRTH; }
109+
/// <summary>
110+
/// Default black texture 3D.
111+
/// </summary>
112+
/// <returns>The default black texture 3D.</returns>
113+
public static RTHandle GetBlackTexture3D() { return m_BlackTexture3DRTH; }
107114

108115
static Texture2DArray m_WhiteTexture2DArray;
109116
static RTHandle m_WhiteTexture2DArrayRTH;
@@ -157,6 +164,9 @@ public static void Initialize(CommandBuffer cmd, ComputeShader clearR32_UIntShad
157164
RTHandles.Release(m_BlackTexture2DArrayRTH);
158165
m_BlackTexture2DArray = CreateTexture2DArrayFromTexture2D(Texture2D.blackTexture, "Black Texture2DArray");
159166
m_BlackTexture2DArrayRTH = RTHandles.Alloc(m_BlackTexture2DArray);
167+
RTHandles.Release(m_BlackTexture3DRTH);
168+
m_BlackTexture3D = CreateBlackTexture3D("Black Texture3D");
169+
m_BlackTexture3DRTH = RTHandles.Alloc(m_BlackTexture3D);
160170

161171
// White
162172
RTHandles.Release(m_WhiteTextureRTH);
@@ -223,5 +233,14 @@ static Texture CreateBlackUintTexture(CommandBuffer cmd, ComputeShader clearR32_
223233

224234
return blackUIntTexture2D as Texture;
225235
}
236+
237+
static Texture3D CreateBlackTexture3D(string name)
238+
{
239+
Texture3D texture3D = new Texture3D(width: 1, height: 1, depth: 1, textureFormat: TextureFormat.RGBA32, mipChain: false);
240+
texture3D.name = name;
241+
texture3D.SetPixel(0, 0, 0, Color.black, 0);
242+
texture3D.Apply(updateMipmaps: false);
243+
return texture3D;
244+
}
226245
}
227246
}

com.unity.render-pipelines.core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.unity.render-pipelines.core",
33
"description": "SRP Core makes it easier to create or customize a Scriptable Render Pipeline (SRP). SRP Core contains reusable code, including boilerplate code for working with platform-specific graphics APIs, utility functions for common rendering operations, and shader libraries. The code in SRP Core is use by the High Definition Render Pipeline (HDRP) and Universal Render Pipeline (URP). If you are creating a custom SRP from scratch or customizing a prebuilt SRP, using SRP Core will save you time.",
4-
"version": "9.0.0-preview.11",
4+
"version": "9.0.0-preview.13",
55
"unity": "2020.1",
66
"unityRelease": "0a23",
77
"displayName": "Core RP Library",

com.unity.render-pipelines.high-definition-config/Runtime/ShaderConfig.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ public enum HDShadowFilteringQuality
1212
High = 2,
1313
}
1414

15+
[GenerateHLSL(PackingRules.Exact)]
16+
public enum ProbeVolumesEvaluationModes
17+
{
18+
Disabled = 0,
19+
LightLoop = 1,
20+
MaterialPass = 2,
21+
}
22+
1523
[GenerateHLSL(PackingRules.Exact)]
1624
public enum ShaderOptions
1725
{
@@ -28,6 +36,18 @@ public enum ShaderOptions
2836
#else
2937
XrMaxViews = 1,
3038
#endif
39+
40+
// Warning: Probe Volumes is a highly experimental feature. It is disabled by default for this reason.
41+
// It's functionality is subject to breaking changes and whole sale removal.
42+
// It is not recommended for use outside of for providing feedback. It should not be used in production.
43+
// To enable, set:
44+
// ProbeVolumesEvaluationMode = ProbeVolumesEvaluationModes.MaterialPass
45+
// and inside of the editor run:
46+
// Edit->Render Pipeline->Generate Shader Includes
47+
// Probe Volumes feature must also be enabled inside of your HDRenderPipelineAsset.
48+
ProbeVolumesEvaluationMode = ProbeVolumesEvaluationModes.Disabled,
49+
ProbeVolumesAdditiveBlending = 1,
50+
3151
AreaLights = 1,
3252

3353
DeferredShadowFiltering = HDShadowFilteringQuality.Medium,
@@ -42,6 +62,8 @@ public class ShaderConfig
4262
public static int s_PreExposition = (int)ShaderOptions.PreExposition;
4363
public static int s_XrMaxViews = (int)ShaderOptions.XrMaxViews;
4464
public static int s_PrecomputedAtmosphericAttenuation = (int)ShaderOptions.PrecomputedAtmosphericAttenuation;
65+
public static ProbeVolumesEvaluationModes s_ProbeVolumesEvaluationMode = (ProbeVolumesEvaluationModes)ShaderOptions.ProbeVolumesEvaluationMode;
66+
public static int s_ProbeVolumesAdditiveBlending = (int)ShaderOptions.ProbeVolumesAdditiveBlending;
4567
public static int s_AreaLights = (int)ShaderOptions.AreaLights;
4668
public static int s_BarnDoor = (int)ShaderOptions.BarnDoor;
4769
public static HDShadowFilteringQuality s_DeferredShadowFiltering = (HDShadowFilteringQuality)ShaderOptions.DeferredShadowFiltering;

0 commit comments

Comments
 (0)