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

Merged
merged 28 commits into from
Aug 8, 2024
Merged

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.

kirill-titov-u and others added 28 commits June 28, 2024 19:26
RenderMode was never supported by URP. Maybe it was planned to be added but I couldn't find anyone who knows anything about.
Instead we hide the field and remove documentation for it.
…form by the wrong string

UI is adding included/excluded platforms in the UI by NamedBuildTarget.

So for instance, "Switch" is obtained from BuildTarget.Switch.ToString(), but if we do NamedBuildTarget(BuildTarget.Switch) it returns you "Nintendo Switch".

This was including/excluding RP assets that were not supposed to match the call to the API of BuiltTarget extension

https://jira.unity3d.com/browse/UUM-73363
Jira: UUM-65513

Reproduction steps:
1. Create a VFX Graph
2. Show the control panel or the blackboard (use the buttons in the toolbar)
3. Dock the “graph” Window to the bottom of the UI (for instance with the console)

Expected result: Floating panel is visible
Actual result: Floating panel disappears

![video](https://jira.unity3d.com/secure/attachment/1397173/IN-69565%20repro.mkv)
We are storing the wrong value for SpawnIndex attribute during Init compute, when processing several instances at the same time.
We are currently using the batch thread index, instead of per instance thread index.
The fix is very simple, just replacing one with the other when storing the value.
Backport of https://github.cds.internal.unity3d.com/unity/unity/pull/37566
& Revert a43dd6d683626ace5057a2a698fb0c0764a0635f
& Update Screenshot reference (not related to this PR but https://github.cds.internal.unity3d.com/unity/unity/pull/50541/)

N.B.: There is still a failure on GameCoreXOne (the issue is there since april, we should nail down this)
![103_LitDeferred expected](https://media.github.cds.internal.unity3d.com/user/42/files/62154512-f6ce-4af4-8141-25729d222b19)
![103_LitDeferred](https://media.github.cds.internal.unity3d.com/user/42/files/ef9d277e-3b2a-409f-bb49-5f3187ef8a31)
Fix [this issue](https://jira.unity3d.com/browse/UUM-74949) raised by this [forum discussion](https://forum.unity.com/threads/solved-set-reflection-probe-resolution-in-script.1606875/).
TLDR:
ProbeSettings.cubeResolution was internal, making it impossible to change the resolution of a cube reflection probe at runtime, unless using Reflection or ASMRef.
The use case for this is to change the resolution of a realtime or on demand probe depending on it's distance to the camera, which is quite a valid use to save a bit of performances.
- Fixes https://jira.unity3d.com/browse/UUM-73877 which could lead to increase import time due to incorrect priorities between dependencies
- Add missing meta for image ref (unrelated to the fix)
… when async

Backport of [49983](https://github.cds.internal.unity3d.com/unity/unity/pull/49983) for [UUM-70273](https://jira.unity3d.com/browse/UUM-70273)

From trunk PR:
"This PR applies multiple fixes to HDRP Screen Space Reflection:
- It removes the SSR lighting texture by reusing the SSR accumulation texture
- It adds a fence before async work, so they wait for resources to be cleared when it reuses pooled resources. This fixes flickering on some platform where graphics and async command buffer are more sensitive to missing fences.
- It changes the hit point texture and lighting texture clears to be async if the pass is async. Due to the new fence, it couldn't overlap with shadow rendering, but moving the clear to the same queue as the rest of the work, is more optimized and has no fence."

Port ticket: https://jira.unity3d.com/browse/UUM-71294
Bug ticket: https://jira.unity3d.com/browse/UUM-70273
Backport for UUM-19101

The shader utility function Linear01DepthFromNear does not work for APIs with reversed Z buffer (all of our APIs except OpenGL/GLES). I changed the function into one that works and updated some comments in shader code.

```
float Linear01DepthFromNear(float depth, float4 zBufferParam)
{
    // Old:
    // return 1.0 / (zBufferParam.x + zBufferParam.y / depth);

    // New:
    #if UNITY_REVERSED_Z
    return (1.0 - depth) / (zBufferParam.x * depth + zBufferParam.y);
    #else
    return depth / (zBufferParam.x * depth + zBufferParam.y);
    #endif
}
```

![image](https://media.github.cds.internal.unity3d.com/user/7119/files/beac76da-e6e4-4db1-8d3c-f4c6ef08b37d)
…raph outputs

This PR fixes the blocks that are implicitly using TransformObjectToWorld (e.g. Screen Space Size) in a ShaderGraph output.
Prior to this PR, the block was trying to use `UNITY_MATRIX_M `which is redefined as `elementToWorld` ("particle -> world matrix), instead of the "object -> world" matrix. It now uses the correct matrix.
Additionally, the selection & picking passes were broken when using blocks like Screen Space Size so it required change.
Fixes the following issues in Shader Graph Sample Content:

Production Ready Shaders issues

The grass does not render in HDRP
In URP the grass movement is crazy fast
In URP and HDRP, the animated lake water's waves are too small on the sample
Feature Examples:

The background mesh in the UPR scene doesn't have a material assigned and renders pink
Fixed broken link, and updated API links to xref links.
Fixing broken link mentioned in DOCG-5041.
…VolumeManager.

Avoid that the same volume can be registered more than 1 time in the VolumeManager.
… sizes

There is a graphical issue when resizing Reflection Probe box sizes on macOS. The issue comes from trying to draw in the Editor (either using `GL` commands or `DrawMeshNow`, for example) while the `Event.current.type != EventType.Repaint` causes graphical issues on Metal. This PR fixes that issue by guarding against this case when rendering the filled in box.

Jira: UUM-71467
…ed from `LightingSpecular`

This PR fixes the compiler error, described in UUM-48035, when using `single` precision:

```
Shader error in 'Lights Receiver URP/LightsReceiver': Program 'frag', error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Incompatible min precision type for operand #3 of opcode #40 (counts are 1-based). Expected int or uint. at line 47 (on metal)
```
This PR fixes UUM-74847 and prevents errors from being thrown when both the Feature Examples sample and Production Ready Shaders sample are both imported into the same 2022LTS project.
This change backports some fixes for the alpha to coverage logic in URP into 2022.3. (#49033)
Backport an NRE fix where the target serialization data in cross-pipeline situations was sometimes not safe.
…der)

This PR backports the changes from #49172 to 2022.3
Create the Global Settings asset in to the current opened folder.
This applies to URP and HDRP to Clone and New buttons on Project Settings -> Graphics -> HDRP or URP Global Settings.
…ode in Render Graph

The main issue goes to the hash method generation that was used for identifying Render Graph resources. We used the most performant way but it was too many collisions. After a bit of research the decision is to use FNV-1a implementation as it's the same performance but much more reliable. There's still a possibility for collision but a probability should be much smaller.
@UnityAljosha UnityAljosha requested review from a team as code owners August 8, 2024 15:38
@UnityAljosha UnityAljosha requested a review from a team as a code owner August 8, 2024 15:38
Copy link

github-actions bot commented Aug 8, 2024

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!

@UnityAljosha UnityAljosha merged commit 613f65f into 2022.3/staging Aug 8, 2024
4 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.