Skip to content

Fix procedural sky with orthographic camera #1936

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

Closed
wants to merge 2 commits into from

Conversation

EvgeniiG
Copy link
Contributor

@EvgeniiG EvgeniiG commented Sep 18, 2020

Purpose of this PR

Fix case https://fogbugz.unity3d.com/f/cases/resolve/1278013/


Testing status

Manual Tests: What did you do?

  • Opened test project + Run graphic tests locally
  • Built a player
  • Checked new UI names with UX convention
  • Tested UI multi-edition + Undo/Redo + Prefab overrides + Alignment in Preset
  • C# and shader warnings (supress shader cache to see them)
  • Checked new resources path for the reloader (in developer mode, you have a button at end of resources that check the paths)
  • Other: Manually tested the procedural sky in a simple scenario.

Automated Tests: What did you setup? (Add a screenshot or the reference image of the test please)

Yamato: (Select your branch):
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/HDRP%252Ffix-orthographic-sky/.yamato%252F_abv.yml%2523all_project_ci_trunk

Any test projects to go with this to help reviewers?


Comments to reviewers

Notes for the reviewers you have assigned.

Copy link
Contributor

@TomasKiniulis TomasKiniulis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EvgeniiG it fixes the case submitted issue, but Orthographic projection just displays the Sky in a solid color now. Which is different from what it used to be or what is now in Legacy and URP. Could the fix be done while still keeping the old way of sky displayed?

Attaching comparison results:
PR Orthographic
image
PR Perspective
image
8.1.0 Orthographic
image
8.1.0 Perspective
image
Legacy Orthographic
image

@EvgeniiG
Copy link
Contributor Author

EvgeniiG commented Sep 22, 2020

@EvgeniiG it fixes the case submitted issue, but Orthographic projection just displays the Sky in a solid color now. Which is different from what it used to be or what is now in Legacy and URP. Could the fix be done while still keeping the old way of sky displayed?

The new way of rendering the sky is correct.

Recall what orthographic projection is - you have the same single view direction for all pixels of the screen. The skybox is very far away, so the difference in pixel positions does not matter, and all pixels end up looking at the same skybox texel.

@TomasKiniulis
Copy link
Contributor

@EvgeniiG it fixes the case submitted issue, but Orthographic projection just displays the Sky in a solid color now. Which is different from what it used to be or what is now in Legacy and URP. Could the fix be done while still keeping the old way of sky displayed?

The new way of rendering the sky is correct.

Recall what orthographic projection is - you have the same single view direction for all pixels of the screen. The skybox is very far away, so the difference in pixel positions does not matter, and all pixels end up looking at the same skybox texel.

Ah right, wish it was the same between all pipelines, but that makes sense

@JulienIgnace-Unity
Copy link
Contributor

Even though it might be mathematically correct, as it stands, it makes the sky in ortho more or less unusable anyway. I think it would be worth exploring other possibilities and see if we can get a usable result.

@EvgeniiG
Copy link
Contributor Author

EvgeniiG commented Sep 23, 2020

Even though it might be mathematically correct, as it stands, it makes the sky in ortho more or less unusable anyway. I think it would be worth exploring other possibilities and see if we can get a usable result.

The legacy "orthographic" sky clearly uses perspective rendering. It's not clear how to make the UX work in that case. Also recall that we have multiple skies, so a fake perspective sky with the rest of the scene being orthographic may be questionable in some cases.

I am also concerned that we will get another bug report saying "orthographic rendering is incorrect".

@sebastienlagarde
Copy link
Contributor

Close as we used the fixed deliver in this PR instead: #2955

@sebastienlagarde sebastienlagarde deleted the HDRP/fix-orthographic-sky branch September 1, 2021 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants