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

Merged
merged 59 commits into from
Aug 7, 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.

ellioman and others added 30 commits June 9, 2023 00:45
…s of URP/Lit

In 2D projects, the Universal2D pass of the URP/Lit shader is used. Before this PR, that pass does not support DOTS_INSTANCING_ON. SpriteRenderer is still not supported in Subscenes with this PR, but MeshRenderers in 2D projects will work inside Subscenes.

Parent: https://jira.unity3d.com/browse/UUM-34465
Forward Port: https://jira.unity3d.com/browse/UUM-34768
Regular docs sync to main.
The `Resolution` selection on Reflection Probes and Planar Reflection Probes where only respected when using the `Realtime` rendering mode. When using the `Custom` mode, the original size of the texture was used for atlasing and the only want to change that would be to updated the texture itself. Now each probe can dictate what resolution it should be used at for atlasing.
Backport of https://github.cds.internal.unity3d.com/unity/unity/pull/28841 for UUM-35335

Some of our passes render y-flipped. In those cases we must also use a flipped rasterization rate map.

Bug: UUM-35335
Backport: UUM-35336
…sset is missing

Jira: UUM-26966

Refers to this discussion: https://unity.slack.com/archives/C1R2CL5S6/p1674863130924059
When a VFXPointCacheOperator operators refers to a missing point cache asset, a NRE is thrown.

Steps to reproduce:
- Create a new VFX graph
- Add a "Point Cache" operator
- Select any point cache asset in the operator
- Delete this point cache asset in the project browser
- Save the VFX Graph
=> Error message in the console
This PR adds support to the DebugReplacement shader to allow for use with a subscene.

The changes made here are similar to those in MaterialError.shader and FallbackError.shader.

Bug case: UUM-34053
Port case: UUM-36065
Regular docs sync to main
…UI with sorting order greater than 0

The sort order of the debug UI canvas was initially set to 0. Therefore, whenever a user had a UI element with a higher sort order, it would be drawn on top of the debug UI, which was meant to overlay everything else.
This PR fixes the above issue.

Bug: UUM-26782
Backport: UUM-36608
gathering of PRs

Fix dependencies (#30171)
Removing unnecessary Indent scope (#30305)
Added a new injection point: AfterOpaqueAndSky in custom passes (#30293) 
return defaultshadowtexture instead of whiteTexture (#30233)
Fixed baked light being wrongly put in the cached shadow atlas. (#30427) 
Multiple dlss fixes for ghosting and camera cuts (#30373)
Remove UV usage from texture size node (#30324)
Add a warning message when there is no collider in local custom pass volume (#30271)
Fixes for selecting multiple lights of different types (#30193)
Respect transparent reflection settings in RT (#30156)
Turning off use of denoising package when not in win_64 (#30263)
Skip vo if distance is 0 (#30353)
Show base color if Affect BaseColor is disabled (#30129)
Fixing wrong pragma renderers (#30774)
This PR fixes, reimporting the VFX assets whenever we are entering or exiting from the Play Mode.

Bug:https://jira.unity3d.com/browse/UUM-17548
Backport:https://jira.unity3d.com/browse/UUM-36799
…g inappropriately

Simple backport of https://github.cds.internal.unity3d.com/unity/unity/pull/30300

--

Slack discussion: https://unity.slack.com/archives/C89KFUUCT/p1685577944692799

The following warning is logged when you build the project in Development Mode, if you also have "Strip Runtime Debug Shaders" checked in URP/HDRP Global Settings: `Stripping Runtime Debug Shader Variants, you won't be able to use some features of the Standalone Rendering Debugger.` However, the log message was printed after checking `Debug.isDebugBuild` which is a broken API that sometimes gives the wrong value in the editor, causing the message to appear sometimes even if Development Mode is not checked in Build Settings.

This PR fixes the issue by checking for Development Build using the BuildReport instead. Also, the warning is downgraded to info message because it can be valid to make dev builds without debug shaders (to speed up the build).
…HDRP.

The issue lies in HDRP's metapasses, where camera-relative rendering is only partially utilized. As a result, the accurate resolution of world space positions becomes compromised. This inaccuracy becomes apparent when using Planar Projection and Triplanar Projection for UV mapping, as these methods heavily rely on correct world space positions. Consequently, incorrect UV coordinates are generated, leading to undesired visual artifacts.

This PR avoid using camera-relative rendering throughout the metapass in HDRP's metapasses.

Bug: https://jira.unity3d.com/browse/UUM-22089
Backport:https://jira.unity3d.com/browse/UUM-22090
Regular Docs Sync to Main
…RPGlobalSettings a…

As there is not a built-in mechanism to tag a Compute Shader, in Cross Pipeline projects, or when building for Built-in when HDRP is installed. All the ComputeShaders from HDRP are not being stripped.

This makes the build time to increase by a lot, specially with the ~2k variants that the Deferred.compute is generating.

Making it unbearable  to build the project for URP when HDRP is installed.

Basically, this is a valid workarround until we have a way to know which ComputeShaders belong to HDRP without needing to fetch them from the Global Settings.
…l camera size

Bug fix for [UUM-36231](https://jira.unity3d.com/browse/UUM-36231).
Screen space - Overlay UI, when rendered by the SRP, was using the camera intermediate target texture size rather than the real size. This meant the overlay UI was affected by the render scale, this is an issue when the scale mode is "Constant Pixel Size" or "Constant Physical Size". This happened for the HDR debug views too, creating multiple issues with cropped images.

To fix this, we pass the camera target's pixel size to the UI render target, instead of the camera target width/height that's been scaled. The handling of the depth render target had to be fixed as a consequence, we can't be using the intermediate depth target because the scale differs and it turns out the UI need a depth render target (it can read/write to the stencil for masking effects).
When rendering the overlay UI off-screen, we use a new `_OverlayUITexture_Depth` texture. When rendering on-screen, we use either the depth back buffer texture or the new `_DebugScreenDepth` texture (for the HDR debug views).
… enabled

To backport the fix for an issue where Errors are thrown when the Native RenderPass option is enabled

*Bug: https://jira.unity3d.com/browse/UUM-28953
*Backport: https://jira.unity3d.com/browse/UUM-31131
…oved while in play mode

Backport of PR https://github.cds.internal.unity3d.com/unity/unity/pull/31868

Fix for https://jira.unity3d.com/browse/UUM-37148

If user is using Old Input Manager, and removes the debug actions from Project Settings > Input Manager, errors are printed due to exceptions thrown by the system. This PR fixes that by catching those exceptions.
…with "Accurate G-buffer normals" enabled

To add a missing #pragma multicompile _ _GBUFFER_NORMALS_OCT to the URP Fullscreen Shader Graph target to fix normal decoding when using the URP Sample Buffer node to get normals when Accurate G-Buffer normals is enabled on the renderer

* Bug: https://jira.unity3d.com/browse/UUM-33434
* Backport: https://jira.unity3d.com/browse/UUM-33439
… scattering

https://jira.unity3d.com/browse/UUM-33755
We were getting fireflies in path traced volume scattering. 
The proper fix is to use MIS, something that @henrik-dahlberg [added ](https://github.cds.internal.unity3d.com/unity/unity/pull/19749) for 2023.2. This is just a backport of that PR.
…sset

Backport, fix, Console error when selecting SRP Lens Flare asset
This PR backports 3 small PRs from trunk into 2023.1

PR #26139
Fix Color Pyramid History Buffer Logic

PR #25921
Remove Unnecessary Vertex Attributes in Depth Only Passes

PR #20183
Remove GPU Threading Test AsyncReadback Workaround
RobJessop and others added 26 commits July 10, 2023 13:13
…own when enabling Opaque Texture, using the Hierarchy search bar, and viewing the Scene tab in Play Mode

The issue is, ArgumentNullException and Assertion failed errors thrown when enabling Opaque Texture, using the Hierarchy search bar, and viewing the Scene tab in Play Mode.

This PR will fix the above issue and make sure no console errors occurs.

Bug:https://jira.unity3d.com/browse/UUM-36458
Backport: https://jira.unity3d.com/browse/UUM-39538
Backports of
- #30946 (UUM-39831)
- #28955 (UUM-34728)
Regular docs sync to main.
Fix performance issue with light batching
Fix exception for missing _Color Shader Property.
… in a lower QualitySetting (UMM-41531)

Resolves an Issue where a user wouldn't be aware that baking reflection probes in a lower quality setting would mean that the baked resolution was the highest they'd have available in their project.
Regular docs sync to main.
https://jira.unity3d.com/browse/UUM-41157
[backport] Fixed a GPU crash on Nintendo Switch when sampling probe volume in the pixel shader.
The issue was that a structured buffer was sampled out-of-bounds (_APVResCellIndices), which is normally avoided using branching. However, when compiling for Nintendo Switch the condition is flattened, most likely using a step() pattern (common "bug" with HLSLcc). To avoid this, we need to extract the condition and force a dynamic branch.
* Fixing FTLP (Fine Tiled Light Pruning) Shader Options max light count. 
* Previous support only supported up to 63. These changes allow to go up to 255 with higher instability as numbers per tile approach 255.

* Bug: https://jira.unity3d.com/browse/UUM-39924
* Backport: https://jira.unity3d.com/browse/UUM-39941
Fix URP data-drive lens-flare y-flips on OpenGL/WebGL. WebGL flares match now the Metal/new gfx APIs.
Fix URP data-driven lens-flare occlusion on OpenGL/WebGL. Added a missing OpenGL keyword in the URP .shader file.
…isposal

https://jira.unity3d.com/browse/XPIPELINE-623
https://jira.unity3d.com/browse/UUM-20646
The behavior described in the bug is actually correct. Unfortunately there is no clear way around to understand when pipeline constructed. We introduced these 2 callbacks so any subsystem interested in a point right after creation or disposal of pipeline can subscribe to it and do related logic.

We also deprecate `beginFrameRendering` and `endFrameRendering` as these 2 callbacks duplicate `beginContextRendering` and `endContextRendering`. The only diffirence that deprecated ones return Array and new ones return List. As we switch to Render method with List of Camera I think it makes more sense to keep the latter.
I also re-arranged so they behave kind of like a scope.

I set `s_CurrentPipelineType` to `k_BuiltinPipelineName` by default. Otherwise it will trigger `activeRenderPipelineTypeChanged` after re-compilation.
… Buffers and Upscaling - UI null checks - Exposed Texture Instancing bug

This PR fixes several bugs : 

- [UUM-41037](https://jira.unity3d.com/browse/UUM-41037) : Texture names in the Uniform Mapper were shared between contexts if a texture slot was linked to several contexts texture slots. 
- [UUM-546](https://jira.unity3d.com/browse/UUM-546) : When using DRS (Dynamic Resolution Scaling), the effective size of the camera buffers is small than what is returned by `pixelDimensions`. Here, we add another component to the Camera type : `scaledPixelDimensions`. This one takes the DRS scaling into account, and is now used for blocks and operators sampling the camera buffers.
The HDRPCameraBinder is also updated to fill out this entry, and the documentation of the Camera type was updated.

- [UUM-41333](https://jira.unity3d.com/browse/UUM-41333) : Some combination of multi-view + sub-graphs + asset deletion were causing an exception. The controller of VFXComponentBoard was still referencing a VFXViewController that was destroyed

- https://github.cds.internal.unity3d.com/unity/unity/pull/30357#discussion_r480034  : The renderer's custom properties should be reset when recompiling the graph. Otherwise, when switching from an exposed texture to an unexposed one, the exposed texture will still be used.  This needs to be included in the backport PR of https://github.cds.internal.unity3d.com/unity/unity/pull/30357

- [UUM-41091](https://jira.unity3d.com/browse/UUM-41091) : This PR fixes the computation of the worldToDecal matrix when the system is in world space, by taking into account the camera-relative translation of the world space
…nsity multiplier during bakes

Mixed runtime lights were not considering the intensity multiplier during bakes. These changes fix this behaviour and make bakes more intuitive.
@UnityAljosha UnityAljosha requested review from a team as code owners August 7, 2023 12:12
@UnityAljosha UnityAljosha merged commit eb138e3 into 2023.1/staging Aug 7, 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.