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

Open
wants to merge 20 commits into
base: 2022.3/staging
Choose a base branch
from
Open

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.

…om Function node's body field

This PR fixes https://jira.unity3d.com/browse/UUM-76270.

The Custom Function node's body field was difficult to use due to a combination of broken sizing and a lack of scrollbars. This fix prevents the body field from growing beyond the inspector width, and enables horizontal/vertical scrollbars.

![image](https://media.github.cds.internal.unity3d.com/user/3965/files/053d0c59-a251-4484-b532-f72ab0f37eaf)
…ct feature UUM-76307

fix camera offset in the UI editor for the RenderObject feature UUM-76307
Jira: UUM-76346

Steps to reproduce:

1. Create a new HDRP project
2. Observe Console

Actual results: Errors are thrown to the console
Expected results: Console does not contain VFX Graph errors

Reproducible with versions: 2022.3.39f1
Not reproducible with versions: 6000.0.12f1
…a wasn't updated properly for Asset Bundles (UUM-52890)

Fixes UUM-52890
This PR fixes an issue where some leftover shadow-rendering uniforms aren't properly cleared when using the `Unlit Draw Mode` in the scene-view, leading to some visible artifacts when sampling the empty shadow-map set for this mode.
… cbuffer

Shader Graph allows to declare properties in a global context. These properties can be set from script, globally to all shaders at the same time. (see [Shader.SetGlobalVector](https://docs.unity3d.com/ScriptReference/Shader.SetGlobalVector.html for instance)).
These global properties work fine when used with a regular ShaderGraph material, but not with VFX outputs that use ShaderGraph.
The reason is that we were grouping them in a structure with the other exposed properties, when these should be read directly from the constant buffer. Just changing the declaration in the shader makes it work fine.
…erial upgrader

Fixes https://jira.unity3d.com/browse/UUM-78379.

LOD Cross-fade is a per-material keyword in BiRP, but a pipeline-wide setting in URP. Therefore, the BiRP -> URP upgrader should omit this keyword from the upgraded material. This PR adds this logic to the upgrader.
… renderContext s…

This is a manual backport of https://github.cds.internal.unity3d.com/unity/unity/pull/52682. There was a small merge conflict because the `EndCameraRendering()` callback is called inside an `if` condition in Unity 6.0, but there's no such condition in 2022.3. The intent of the original PR is to move the callback down, so that it is called after the render context is submitted. I have retained the spirit of that change in this port.
… version upgrade.

This PR is intended to remove the VCS local checkout (due to `AssetDatabase.MakeEditable`) that happened on any reimport of SG assets.

Jira: https://jira.unity3d.com/browse/UUM-17912
…e rendering.

This PR aims to fix scene-view wireframe rendering issues when using forward/forward+ and depth-priming together.

This bug was caused by depth-priming forcing the depth-test comparison function to `Equal` (instead of `LEqual` of the original wireframe-rendering shader) for opaque-rendering ([here](https://github.cds.internal.unity3d.com/unity/unity/blob/833b9fd62c679e02f6be2dc94d6150525ce88553/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawObjectsPass.cs#L218-L223)), assuming that valid depth-values would have been rendered beforehand to the bound depth-attachment. This is not the case for wireframe rendering, and thus, nothing renders.

Jira: https://jira.unity3d.com/browse/UUM-74999
…uild platforms are selected.

This PR fixes an issue in URP when selecting Switch or Android build target were forcing the camera depth render target to be reallocated every frame. 

`UniversalRenderPipelineCore.CreateRenderTextureDescriptor` by default sets depth buffer 32 bit format, however in `UniversalRenderer.CreateCameraRenderTarget` the descriptor depth buffer format is overridden to a 24 bit format when Switch or Android build targets are selected triggering depth buffer re-allocation. The change to 24 bit format was implemented in https://github.cds.internal.unity3d.com/unity/unity/pull/15935 to solve crashes and performance issues on Android, but is not necessary when running in the Editor where instead it causes unnecessary depth buffer reallocations, leading to memory leaks under certain circumstances.
JIRA:  https://jira.unity3d.com/browse/UUM-76242

An issue occurred because the API connected via Reflection was changed, causing the function to be undetectable. The code has been updated to align with the new API, and a unit test has been added to prevent future issues

Before
![Unity_LJ7DIyXku5](https://media.github.cds.internal.unity3d.com/user/761/files/e8558a2a-3547-43a3-aef1-c8e5a1c14f59)

After
![AfterFix](https://media.github.cds.internal.unity3d.com/user/761/files/b5be202a-24f6-4f30-b99c-6c3b132c2c5a)
…rrect shader code for 16-bit half precision.

JIRA: [UUM-72722](https://jira.unity3d.com/browse/UUM-72722)

This PR fixes a bug that Normal From Height node in a shader graph might return an invalid value when using 16-bit half precision.

<table><thead>
  <tr>
    <th><img src="https://media.github.cds.internal.unity3d.com/user/7006/files/2082dd6b-3b91-4f48-9c05-f440ccfea156" /></th>
    <th><img src="https://media.github.cds.internal.unity3d.com/user/7006/files/b31992b2-c6ae-45c9-989e-bacd86ac97c3" /></th>
  </tr></thead>
<tbody>
  <tr>
    <td>before</td>
    <td>after</td>
  </tr>
</tbody>
</table>
…backup' errors on entering Playmode with shader graphs open.

JIRA: [UUM-71052](https://jira.unity3d.com/browse/UUM-71052)

This PR fixes 'Objects are trying to be loaded during a domain backup' errors due to invalid serialization within SerializableTexture. One possible case is, as reported in JIRA, entering Play mode with PhysicalHair_Cards shadergraph from HDRP material sample open.
…Name.

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

Added a displayName to AbstractMaterialNode to use when displaying it in the Graph Inspector. displayName defaults to name, and is overridden by BlockNode to create it using shaderStage and displayName.
![image](https://media.github.cds.internal.unity3d.com/user/761/files/74c417ea-4dc5-43e9-8637-65ecb678eb63)

The changed name looks like this:
<table>
<tr><th>Before</th><th>After</th></tr>
<tr><td>VertexDescription.Position Node</td><td>Vertex Position Node</td></tr>
<tr><td>VertexDescription.Normal Node</td><td>Vertex Normal Node</td></tr>
<tr><td>VertexDescription.Tangent Node</td><td>Vertex Tangent Node</td></tr>
<tr><td>SurfaceDescription.BaseColor Node</td><td>Fragment Base Color Node</td></tr>
<tr><td>SurfaceDescription.NormalTS Node</td><td>Fragment Normal (Tangent Space) Node</td></tr>
<tr><td>SurfaceDescription.Metalilc Node</td><td>Fragment Metallic Node</td></tr>
<tr><td>SurfaceDescription.Smoothness Node</td><td>Fragment Smoothness Node</td></tr>
<tr><td>SurfaceDescription.Emission Node</td><td>Fragment Emissiton Node</td></tr>
<tr><td>SurfaceDescription.Occlusion Node</td><td>Fragment Ambient Occlusion Node</td></tr>
</table>
…nfinity

This PR fixes a freeze when the `Camera farClip` is set to `Infinity`.

Basically, the Light Forward+ algorithm was freezing the editor because the farClip becomes negative, which is not a valid scenario, so most of the calculations are not ending (freeze).

Clamping it to a minimum value of 0 fixes the freeze without any drawback.
…d boundaries.

Jira: [UUM-70628](https://jira.unity3d.com/browse/UUM-70628)
Parent PR: [#48000](https://github.cds.internal.unity3d.com/unity/unity/pull/48000)

As reported in JIRA, the sun flicker problem occurs when the directional light is close to cloud boundaries. This can only be reproduced if `perceptual blending` is enabled on volumetric clouds. The transmittance of each pixel changes every frame due to ray marching noise and temporal reprojection. When perceptual blending is enabled, it divides the transmittance by the current luminance of the target pixel, so it reduces the RGB value dramatically when the luminance is really high.

![image](https://media.github.cds.internal.unity3d.com/user/3842/files/c2c067db-d228-4500-b28d-4f9d0295c004)

When the `perceptual blending` is disabled, we simply use the original input transmittance, so that neighboring pixels have slightly different values. However, we reduce the transmittance by luminance when `perceptual blending` is enabled. This causes a huge pixel value change for neighboring pixels at the cloud boundaries, so the sun flickers.
![image](https://media.github.cds.internal.unity3d.com/user/3842/files/06816951-ac8b-4523-a0e6-36db227fc146)

By softening the transmittance attenuation curve with a `pow(transmittance, 6)` clamp, we can prevent sun flicker and slightly improve the perceptual blending where the sun is behind the clouds.
![image](https://media.github.cds.internal.unity3d.com/user/3842/files/cce785be-a336-48b9-871b-aa53443c58b2)


| Before | After |
| -- | -- |
| ![image](https://media.github.cds.internal.unity3d.com/user/3842/files/594c9648-dd7e-4fa0-aa72-4f4cd3643ac3)|![image](https://media.github.cds.internal.unity3d.com/user/3842/files/cb52d81c-82c6-4b7a-bdff-d8dda24d7bf6)|
@UnityAljosha UnityAljosha requested review from a team as code owners September 19, 2024 09:06
Copy link

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!

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