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

Water Reflections break on Camera Yaw/Roll rotation #105

Closed
JamesTKhan opened this issue Oct 15, 2022 · 2 comments · Fixed by #162
Closed

Water Reflections break on Camera Yaw/Roll rotation #105

JamesTKhan opened this issue Oct 15, 2022 · 2 comments · Fixed by #162
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@JamesTKhan
Copy link
Owner

Describe the bug
Water reflections break when the camera view is rotated on X or Z axis. Reflections only invert the pitch currently.

To Reproduce
Steps to reproduce the behavior:

  1. Load into a runtime project with water
  2. Rotate camera (cam.rotate(Vector3.Z, 50);)
@JamesTKhan JamesTKhan added bug Something isn't working help wanted Extra attention is needed labels Oct 15, 2022
@antzGames
Copy link
Collaborator

antzGames commented Apr 19, 2023

Here is the issue captured in a video showing a camera Z rotation: https://imgur.com/a/8rsZ14L

I emailed ThinMatrix, and he confirmed that his reflection solution does not handle pitch/roll of the camera.

@antzGames
Copy link
Collaborator

antzGames commented Apr 19, 2023

Email from ThinMatrix:

Hey Anthony,

The code I made in the tutorials doesn't take camera roll into account, which is why the reflection gets messed up. It shouldn't be too hard to add it to the calculations though. However, I have to admit it's been many many years since I worked on water reflections so I can't think how to do that off the top of my head right now. I guess you'd have to apply the roll (maybe inverted?) to the camera when you invert it for rendering the reflection pass. Something like that. Maybe you can find the solution online - it's a fairly common technique so there should be plenty of resources out there.

Hope you find a fix,
Karl

@JamesTKhan JamesTKhan linked a pull request Apr 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants