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/2023.2/staging #8059

Merged
merged 35 commits into from
Apr 11, 2024
Merged

Internal/2023.2/staging #8059

merged 35 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.

…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)
…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 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.
Add public scripting API for URP TAA settings.
…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-51548
…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
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.
…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
Currently the URP PR Aggregate job, which we run against PRs touching the URP codebase, is broken due to 4 jobs.
This PR gets the URP PR Aggregate job green again by moving 3 jobs to unstable and disabling one test.
…eing deallocated on scene changes.

This PR fixes GameObjects allocated by HDRP (CameraCache, HDAdditionalLightData/ComponentSingletons) being deallocated in some cases on scene changes. 
It also slightly simplifies the Probe Camera cache to avoir re-setting the same values every frame. 
This fix was discussed during previous bugfix with @julien.
…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.
update graphics compositor limitation for VR
…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-63800
…HDRP

In 2023.2, assets preview thumbnails are not rendered properly sometimes, they are gray. It's not the case in `2023.3.0a7`, it works perfectly fine.

It works because of the introduced changes in this PR: https://github.cds.internal.unity3d.com/unity/unity/pull/34816
Specifically the changes for the `HDRenderPipeline.cs`. Removing the globalSettings null check in 2023.2 fixes the issue. 

I don't know this code area, this is definitely more a question for @alex-vazquez 
I have to jump in vacation this week, I apologize for that, but wanted to create this PR so I can help the next person investigating this issue. I don't mind resuming my work on it if we wanna wait a week!
…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`.
Fix NaN issue in volumetric fog reprojection
Fix shader warnings in URP 2D template
…t camera

Set default projection orthographic for pixel perfect camera
- Bumped SRP packages from 16.0.5 to 16.0.6
…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.
…ected

### [UUM-52509](]https://jira.unity3d.com/browse/UUM-52509)
Steps to repro
1. Create a new VFX Graph
2. Add position line sequential block
3. Connect to VFX to enable gizmos, in scene view select Line End gizmo
4. Move it, observe that it's still changing Line Start values

Does not repro in a6. Possibly caused by https://github.cds.internal.unity3d.com/unity/unity/pull/32348
Fix a scaling issue with the recorder.
…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
@UnityAljosha UnityAljosha requested review from a team as code owners April 11, 2024 06:48
@UnityAljosha UnityAljosha merged commit 5ff66bb into 2023.2/staging Apr 11, 2024
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.