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.1/staging #7977

Merged
merged 6 commits into from
Oct 16, 2023
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.

gabrieldelacruz and others added 6 commits October 9, 2023 11:51
…ystems

Trying to access VFX renderer materials from scripts currently return a variable number of materials, depending on the number of active systems.
This behavior is a side effect of an optimization, and it seems to be less intuitive than returning the entire lists of materials.
We are restoring the previous behavior (return the entire list) while implementing an alternative optimization.

The original problem:
- VFX with sleeping systems still set up the shader, even though they will not be rendering anything
- Renderer nodes by default create one "drawcall" per material, but it is possible to change it in the renderer.
- SRP renderer can handle a number different from the material count, but editor rendering (picking, selection) can not.

First optimization:
- Renderer node uses a variable number of materials (GetMaterialCount and GetMaterial are virtual), only counting the materials of systems that are active.
- Works with SRP renderer, that can handle a variable number of drawcalls, and the editor renderer, because the material count now matches the active
- "materials" and "sharedMaterials" use the same functions, so the number of materials returned is variable, depending on the active systems

New optimization:
- Renderer node uses one "drawcall" per material, default behavior for renderers
- Inactive systems replace the material data with a special material that is not using any passes, so it gets ignored by all renderers
- "materials" and "sharedMaterials" go back to default behavior. The special empty material is not included in these lists
…FX when needed

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

🎮To reproduce:
1. Open Unity and create the new "2D URP" project
2. Install the Visual Effect Graph from the Package Manager
3. In the Project View Right-Click and select Create > Visual Effects > Visual Effect Graph
4. Leave the default "New VFX" name and confirm it with the Enter button
5. Open the "New VFX.vfx" Asset in Visual Effect Graph Window
6. Under Output Particle Quad node, select Shadergraph
7. Ensure the filter has the "Show Packages results" field enabled to see the default VFX Shadergraph

 
👍Expected result
In the "Select VFX Shader Graph" window you can see the "VFXSpriteLit" and the "VFXSpriteUnlit" Shader Graphs
👎Actual result
In the "Select VFX Shader Graph" window you can't see Shader Graphs just the "None" option

🔸Notes:
I’ve only managed to select those VFX Shader Graphs (the "VFXSpriteLit" and the "VFXSpriteUnlit") when I’ve copied them into the Project Asset directory

🏷Reproducible in Unity
`2022.2.0a16`, `2022.2.0b6`, and `2023.1.0a8`

💬Developer notes:
The issue happens because these ShadeGraph assets were already imported when the Visual Effect package is installed. So VFX code do not re-import them. But when they were first imported, the needed `ShaderGraphVfxAsset` resource had not been generated (because the VFX package was not installed yet).

We already have a mechanism to re-import VFX assets when the package version change (which happens on package installation). So the fix rely on this mechanism and in addition to re-importing VFX assets we also re-import ShaderGraph (only those that are compatible with VFX).

The symptom of this issue can be checked looking at the Shader asset like in the screenshots below
<img width="158" alt="Unity_IHgBLIm0xt" src="https://media.github.cds.internal.unity3d.com/user/4003/files/b585ca15-49f6-44d6-93b9-a0d02eb3a374">
But we expect this:
<img width="186" alt="jZuk0ULmGx" src="https://media.github.cds.internal.unity3d.com/user/4003/files/49ae171e-5759-4273-9513-d9f930a8ca7f">
…acing light list

This is a backport based on https://github.cds.internal.unity3d.com/unity/unity/pull/35672 for branch 2023.1/staging.

This PR is in response to this bug-report: https://jira.unity3d.com/browse/UUM-47230

The artefacts reported are caused by a limit on the maximum number of lights in local neighborhoods in the path tracer. This PR allows users to change this limit through [the shader config mechanism](https://docs.unity3d.com/Packages/[email protected]/manual/HDRP-Config-Package.html).
…ip temporal upscalers and TAA

Adding new checkbox to allow materials to be excluded from temporal anti aliasing.
For now, this checkbox is only exposed to transparent materials since they are the only ones that can fit a stencil bit for such operation.

The materials that go through this path will generate a special mask (stencil or a bit mask in DLSS) that just performs spatial upscaling.

This checkbox is ideal for surfaces that contain texture scrolling that has to be neat and does not have velocity information.

Comparison (left is flag off, right is flag on, notice the scrolling is more clear and less blury than the one in the right):
![bluryTextureScroll](https://media.github.cds.internal.unity3d.com/user/3327/files/e1f0a283-e471-4f91-a015-f874da0915db)

![image](https://media.github.cds.internal.unity3d.com/user/3327/files/76046247-c229-4e9d-abda-dba342fdfc23)
Fixed Layered Lit Displacement
@UnityAljosha UnityAljosha requested review from a team as code owners October 16, 2023 09:40
@UnityAljosha UnityAljosha merged commit c1f9ff1 into 2023.1/staging Oct 16, 2023
2 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.

7 participants