Neopallium / bevy_water

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

Customization of waves #2

Open EmiOnGit opened 1 year ago

EmiOnGit commented 1 year ago

First of, this is a really cool project!

I think the project currently lacks the ability to customize the waves

It seems the current state is that only the height of the waves is changeable.

Options that I think are needed:

Color including the opacity

In a stylized game, the water might be unnaturally colored. In swamp regions the water should be able to be dirty brown without the ability to see the ground In tropical regions the water should be able to be a bit more greenish with the ability to be partly transparent

Speed of the wave

If someone wants to create water with stronger wind, the speed of the waves is at least as important as the height

Move/wind direction?

Wouldn't consider this one strictly needed but I think it would be nice

Neopallium commented 1 year ago

There are a lot of improvements that I would like to make to the water shader. The biggest one is improve the coloring/texture of the water to make it look better. I don't have a lot of experience with making shaders, so I had to learn a lot to get this far.

Neopallium commented 1 year ago

Color including the opacity

In a stylized game, the water might be unnaturally colored. In swamp regions the water should be able to be dirty brown without the ability to see the ground In tropical regions the water should be able to be a bit more greenish with the ability to be partly transparent

All of the fields from StandardMaterial have been added to WaterMaterial, to allow modifying any standard PBR material setting. I exposed all of those fields to allow any customization via PBR settings to the water, which should help with making the water match a game style.

Also there is deep_color and shalow_color to control the color range based on water depth (requires DepthPrepass, see examples/ocean_depth_pass.rs).

Speed of the wave If someone wants to create water with stronger wind, the speed of the waves is at least as important as the height

The wave speed parameters haven't been exposed yet, but there is amplitude now, which can help with making the waves smaller/bigger. The height fields was just for the base water height.