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 #8053

Merged
merged 34 commits into from
Apr 2, 2024
Merged

Internal/master #8053

merged 34 commits into from
Apr 2, 2024

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.

arttu-peltonen and others added 30 commits March 26, 2024 08:27
Add editor analytics for Render Graph Viewer.

JIRA: https://jira.unity3d.com/browse/XPIPELINE-837
POI: https://jira.unity3d.com/browse/POI-817

Event data collection sheet: https://docs.google.com/spreadsheets/d/16jZa8H0o2LKQi-AiNHe8YgRmM4viAKLj40Csjpoljic/edit#gid=515574887
STAR Checklist: https://star-checklist.ds.unity3d.com/Checklists/995/overview
schema: `com.unity3d.data.schemas.editor.analytics.uRenderGraphViewerLifetimeAnalytic_v1`
taxonomy: `editor.analytics.uRenderGraphViewerLifetimeAnalytic.v1`
Added documentation on how to use the Screen Space Overlay render mode alongside the Graphics Compositor. We decided not to change the actual behavior of SupportedRenderingFeatures.active.rendersUIOverlay when the Graphics Compositor is in use, but instead, to document a way force the rendering of the UI in this context.

When the user follows the new documentation steps, the UI is indeed well renderer in the GameView. Tested manually and locally on my Windows machine.
Update buginfo and codeowners for Environment Effect bug area
This PR fixes HDRP DXR Standalone tests (HDRP_DXR_Win_DX12_Standalone_mono_Linear) that have been red in trunk since early January because of missing shader variants in the shader variant collection.

https://unity-ci.cds.internal.unity3d.com/project/3/branch/trunk/jobDefinition/.yamato%2Fsrp%2Fhdrp-dxr.yml%23hdrp_dxr_win_dx12_standalone_mono_linear?nav=jobDefinitions
Update codeowners and .buginfo files for the Postprocessing and UI Features area.
https://jira.unity3d.com/browse/UUM-58350

An internal operation (addComponent) was registering an editor Undo, marking the scene as dirty every time we entered the  playmode.
Fix realloc of history buffer when XR is enabled
Support rendering water with custom pass, request from the forum
Fixes [UUM-62756](https://jira.unity3d.com/browse/UUM-62756). The public documentation states the shader compiler will ignore Unity-specific `#pragma` directives in files included through `#include`, however this behavior was broken as they were being reported in both `#include` and `#include_with_pragmas`. This change fixes that so they're not reported in `#include` files.

Also, added a warning message when someone uses `#include_with_pragmas` within a file that was itself included with `#include`. In that particular case, `#include_with_pragmas` will be treated as `#include`, meaning all Unity-specific pragmas it might contain will be ignored.
Add public scripting API for URP TAA settings.
…ctions.

Fixes https://jira.unity3d.com/browse/UUM-62216, in which artifacts appear (looks like uninitialized memory) when using the accurate G-buffer normals feature when targeting mobile. This feature uses a pair for function for performing octrahedral encoding and decoding of normals.

The function misbehaves when targeting mobile, but not desktop. The main difference between mobile and desktop in shadercode is that desktop treats `half` as float, whereas on mobile `half` actually works. The functions for octahedral encoding take `float`'s as input, and are given `half`'s in the mobile path. In the function, we use `abs()` on the input and then negate it. This combination seems to cause a miscompilation of some sort, presumably because `abs` and negation are both input modifiers rather than real instructions - I'm not entirely sure, but it's some mix of those 3 things - half to float conversion, abs and negation.

The most minimal fix that worked was this:
```
float3 UnpackNormalOctQuadEncode(float2 f)
{
-   float3 n = float3(f.x, f.y, 1.0 - abs(f.x) - abs(f.y));
+   float3 n = float3(f.x, f.y, 1.0 - abs(real(f.x)) - abs(real(f.y)));
```
But I instead decided to change the functions to use `real` instead of `float` throughout, as it it seemed cleaner. `real` is just an alias for `half` on mobile and `float` on desktop.
Fixes https://jira.unity3d.com/browse/UUM-54404, where screen space decals weren't taking into account light cookies.

The code to sample cookies is already present in the relevant shader (a shader made with shadergraph decal template), but the keyword for light cookies, `_LIGHT_COOKIES` is not declared. The fix is simply to add the keyword to the relevant pass descriptor.

The keyword will automatically be set earlier in the render loop, in `LightCookiesManager.Setup`.
…atrix operator

- Fixes https://jira.unity3d.com/browse/UUM-57915
- Add a settings to select between row and column
- Add symetrical operator SplitMatrix

Another possible way to have done it would have been through expandable slots but it lacks the row/colum selection and would have been a bit hacky as not handled directly by our system. A proxy struct would have been needed to do it right but it seems more involved/risky.

Here the solution chosen is consistent with how Shader Graph is doing it.
Fix for a distorted viewport when using no intermediate texture in XR rendering. When activating dynamic resolution and using a scale of < 1, the image becomes distorted. This fixes this issue.
We complete switching to the newest API in GraphicsSettings.

GraphicsSettings.renderPipelineAsset API will be deprecated and it's replaced by defaultRenderPipeline. 
We should use GraphicsSettings.defaultRenderPipeline or GraphicsSettings.currentRenderPipeline.

Incorrect API was used in some places. It supposed to rely on the current pipeline instead of default as we may not have a default but we could still have RP in the Quality Settings.

1. Scene Render mode window could have incorrect height
2. Avatar previews could be handled incorrectly
3. Light component have an issue in a multiple RP projects
4. ScreenSpaceAmbientOcclusion may not work when URP is deferred in a multiple RP projects
5. Enlighten Manager may not work if you don't set RP asset in the GraphicsSettings


https://jira.unity3d.com/browse/UUM-66743
Add minimal coverage about not up to date template.
Improve missing shader message in custom post process, improve doc, and remove 's' in post process order
About UUM-62355, the Position Box has been migrated with this PR: https://github.cds.internal.unity3d.com/unity/unity/pull/40039
Since the normal/axis are aligned with the box, we can skip the scale if possible (aka the transform comes from a Translation/Rotation/Scale):

https://media.github.cds.internal.unity3d.com/user/42/files/a979c270-ce82-4537-af32-d4ff6f0e5df3

⚠️ If we are computing the box in other way, the scale won't be skipped and it still leads to invalid axis but it's an really rare case:

https://media.github.cds.internal.unity3d.com/user/42/files/1aaaa3b8-d983-41fb-bb9c-5ce0222dfa1b


About UUM-67233, the Position On SDF was incomplete:
- The applyOrientation wasn't tested leading to compilation failure
- The blending mode wasn't taken into account (Position Add/Mul/Blend, ...)
- The axisX/Y/Z was never wrote, I made them consistent with the sphere orientation (see below)

https://media.github.cds.internal.unity3d.com/user/42/files/43efeee4-0756-408f-9d46-5a3f0e6836f6
Fix unstable test: https://jira.unity3d.com/browse/UUM-59403 which was disabled earlier due to instability.
 
The test was unstable because it sometimes took too long and timed out. The instability was actually introduced by this PR https://github.cds.internal.unity3d.com/unity/unity/pull/41268 that tracks timeouts correctly, meaning that the highly varying runtimes of this test (usually 100-300sec but up to 700 sec sometimes) were not being enforced before. After the UTF 1.4.2 release the timeouts started correctly failing the test, and the test became unstable as a consequence.

This PR fixes the issue by refactoring it: it used to be a edit mode test that manually enters playmode (triggering domain reload) before running the test logic. It was originally done this way to more closely follow the repro steps where asset preview bugs would happen. But given the long runtime, it makes more sense to just implement it as a playmode test instead, so that we don't need to enter playmode separately which is time-consuming. As a result, the test is now passing reliably and only taking ~5sec.

cc @alex-vazquez - There was a separate issue with URP_Foundation project where the playmode test assembly was being excluded from editor, meaning that we had tests that were not being run when they should have been. These tests have now been fixed and enabled too.
…ompiler

JIRA: https://jira.unity3d.com/browse/UUM-65454

When merging subpasses together in a NativePass, we don't check if there will be more than 8 native render subpasses. This PR adds a check for this when verifying if a certain graph pass can be merged into a Native Pass, as well as a test. If merging the graph pass would result in too many native subpasses, we simply create a new Native Pass
Correctly handle HLSL includes in vfx custom operator. It was simply discarded before this change.

🎁  Bonus:
- Remove unexpected warnings about `in` missing in operators

![image](https://media.github.cds.internal.unity3d.com/user/42/files/293fe03b-8af0-48da-a291-3b07788511c0)

- Add errors when include refers to missing files

https://media.github.cds.internal.unity3d.com/user/42/files/76139d70-9a35-472d-95d2-fa3176dd6da8

- Factorize error feedback for CustomHLSL at https://github.cds.internal.unity3d.com/unity/unity/pull/46642/commits/5a25691885a828b0af6d42313ed042b8362b52bb
… textures

Fix https://jira.unity3d.com/browse/UUM-67987

Render Graph Viewer displays a "store reasoning message" for Raster Pass Attachments to help understand why the system selected a given store action (one of `Store`, `Resolve` , `StoreAndResolve` or `DontCare`). Because `StoreAndResolve` exists, it means that we can potentially keep both the resolved and non-resolved data from a MSAA texture, and the reasoning for both of is independently decided. Therefore for MSAA attachments, we need to display two separate store reason messages in Render Graph Viewer. This PR fixes a bug where the UI only picked the first, default store reason message.

For MSAA textures, UI looks like this:
- See separate store reason messages for "Resolved surface" and "MSAA surface"
- For non-MSAA attachments, the MSAA-specific information is not displayed.

![image](https://media.github.cds.internal.unity3d.com/user/3380/files/e4009dfb-4c68-43c0-a246-986da1aa2d02)


This PR also contains a separate UI fix for Render Graph Viewer that makes the highlight animation update smoothly. It's a simple workaround to [this issue](https://jira.unity3d.com/browse/UUM-68010) that has been flagged for UITK team.
Fix missing eye index in compute shader
…UUM-36359)

Fix for [UUM-36359](https://jira.unity3d.com/browse/UUM-36359). Originally `RTHandle` manages external texture but doesn't have the same check for `RenderTexture` that generated as external resources.
Jira: https://jira.unity3d.com/browse/UUM-57644
Fixed XROcclusionMesh.shader and XRMirrorView.shader are not stripped down when XR Plugin is not installed
The position SS wasn't passed to the APV evaluation function resulting in wrong jittering for TAA
alelievr and others added 4 commits March 30, 2024 04:04
Fixed an issue in recorder with output textures caused by a previous PR:  https://github.cds.internal.unity3d.com/unity/unity/pull/46637
The lighting code for cinematic eye shader was using the directional light position instead of it's direction
update graphics compositor limitation for VR
@UnityAljosha UnityAljosha requested review from a team as code owners April 2, 2024 14:39
@UnityAljosha UnityAljosha merged commit d02ed86 into master Apr 2, 2024
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.