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/2022.3/staging #8060

Merged
merged 27 commits into from
Apr 11, 2024
Merged

Internal/2022.3/staging #8060

merged 27 commits into from
Apr 11, 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.

…n Server Builds (UUM-56965)

When running server builds calling `{GetType().DeclaringType.Name}` will give a NullReferenceException. This happens in two places inside the URP Codebase. To fix this the calls are simply removed as they don't provide much value.
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.
…efore validating them.

This PR add an extra check to `ScriptableRendererData.OnValidate` to ensure we only validate `ScriptableRendererFeatures` when all scripts have been compiled. Not doing so can lead to errors being thrown to the console during import (see attached Jira ticket).

Jira: https://jira.unity3d.com/browse/UUM-58944
Fix https://jira.unity3d.com/browse/UUM-66215 where the layout of elements in DOTS Entity Baking Preview panel changes depending on if Material foldout UI is expanded or not.

When the material foldout GUI is expanded on URP or HDRP, it affects other UI drawn afterwards because the UI logic modified persistent `EditorGUIUtility.labelWidth` value and didn't restore it properly after drawing its widgets. This PR fixes that by resetting the value to 0 after drawing the material options. The fix is made separately on CoreRP (used by URP Material Editor) and HDRP because the UI has separate implementations.

Note: we are simply setting the labelWidth to 0 instead of restoring whatever value it was before, because 0 is a special value that cannot be retrieved by using the property getter of `EditorGUIUtility.labelWidth` - if the internal value is 0, it will return some predetermined values instead (see [implementation](https://github.cds.internal.unity3d.com/unity/unity/blob/trunk/Editor/Mono/EditorGUIUtility.cs#L1367-L1379)). Therefore we must make the assumption that 0 is the correct value to be restored in this case.
…emultiplied alpha

This PR fixes the issue Adds an option to multiply specular by opacity by disabling preserve specular
This is not technically correct but offers similar control to transparents that are not in premultiply mode and helps for VFX.

Disabling affect specular in material settings provides the same result as before, but now you have an option to get a different result, so maybe not really needed to mention in upgrade guide as now it's working more as expected (previously the option had no effect)

Bug:https://jira.unity3d.com/browse/UUM-48661
Backport:https://jira.unity3d.com/browse/UUM-51549
…ming is forced

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
…ogic to match the non-NRP path

In some edge cases, when NativeRenderPass is enabled, MSAA resolve errors are thrown, because of incorrect render target setup when using a camera target texture. This PR makes sure the same logic used in the non-NRP path is used when NRP is enabled
…d in #include files

Backport of https://github.cds.internal.unity3d.com/unity/unity/pull/45790

From trunk PR:
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.

Bug: https://jira.unity3d.com/browse/UUM-62756
Backport: https://jira.unity3d.com/browse/UUM-63801
…with escape key

Jira: UUM-61583

Steps to repro:
- Create a new HDRP/URP project
- Create a new VFX Graph
- Create two operators that have incompatible slots (`Float` and `Sample Gradient` for instance)
- Drag `Float` connection out and hover it over gradient input slot
- Hit escape to cancel 
- Observe wrong type popup gets stuck and moves around with graph

![Unity_IrNrWdfUSY](https://media.github.cds.internal.unity3d.com/user/4003/files/2a6b8809-0eb9-4e74-bc33-dd4ed7e326b4)

![video](https://jira.unity3d.com/secure/attachment/1368545/WrontTypePopup.mp4)
…rmal packing functions.

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.
… projector pass

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`.
- Bumped SRP packages from 14.0.10 to 14.0.11.
- For consistency, added the urp-config package to the editor manifest (see [thread](https://unity.slack.com/archives/C89KFUUCT/p1712083056017469)).
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.
…t camera

Set default projection orthographic for pixel perfect camera
…mbient)

In the initial rendering of the preview in the inspector window, the ambient color of the default sky may not be ready (black ambient color), due to the lag of GPU readback of the SH coefficients. The ambient color is not updated until the preview is updated by some triggers like hovering the cursor over the inspector.
This PR fixes the issue by using the hard-coded value of the default sky's SH.
Add public scripting API for URP TAA settings.
…ositor.

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.
…ity changes

https://jira.unity3d.com/browse/UUM-67982

The update logic in the reflection probe atlas was not taking into account the runtime intensity of non real-time probes
update graphics compositor limitation for VR
@UnityAljosha UnityAljosha requested review from a team as code owners April 11, 2024 06:48
@UnityAljosha UnityAljosha merged commit 0c658a0 into 2022.3/staging Apr 11, 2024
4 checks passed
Copy link

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page).
See the PR template for more information.
Thank you!

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.