Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion com.unity.render-pipelines.core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"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.",
"version": "10.7.0",
"unity": "2020.3",
"unityRelease": "13f1",
"unityRelease": "18f1",
"displayName": "Core RP Library",
"dependencies": {
"com.unity.ugui": "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Configuration files for the High Definition Render Pipeline.",
"version": "10.7.0",
"unity": "2020.3",
"unityRelease": "13f1",
"unityRelease": "18f1",
"displayName": "High Definition RP Config",
"dependencies": {
"com.unity.render-pipelines.core": "10.7.0"
Expand Down
2 changes: 1 addition & 1 deletion com.unity.render-pipelines.high-definition/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The High Definition Render Pipeline (HDRP) is a high-fidelity Scriptable Render Pipeline built by Unity to target modern (Compute Shader compatible) platforms. HDRP utilizes Physically-Based Lighting techniques, linear lighting, HDR lighting, and a configurable hybrid Tile/Cluster deferred/Forward lighting architecture and gives you the tools you need to create games, technical demos, animations, and more to a high graphical standard.",
"version": "10.7.0",
"unity": "2020.3",
"unityRelease": "13f1",
"unityRelease": "18f1",
"displayName": "High Definition RP",
"dependencies": {
"com.unity.render-pipelines.core": "10.7.0",
Expand Down
2 changes: 1 addition & 1 deletion com.unity.render-pipelines.lightweight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The Lightweight Render Pipeline (LWRP) is a prebuilt Scriptable Render Pipeline, made by Unity. The technology offers graphics that are scalable to mobile platforms, and you can also use it for higher-end consoles and PCs. You’re able to achieve quick rendering at a high quality without needing compute shader technology. LWRP uses simplified, physically based Lighting and Materials. The LWRP uses single-pass forward rendering. Use this pipeline to get optimized real-time performance on several platforms.",
"version": "10.7.0",
"unity": "2020.3",
"unityRelease": "13f1",
"unityRelease": "18f1",
"displayName": "Lightweight RP",
"dependencies": {
"com.unity.render-pipelines.universal": "10.7.0",
Expand Down
1 change: 1 addition & 0 deletions com.unity.render-pipelines.universal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added
- Added support for controlling Volume Framework Update Frequency in UI on Cameras and URP Asset as well as through scripting.
- XR: Added Late Latching support to reduce VR latency (Quest).

### Fixed
- Fixed terrain hole shadowing [case 1349305]
Expand Down
11 changes: 11 additions & 0 deletions com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ public void Execute(ScriptableRenderContext context, ref RenderingData rendering
ExecuteBlock(RenderPassBlock.MainRenderingTransparent, in renderBlocks, context, ref renderingData);
}

#if ENABLE_VR && ENABLE_XR_MODULE
if (cameraData.xr.enabled)
cameraData.xr.canMarkLateLatch = false;
#endif

// Draw Gizmos...
DrawGizmos(context, camera, GizmoSubset.PreImageEffects);

Expand Down Expand Up @@ -729,6 +734,10 @@ void ExecuteRenderPass(ScriptableRenderContext context, ScriptableRenderPass ren
CommandBufferPool.Release(cmd);

renderPass.Execute(context, ref renderingData);
#if ENABLE_VR && ENABLE_XR_MODULE
if (cameraData.xr.enabled && cameraData.xr.hasMarkedLateLatch)
cameraData.xr.UnmarkLateLatchShaderProperties(cmd, ref cameraData);
#endif
}

void SetRenderPassAttachments(CommandBuffer cmd, ScriptableRenderPass renderPass, ref CameraData cameraData)
Expand Down Expand Up @@ -924,6 +933,8 @@ void BeginXRRendering(CommandBuffer cmd, ScriptableRenderContext context, ref Ca
#if ENABLE_VR && ENABLE_XR_MODULE
if (cameraData.xr.enabled)
{
if (cameraData.xr.isLateLatchEnabled)
cameraData.xr.canMarkLateLatch = true;
cameraData.xr.StartSinglePass(cmd);
cmd.EnableShaderKeyword(ShaderKeywordStrings.UseDrawProcedural);
context.ExecuteCommandBuffer(cmd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ static void RenderCameraStack(ScriptableRenderContext context, Camera baseCamera
{
UpdateVolumeFramework(baseCamera, baseCameraAdditionalData);
}
m_XRSystem.BeginLateLatching(baseCamera, xrPass);
}
#endif

Expand All @@ -528,7 +529,9 @@ static void RenderCameraStack(ScriptableRenderContext context, Camera baseCamera
{
EndCameraRendering(context, baseCamera);
}

#if ENABLE_VR && ENABLE_XR_MODULE
m_XRSystem.EndLateLatching(baseCamera, xrPass);
#endif
if (isStackedRendering)
{
for (int i = 0; i < cameraStack.Count; ++i)
Expand Down
29 changes: 29 additions & 0 deletions com.unity.render-pipelines.universal/Runtime/XR/XRPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class XRPass
static RenderTargetIdentifier invalidRT = -1;
internal bool renderTargetValid { get => renderTarget != invalidRT; }
internal bool renderTargetIsRenderTexture { get; private set; }
internal bool isLateLatchEnabled { get; set; }
internal bool canMarkLateLatch { get; set; }
internal bool hasMarkedLateLatch { get; set; }

// Access to view information
internal Matrix4x4 GetProjMatrix(int viewIndex = 0) { return views[viewIndex].projMatrix; }
Expand Down Expand Up @@ -450,8 +453,34 @@ internal void UpdateGPUViewAndProjectionMatrices(CommandBuffer cmd, ref CameraDa
stereoProjectionMatrix[i] = GL.GetGPUProjectionMatrix(stereoCameraProjectionMatrix[i], isRenderToTexture);
}
RenderingUtils.SetStereoViewAndProjectionMatrices(cmd, stereoViewMatrix, stereoProjectionMatrix, stereoCameraProjectionMatrix, true);
if (cameraData.xr.canMarkLateLatch)
MarkLateLatchShaderProperties(cmd, ref cameraData);
}
}

internal static readonly int UNITY_STEREO_MATRIX_V = Shader.PropertyToID("unity_StereoMatrixV");
internal static readonly int UNITY_STEREO_MATRIX_IV = Shader.PropertyToID("unity_StereoMatrixInvV");
internal static readonly int UNITY_STEREO_MATRIX_VP = Shader.PropertyToID("unity_StereoMatrixVP");
internal static readonly int UNITY_STEREO_MATRIX_IVP = Shader.PropertyToID("unity_StereoMatrixIVP");

internal void MarkLateLatchShaderProperties(CommandBuffer cmd, ref CameraData cameraData)
{
cmd.MarkLateLatchMatrixShaderPropertyID(CameraLateLatchMatrixType.View, UNITY_STEREO_MATRIX_V);
cmd.MarkLateLatchMatrixShaderPropertyID(CameraLateLatchMatrixType.InverseView, UNITY_STEREO_MATRIX_IV);
cmd.MarkLateLatchMatrixShaderPropertyID(CameraLateLatchMatrixType.ViewProjection, UNITY_STEREO_MATRIX_VP);
cmd.MarkLateLatchMatrixShaderPropertyID(CameraLateLatchMatrixType.InverseViewProjection, UNITY_STEREO_MATRIX_IVP);
cmd.SetLateLatchProjectionMatrices(stereoProjectionMatrix);
cameraData.xr.hasMarkedLateLatch = true;
}

internal void UnmarkLateLatchShaderProperties(CommandBuffer cmd, ref CameraData cameraData)
{
cmd.UnmarkLateLatchMatrix(CameraLateLatchMatrixType.View);
cmd.UnmarkLateLatchMatrix(CameraLateLatchMatrixType.InverseView);
cmd.UnmarkLateLatchMatrix(CameraLateLatchMatrixType.ViewProjection);
cmd.UnmarkLateLatchMatrix(CameraLateLatchMatrixType.InverseViewProjection);
cameraData.xr.hasMarkedLateLatch = false;
}
}
}

Expand Down
19 changes: 19 additions & 0 deletions com.unity.render-pipelines.universal/Runtime/XR/XRSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,25 @@ internal int GetMaxViews()
return maxViews;
}

internal void BeginLateLatching(Camera camera, XRPass xrPass)
{
//Only support late latching for multiview use case
if (display != null && xrPass.singlePassEnabled && xrPass.viewCount == 2)
{
display.BeginRecordingIfLateLatched(camera);
xrPass.isLateLatchEnabled = true;
}
}

internal void EndLateLatching(Camera camera, XRPass xrPass)
{
if (display != null && xrPass.isLateLatchEnabled)
{
display.EndRecordingIfLateLatched(camera);
xrPass.isLateLatchEnabled = false;
}
}

internal List<XRPass> SetupFrame(CameraData cameraData)
{
Camera camera = cameraData.camera;
Expand Down
2 changes: 1 addition & 1 deletion com.unity.render-pipelines.universal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The Universal Render Pipeline (URP) is a prebuilt Scriptable Render Pipeline, made by Unity. URP provides artist-friendly workflows that let you quickly and easily create optimized graphics across a range of platforms, from mobile to high-end consoles and PCs.",
"version": "10.7.0",
"unity": "2020.3",
"unityRelease": "13f1",
"unityRelease": "18f1",
"displayName": "Universal RP",
"dependencies": {
"com.unity.mathematics": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion com.unity.shadergraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The Shader Graph package adds a visual Shader editing tool to Unity. You can use this tool to create Shaders in a visual way instead of writing code. Specific render pipelines can implement specific graph features. Currently, both the High Definition Rendering Pipeline and the Universal Rendering Pipeline support Shader Graph.",
"version": "10.7.0",
"unity": "2020.3",
"unityRelease": "13f1",
"unityRelease": "18f1",
"displayName": "Shader Graph",
"dependencies": {
"com.unity.render-pipelines.core": "10.7.0",
Expand Down
2 changes: 1 addition & 1 deletion com.unity.visualeffectgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Visual Effect Graph",
"version": "10.7.0",
"unity": "2020.3",
"unityRelease": "13f1",
"unityRelease": "18f1",
"description": "The Visual Effect Graph is a node based visual effect editor. It allows you to author next generation visual effects that Unity simulates directly on the GPU. The Visual Effect Graph is production-ready for the High Definition Render Pipeline and runs on all platforms supported by it. Full support for the Universal Render Pipeline and compatible mobile devices is still in development.",
"keywords": [
"vfx",
Expand Down