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

Merged
merged 22 commits into from
Feb 27, 2024
Merged

Internal/2023.2/staging #8037

merged 22 commits into from
Feb 27, 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.

…s active

This PR makes it a bit more obvious in UI and tooltips that the light culling mask doesn't work in Forward+.

If all active renderers are Forward+, then the culling mask setting in the light inspector is greyed out with the following tooltip:

![image](https://media.github.cds.internal.unity3d.com/user/2726/files/5ae12d18-0cc9-494f-abe1-12c419b61909)

If even one of the active renderers is something other than Forward+, then the setting is enabled again. But the tooltip also mentions that Forward+ doesn't support the setting:

![image](https://media.github.cds.internal.unity3d.com/user/2726/files/c799444c-c9d4-4814-be48-f987bafe466e)
Backport of #42373 and #39818

Users have complained about performance issues on some platforms due to a change in SH Evaluation mode causing them to use PerPixel instead of PerVertex. This PR makes sure those platform use PerVertex when set to Auto.

This PR does the following: 
- Adds a few platforms to ShAutoDetect to use PerVertex when Auto is selected.
- Renames `XRPlatformBuildTimeDetect` to `PlatformBuildTimeDetect` as it's now used for more than XR.
- Fixes a few typos and indentation.
- Adds missing ScreenSpace Decals keyword when unused variants should be included in builds.
Fixes highlighting on HLSL code samples in URP Docs
…ertex is selected (UUM-63822)

Fixes UUM-63822.
This PR prevents shaders used in the SDF Baker to compile on OpenGLES3. They were not supported nor tested on this platform. This avoid getting warnings like `Shader warning in 'GenSdfRayMap': HLSLcc: The resource 'rayMap' uses an unsupported type/format for read/write access at kernel RayMapScanX (on gles3)`.

Warnings on **other platforms**, mentionned in this bug (https://jira.unity3d.com/browse/UUM-53994) are already fixed.
Warnings on GLES3 about buffer count are not fixed, and will not be fixed.
partial backport of https://github.cds.internal.unity3d.com/unity/unity/pull/36370/
Uses the new multiscattering approx to have much more efficient precomputation, and lower memory usage
*[See [this document](https://docs.google.com/document/d/1C4Vc7dOKgoZ2mNqMdugHDg-w6iN7iUYdlBQMGDmVS3E/edit) for details on what can land in 2023.3.]*

This PR fixes an issue where the correct textures set from the ShaderGraph shader are not properly updated for use in the TilemapRenderer.
This PR fixes a potential out-of-bounds buffer access in Forward+'s clustering code that caused a GPU crash on certain platforms, e.g. Metal on Apple Silicon.

There was an existing clamp that was logically incorrect. This PR corrects that clamp and adds a code comment for some reasoning behind the fix.
Add a link from the URP upgrade page back to the main manual error shader page, and back.

Jira ticket: https://jira.unity3d.com/browse/DOCG-1012
*[See [this document](https://docs.google.com/document/d/1C4Vc7dOKgoZ2mNqMdugHDg-w6iN7iUYdlBQMGDmVS3E/edit) for details on what can land in 2023.3.]*

*[Description of feature/change. Links to screenshots, design docs, user docs, etc. Link to Jira if applicable. Remember reviewers may be outside your team, and not know your feature/area that should be explained more.]*
Current trunk behavior:

https://media.github.cds.internal.unity3d.com/user/42/files/780f4466-dcdd-4f49-af9b-8a2cfed6d3a7

Even if it's technically true, it isn't really a problem for VFXPropertyBinder. They won't change by themselves and they are only modifying exposed properties of a VFXComponent.
…e Mask during normal rendering

Fixes UUM-63214
Our light masking is too complicated at the moment. Users, our own QA folks and our own engineers are confused by it. Here's quite a [highly voted feature request](https://issuetracker-mig.prd.it.unity3d.com/issues/urp-light-culling-mask-does-not-work-when-using-forward-plus-rendering-path) that asks for support in Forward+. The twist: This is already well-supported!

See below the pseudocode of how this actually works. All the complexity goes away when you ignore culling mask, which is more of a legacy concept, and always rely on the rendering layer mask, which is a newer and better feature.

```c
// Rendering the mesh
// ------------------

if (camera.cullingMask & meshRenderer.layer) {
    // Draw the mesh renderer in the game view
} else {
    // Skip drawing the mesh renderer in the game view
}

// Lighting the mesh
// -----------------

if (pipeline == Forward) {
    if (light.cullingMask & meshRenderer.layer) {
        if (light.renderingLayers && meshRenderer.renderingLayerMask) {
            // Light the mesh renderer with this light
        } else {
            // Skip lighting the mesh renderer with this light
        }
    } else {
        // Skip lighting the mesh renderer with this light
    }
} else {
    // pipeline == Deferred or pipeline == ForwardPlus
    if (light.renderingLayers && meshRenderer.renderingLayerMask) {
        // Light the mesh renderer with this light
    } else {
        // Skip lighting the mesh renderer with this light
    }
}
```

This PR makes the following changes:

1. It moves the Rendering Layers inspector field on top of the Culling Mask field. They used to be under completely different headers.
![image](https://media.github.cds.internal.unity3d.com/user/2726/files/23348727-2576-472d-ad9e-908790d97cbb)
2. It shows a greyed out Rendering Layers field even when the "Use Rendering Layers" setting is off on the URP asset. In this condition, the field was totally invsible. My change improves visibility of this feature substantially.
![image](https://media.github.cds.internal.unity3d.com/user/2726/files/bca528ae-91b8-4b68-ba05-ce62fd90c8a3)
3. If the culling mask is set to anything other than the default value of Everything, we now show a warning box advising the use of Rendering Layers instead. 
![image](https://media.github.cds.internal.unity3d.com/user/2726/files/a80c0275-5864-4a2d-a30a-87dc8bb9f8ea)
… AfterRenderingPostProcessing

This PR fixes a regression with the FinalPost pass introduced [here](https://github.cds.internal.unity3d.com/unity/unity/pull/30667)

**Details:** FinalPost is supposed to execute after the AfterRenderingPostProcessing injection point, so making sure final post is the last thing that runs before AfterRendering *Also changing the main post pass injection to "AfterRenderingPostProcessing - 1" instead of "AfterRenderingPostProcessing - 2" as there's no need to squeeze 2 passes there anymore
…y when using Alpha Clipping

This modification addresses an issue where certain alpha-to-coverage specific logic was unintentionally overwriting the alpha value utilized by transparent surfaces that also employed alpha-clipping. The resolution for this issue involves incorporating the alpha overwrite logic directly into the calculations specific to alpha-to-coverage.

Bug: https://jira.unity3d.com/browse/UUM-56601
Backport: https://jira.unity3d.com/browse/UUM-57487
…and add link from shadows page

Improvements to screen space shadows page, and add link from shadows page

We have another ticket to improve shadow pages and structure (https://jira.unity3d.com/browse/DOCG-1026), so this is just a small ticket to tidy up the page, make mobile performance clearer, and link from the main shadows page.

Jira ticket: https://jira.unity3d.com/browse/DOCG-1025
Fix Broken Links in URP Docs on the **Install URP into an existing project** page
…ctors

JIRA: UUM-61466

When motion vectors are required and a depth-less offscreen texture is used as the camera target, a default depth format should be provided to motion vectors.
…UUM-64447)

Fixes UUM-64447.
The issue was that the `_ALPHATEST_ON` keyword needs to be available in both vertex and fragment shaders in order to check if UV (TEXCOORD1) is needed or not.
@UnityAljosha UnityAljosha requested review from a team as code owners February 27, 2024 12:59
@UnityAljosha UnityAljosha merged commit 19fbb95 into 2023.2/staging Feb 27, 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.

10 participants