Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal/master #7975

Merged
merged 27 commits into from
Oct 16, 2023
Merged

Internal/master #7975

merged 27 commits into from
Oct 16, 2023

Conversation

UnityAljosha
Copy link
Collaborator

Please read the Contributing guide before making a PR.

Checklist for PR maker

  • Have you added a backport label (if needed)? For example, the need-backport-* label. After you backport the PR, the label changes to backported-*.
  • Have you updated the changelog? Each package has a CHANGELOG.md file.
  • Have you updated or added the documentation for your PR? When you add a new feature, change a property name, or change the behavior of a feature, it's best practice to include related documentation changes in the same PR. If you do add documentation, make sure to add the relevant Graphics Docs team member as a reviewer of the PR. If you are not sure which person to add, see the Docs team contacts sheet.
  • Have you added a graphic test for your PR (if needed)? When you add a new feature, or discover a bug that tests don't cover, please add a graphic test.

Purpose of this PR

Why is this PR needed, what hard problem is it solving/fixing?


Testing status

Describe what manual/automated tests were performed for this PR


Comments to reviewers

Notes for the reviewers you have assigned.

sebastienlagarde and others added 27 commits October 11, 2023 02:14
…che light for RTGI

POI: https://jira.unity3d.com/browse/POI-816 - SRP production ready

This PR add a new API "forceVisible" on the C++ Light class. This is use in HDRP to allow to have a light that is forced visible even if outside of the view and have no pixels on screen.  The light will still generate a cached shadow map - reserve memory in the Atlas etc., but will be removed before going in to the main light loop. 
Thus an offscreen light could be cached and reuse by system like realtime GI even if not visible on screen.

To get correct behavior with shadow caching, this is the change include in the PR: 

1. Force lights visible and cache shadows for them
2. Remove frustum limiting the shadow culling
3. Use default shadow value set by user
4. Cache shadow value in the hit point

They are explain in the slides: https://docs.google.com/presentation/d/1qlMkPFOGgxHsvvbYan3DGWY09uj5kHJVIO-PilKOULM/edit#slide=id.g1a443f2ccf9_0_432

In addition, this PR refactor the light management code to share more culling code between rasterizer, raytracing and path tracing and optimize it a bit. This is name world light management:

World light manager handles all lights in a scene and makes them accessible on the GPU. This includes
information about their shape.
1. First create WorldLights object and populate it using CollectWorldLights().
2. Pass the WorldLights object to BuildWorldLightDatas() to create the GPU representation of the lights.
3. (optionally) Pass the WorldLights object to BuildWorldLightVolumes() to create the GPU representation of the light bounds.
4. Bind the buffers using Bind

WorldLights life time loop
- Construct / Update
- Reset

WorldLightsGpu and WorldLightsVolumes life time loop
- Construct / Update
  - PushToGpu
- Bind
- Release
* [POI-817](https://jira.unity3d.com/browse/POI-817)
* [URP-1998](https://jira.unity3d.com/browse/URP-1998)
* [URP-2044](https://jira.unity3d.com/browse/URP-2044)
* [URP-2040](https://jira.unity3d.com/browse/URP-2040)

This PR makes sure URP...
* ...uses PlatformAutoDetect to cache the results of `GraphicsSettings.HasShaderDefine(BuiltinShaderDefine.SHADER_API_MOBILE)`
* ...doesn't call `BuildAdditionalLightsShadowAtlasLayout` when additional light shadows are disabled in URP Asset
* ...doesn't call `InitializeMainLightShadowResolution` when main light shadows are disabled in URP Asset
* ...doesn't calculate rendering/light layers when the feature is disabled in the URP Asset
* ...uses the SHAutoDetect function in PlatformAutoDetect
This PR fixes deferred renderer not working correctly on RenderGraph path due to the fact, that render pass breaks if SSAO is used inbetween GBuffer and Deferred passes

This also renames UseRenderPass to UseFramebufferFetch in DeferredLights to be more clear and less confusing.


RenderGraph Epic:
https://jira.unity3d.com/browse/URP-1297

POI:
https://jira.unity3d.com/browse/POI-817
Migrate HDRP Raytracing resources to IRenderPipelineResources, directly on GraphicsSettings.

![image](https://media.github.cds.internal.unity3d.com/user/3279/files/deb941b9-4a79-4e5f-942c-bc7d85c9d541)

Also last minute add (see comments): Hidding [GPU Pipeline Tiers 0](https://github.cds.internal.unity3d.com/unity/unity/pull/22897) wrongly exposed resources in the UI (discovered when resolving conflicts)
https://jira.unity3d.com/browse/LIGHT-1685

**FYI: I've already landed this PR in `light-transport/unified-dev`, and am now bringing it back to trunk. Keep in mind the code changes have already been reviewed once. The documentation changes however have not.**

This PR makes some changes to the public light probe API, in response to some issues I found while working on a compute based probe integrator. The changes are listed below.
- Renamed `WaitForAsyncOperation` and `IsAsyncOperationComplete` to `Wait` and `IsComplete`. The async nature is implicit.
- Added `IDisposable` to a few interfaces that were missing it.
- Made `BufferSlice` carry a type annotation, ie. `BufferSlice<T>`. `BufferSlice.Offset` is now in _elements_, not in bytes.
- Change `WriteBuffer` and `ReadBuffer` to take a `BufferSlice` instead of BufferID. This lets you write to and read from sections of buffers, which is more flexible. I added some helpers for if you want to use `BufferID` directly.

I ended up having to make quite a few changes to documentation accordingly.
… the non-RenderGraph path

The RG and non-RG paths CopyDepth pass location in the frame is different, the RG path one must match the non-RG path for consistency with projects ported from the old renderer.

This PR moves the CopyDepth pass to be executed before the Skybox pass, which is the same behaviour as the non RG path.
This PR fixes issues when using spawner callbacks in instanced effects. Only the first instance was receiving the correct attributes from the spawner.
Fixed Layered Lit Displacement
depth copy after depth priming happens after screenspace shadows and it should be vice versa due to the fact, that both events are the same. this PR increases the event of screenspace shadows by one just to guarantee the correct sequencing of the passes
Jira: https://jira.unity3d.com/browse/UUM-49454
Fixed XR SPI is not disabled after processing the render request.
Rendergraph Adoption POI https://jira.unity3d.com/browse/POI-817 
Optimizations
- Remove clear commands
- Decrease number of passes
- Merged passes together
- Remove SetGlobalTextures
Rendering debugger pixel validation is broken when RG is enabled. If postprocessing is disabled, the Map Overlays are broken as well.

This PR fixes all the remaining issues and rendering debugger should now be fully functional in the RG path.
Add PushMarker API to help profile shaders on platforms that supports it (PS5 only)
Add buginfo file for HDRP package
Fix for this issue: https://jira.unity3d.com/browse/UUM-52909.

Due to some perf improvements and caching, a previous comparison by reference was no longer valid in undo/redo (which undergoes serialization). This quick fix compares properties by ID instead of reference.
Implements new globals api for textures. Provides better resource tracking, with the possibility to reclaim memory early and prevents api misuse that the previous command buffer approach allowed.

https://docs.google.com/document/d/1AocoeM9R3QGQi4KVMNc_k_24ZeuHNt0FH1coAJdALkU/edit#heading=h.xd8euqu66dx4
Fixing issues with hardware DRS on console (manifestation is usually bright qnan pixels on the right of the screen). 
Lowres transparent (aka half res transparent) can be off by one pixel with the hardware resolution dynamic scale. The reason is a small mismatch between RTHandle and the runtime. Unfortunately fixing this problem might require a heavier rewrite to ensure the RTHandle scale works well. As a fix we can compute the error of this scale and plumb it in as a custom DRS scaler (only for the HW path) and fix the issue. Issue only present on xbox as qnans in the border (triggered by only certain resolutions using hardware DRS with transparent lowres).
Fix regression of cloud rendering being applied on top of the prefab view.
POI: https://jira.unity3d.com/browse/POI-816 - SRP production ready

This PR adds "Scenario Blending" support to URP using Compute Shaders. It is meant as a replacement for https://github.cds.internal.unity3d.com/unity/unity/pull/27688, which was a non-Compute version. This PR has the advantage of being simpler, with less code changed for the core Probe Volume System. However, it does have the downside of not being able to run on platforms that do not support Compute Shaders.
…utations)

Previously, various circumstances resulted in incorrect material property generation for shadergraph blackboard properties.

Exposed Global -> Generates a material property, but this configuration undermines its globality and we shouldn't allow it.
Hidden Material -> causes the material property to not generate, which means default values are ignored.

This fix causes globals to always work with the `Shader.SetGlobal...` scripting API. Hidden Materials now generate a material property with the [HideInInspector] attribute, which allows default values to be saved.

Also fixed some minor/cosmetic 'custom binding' related bugs.


This is the implementation of: https://jira.unity3d.com/browse/PLATGRAPH-2177.

Further details can be found here: https://docs.google.com/document/d/1u9RHjVAuHa-Wx7NWoQGGaN99GqU4-cePQJTdAOIhV1o/edit?usp=sharing
Additional considerations for keywords: https://docs.google.com/document/d/1Q78mx1O24kxJcYabbEBt37a1WAg7p92i80lhBvn3wSM/edit

This is approved as a part of: https://jira.unity3d.com/browse/POI-816.
update TestCaseFilters.asset for HDRP_DXR to add to 5020_PathTracing_Depth_1 to be excluded on consoles
This PR adds missing buginfo files to VFX package and module
Sets default material properties that are needed by sprite previews. This is a bit of a hotfix- it's probably better if the sprite target were to create these as hidden material properties so that these default values could be setup.
@UnityAljosha UnityAljosha requested review from a team as code owners October 16, 2023 09:32
@UnityAljosha UnityAljosha merged commit 482d2f8 into master Oct 16, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.