bevy_water icon indicating copy to clipboard operation
bevy_water copied to clipboard

Support terrain heightmap in WaterMaterial.

Open Neopallium opened this issue 2 years ago • 4 comments

Having access to a terrain heightmap would allow:

  1. Nicer waves on shorelines/beaches.
  2. Breaking waves (Surfing?).
  3. Water color based on depth. (Done via DepthPass support). Water depth color is relative to the viewer, so needs the view depth texture.
  4. Waves breaking against cliff faces.

Neopallium avatar May 17 '23 11:05 Neopallium

Sounds good. Does that work with the predefined wave function?

noebm avatar May 17 '23 15:05 noebm

For point 3, that is just the color (darker for deeper water). For the other points it would need to change the wave function.

Neopallium avatar May 17 '23 15:05 Neopallium

Regarding 3. could you use the pbr fog for that?

noebm avatar May 18 '23 11:05 noebm

Ah. That might work too. I also want to use the "fog" effect when the camera is below the surface. Right now the space below is just empty. Not sure if the bevy PBR fog can be used for the "water fog", since it needs to only be applied below the surface. But it should be possible to reuse/adapt that code to do it.

Neopallium avatar May 18 '23 12:05 Neopallium