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/2021.3/staging #8114

Merged
merged 6 commits into from
Dec 17, 2024
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.

markg-unity and others added 6 commits November 5, 2024 14:28
Jira : [UUM-83862](https://jira.unity3d.com/browse/UUM-83862)

The 'resolution' field of the Reflection Probe is an integer, but it is displayed as an enum value (256, 512, etc.). When comparing two resolution values, they should be treated as integers, but they were being treated as enum values.
Jira: https://jira.unity3d.com/browse/UUM-76254

Group position is adjusted as elements are added to it. However, if the group is empty, its position remains unchanged and is pasted at the original location. This has been fixed so that the group's position is adjusted when pasting, even if the group is empty.

While fixing this issue, I discovered and resolved a problem where the position of a newly created group was not being set initially


Before
![Before](https://media.github.cds.internal.unity3d.com/user/761/files/2a5877b8-75ae-4944-8290-f21ae3dfa098)

After
![After](https://media.github.cds.internal.unity3d.com/user/761/files/0dbdf1f9-f095-4c5f-bfb9-c23f406c7576)
…re node in Shade…

UUM-90053: Prevent shader warnings when using  the NormalFromTexture node in ShaderGraph
Jira: [UUM-72279](https://jira.unity3d.com/browse/UUM-72279)

As reported in JIRA, the Scene view flickers due to `NaN` output from the hair shader. It is because in `GetHairAngleWorld`, `angles.sinThetaI` can exceed the range [-1, 1] depending on the input hair `normalWS`. (The `L` vector may not be a unit vector in some cases.)
* `half3x3 localToWorld = GetLocalFrame(bsdfData.normalWS, bsdfData.hairStrandDirectionWS);`
* `half3 L = mul(localL, localToWorld);`

I was able to see that this `NaN` problem could happen if both `T` and `L` vectors are a unit vector due to precision. `angles.sinThetaI` can slightly exceed 1.0 so the `FastASin` result will be `NaN` in this case.

![image](https://media.github.cds.internal.unity3d.com/user/3842/files/f49cd338-9620-4d69-84e3-c9248bfb8a87)

By explicitly clamping the angles, we can prevent `NaN` output from `FastASin` calculation.
@UnityAljosha UnityAljosha requested review from a team as code owners December 16, 2024 14:08
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!

@UnityAljosha UnityAljosha merged commit b881bd6 into 2021.3/staging Dec 17, 2024
4 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.

4 participants