Neopallium / bevy_water

Dynamic ocean material for Bevy.
https://neopallium.github.io/bevy_water/
116 stars 11 forks source link

Support terrain heightmap in WaterMaterial. #21

Open Neopallium opened 1 year ago

Neopallium commented 1 year ago

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.
noebm commented 1 year ago

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

Neopallium commented 1 year ago

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

noebm commented 1 year ago

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

Neopallium commented 1 year ago

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.