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

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

…lighted border after click

Repo steps:

Open unity scene (HDRP)
Right click project window > Create > Visual Effects > Visual Effect Graph
Create a graph and name is anything 
Click the Question mark icon on the top left of the viewport
The documentation page should open, navigate back to the unity project and notice the button is still selected by indication of the blue light
Expected result: No selection left on button

Actual result: Blue selection indicator on button

Reproducible with: 2022.2.13f1, 2023.1.0b15, 2023.2.0a14
Cannot test with: 2020.3.46f1, 2021.3.21f1 (Due to functionality not existing) 

Platforms tested: Win 11
![screenshot](https://jira.unity3d.com/secure/attachment/875249/UI%20Questionmark%20bug%20.png)
… VFXView

Jira: https://jira.unity3d.com/browse/UUM-28528

Steps to reproduce:
- Open the VFX "No Asset" window (menu `Window`->`Visual Effects`->`Visual Effect Graph`)
- If the blackboard is not opened, open an existing VFX (or create a new one) and open the blackboard, then close and reopen the "No Asset" window.
- Click on the [+] button in the blackboard
<img width="902" alt="Unity_BOeC0iinDa" src="https://media.github.cds.internal.unity3d.com/user/4003/files/60fd3daf-99c9-499a-a652-ebdface369e5">
=> An error is thrown in the console

The fix for this issue is to disable the [+] button for the "No Asset" window.
<img width="670" alt="Unity_leeT7chM2m" src="https://media.github.cds.internal.unity3d.com/user/4003/files/b9cd40fd-dcb7-4587-ad82-50d3cd5ae8b6">

### 🎁 Gift improvement
Looking at the screenshots above I noticed that the "Create new Visual Effect Graph" button was squashed when the window is too small. So I did a few changes to fix that. See the videos below.
**Before**
![Unity_GP4bVeUqzN](https://media.github.cds.internal.unity3d.com/user/4003/files/13642625-3f18-4942-a871-3014df0b589d)
**After**
![Unity_Y0k41vtIWt](https://media.github.cds.internal.unity3d.com/user/4003/files/1e5770cc-1916-480d-818d-1886e54af830)
…using different textures or graphic buffers

VFX Instancing allows to batch several VisualEffect components together to process their compute shaders with a single dispatch, and to render them together to save CPU time preparing the drawcalls.
Previous to this PR, it is possible to batch VisualEffect with different values in exposed properties, as long as those properties are not textures, meshes, or graphic buffers, that require different bindings. When a VisualEffectAsset detected a variable expression with type of one of those objects, instancing was disabled.
This PR enables instancing again for those cases, and allows the compute shaders to group instances based on the values of such variable objects in that specific compute shader. This PR does not handle this scenario for drawcalls in an optimal way, so they still have to be rendered one by one as if they were not batched.

![image](https://media.github.cds.internal.unity3d.com/user/2805/files/93053056-26ac-4aae-bb84-be73714a4021)


For instance, if there is a VisualEffectAsset with an exposed texture that is being used in the Update context, and a few VisualEffect of that type, with some of them overriding the texture, the batch will be processed like this:
- Init compute shader will be processed at the same time for all the instances, as it is not using the exposed texture.
- Update will be split in several dispatches, one for each different value of the exposed texture. Between each dispatch we only have to upload the instance active indirect and the instance prefix sum (if needed) and to bind the corresponding texture.
- OutputUpdate, if present, will also be processed at the same time for all the instances, if it is not using the exposed texture.
- Rendering will be batched for all instances, as the exposed texture in this example is not used in rendering.

![image](https://media.github.cds.internal.unity3d.com/user/2805/files/a2fc8d3a-3cb1-4a74-ba2d-0e5690a73f3b)
![image](https://media.github.cds.internal.unity3d.com/user/2805/files/f8d89471-49cb-41cf-a86e-d134225a9e9b)
![image](https://media.github.cds.internal.unity3d.com/user/2805/files/302d7986-b409-44af-a31f-5070a9047549)

However, if we have the same exposed texture being used by the Output context:
- Init and Update computes will be processed each of them as a single dispatch
- OutputUpdate will be split in as many dispatches as different texture values are used by the VisualEffects.
- Rendering of instances with the default value will be processed together. VisualEffect instances with an overriden value will be processed ONE BY ONE, regardless of how many of them are using the same texture. This will be addressed in a separate PR.

![image](https://media.github.cds.internal.unity3d.com/user/2805/files/0d345892-b26f-4e04-8ce9-c158321279f6)
![image](https://media.github.cds.internal.unity3d.com/user/2805/files/70053fc8-9592-464c-b52c-7f8c7ea05b54)
![image](https://media.github.cds.internal.unity3d.com/user/2805/files/ed536cd0-3e5a-4f40-91ef-77fd9fc8a669)

Apart from those changes, this PR includes some improvements to VFX culling and some fixes.
Bump SRP packages to 15.0.7
This PR is mainly addressing an issue about creating subgraph with incompatible port. This issue has been solved by d83b214482e58ec3f72935e31e8f758ce3c240a8 and additional condition `newTargetParameter.type == linkedParameter.parentController.model.type`

The unexpected exception while creating a subgraph was creating a dangling state and corrupted graph leading to a crash in `VFXMemorySerializerBindings::StoreObjects` (when a dependencies is `null` for whatever reason).

I used this opportunity to handle this most obvious failure throwing an exception in C#. It won't solve all issue but prevent unexpectedly exiting Unity in that case.

Bonus after discussion, solving UUM-40383 Missing link on activation slot.
Remove unexpected scene tab while clicking on object picker.

Probably indirectly introduced by the removal of custom object field https://github.cds.internal.unity3d.com/unity/unity/pull/24016
Fix rendering issue with WebGL on Apple M1/2 processors (Macbook, iPhone) when URP Depth Priming is enabled.

Because Depth Priming is questionable on WebGL, due to that WebGL builds can run on both desktop and mobile, it seems reasonable to just disable depth priming all together for WebGL.
Fix unexpected missing refraction property in some case of VFX.

Issue introduced at https://github.cds.internal.unity3d.com/unity/unity/commit/7986ee8ea4efd9647658ebfd201837e76f6716ef
As commented in code, this special additional check is only needed because VFX is taking a shortcut.
gathering of PRs

Improve computation of hashCode for animationCurves (#35356)
Add warning message in light cluster override UI if raytraycing is off (#35343) 
Fixed an issue where non directional light could react to "interact with sky" flag. (#35349) 
[HDRP] HDRP Wizard Warning Non-Built-In Materials (#35263) 
ensure camera are valid before destroying (#35491)
Fix the SetData error by adding a max light count + by fixing the Assert (wasn't working) (#35305)
fix refcounting and cleanup of skyContext when renderer changes (#35437)
[HDRP] Fixed cascaded shadowmaps cascade borders and blending issue with shadow mask (#35432)
This PR fixes transparent materials never disappearing from the "Save Assets" window popup even after clicking "Save All"

Details:
*The keyword state for `_ALPHAPREMULTIPLY_ON` was being disabled and then enabled again, this was causing the material to get marked as dirty
*For this reason now we make sure to only call `SetKeyword` once at the end instead of calling `DisableKeyword` and `EnableKeyword` for transparent materials (the material should not get marked as dirty if the state doesn't changed from what it was set to before)
This PR simply adds one line about the projection axis of the decals.
@UnityAljosha UnityAljosha requested review from a team as code owners October 9, 2023 13:25
@UnityAljosha UnityAljosha merged commit 2c80a82 into 2023.1/staging Oct 9, 2023
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.

9 participants