crest icon indicating copy to clipboard operation
crest copied to clipboard

Foam does not respect floating origin on Y axis

Open Revmatek opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues.

Have you checked the documentation to resolve your problem?

  • [X] I have read the linked documentation and could not resolve my issue.

Current Behavior

Negative values below -1000 cause foam to appear constantly.

Expected Behavior

Foam should appear normally at any Y value (or at least with any floating origin Y)

Steps To Reproduce

  1. Open the BoatWakes scene
  2. Lower the Ocean GameObject to Vector3(0, -1000, 0)
  3. Observe foam everywhere image

Unity Version

2021.3.26

Crest Version

4.19

Render Pipeline

Built-In

Editor or Standalone

Editor (Edit Mode), Editor (Play Mode), Standalone

Environment

No response

Anything else?

This seems to be broken for floating origin support. Seems to be related to k_DepthBaseline / CREST_OCEAN_DEPTH_BASELINE. It is unclear if increasing those values is a viable short term solution.

Revmatek avatar Aug 08 '24 19:08 Revmatek

Thank you for reporting. Can you please test the linked PR below?

magenta404 avatar Aug 14 '24 06:08 magenta404

Thank you for reporting. Can you please test the linked PR below?

Will do.

Revmatek avatar Aug 14 '24 13:08 Revmatek

Thank you for reporting. Can you please test the linked PR below?

Thanks!

It seems to be working as far as I can tell.

I did also test with underwater transparency briefly (seems fine), but I have not integrated that yet because I have extra work for above water transparent objects in my backlog related to that (clouds, particles, etc.).

Comments

  • CREST_OCEAN_DEPTH_BASELINE is no longer used?
  • Example FloatingOrigin / ShiftingOrigin script could be updated to include y-axis.

I would double check every y usage, not just for this changeset, the whole baseline. Anything that has a default y value of any kind should problably initialize to the floating origin offset Y instead of 0 or some other constant. I had many spots in my code I had to fix for this because I had not initially intended to support it, but later extended the skybox. For example someY = 0, 1000, 100, etc. 0 may actually be -1000 or something with the offset. Even if it does not cause problems it may be better for consistancy to init to the correct value and in the event that default value is used it will not be 0 when it should be -1000 with the offset.

Revmatek avatar Aug 14 '24 15:08 Revmatek