MegaGlest / megaglest-source

MegaGlest real-time strategy game engine (cross-platform, 3-d)
http://megaglest.org/
346 stars 89 forks source link

Feature/water waves #187

Open titison opened 5 years ago

titison commented 5 years ago

Adding simple water waves to MegaGlest. See https://forum.megaglest.org/index.php?topic=9949

andy5995 commented 5 years ago

I've tested this patch and it works.

I made a local edit to autumn.xml in data to fill in the values @titison listed in this forum post.

here are some demo videos:

This uses the values titi_son suggested https://www.twitch.tv/videos/420122531

This uses the values waveAmplitude="0.44" waveSpeed="0.033" waveFrequency="0.8" https://www.twitch.tv/videos/420121425

titiger commented 4 years ago

waves have same size in oceans and in rivers. Titi_son and me talked about it how to fix it.

andy5995 commented 4 years ago

Cool. I'm looking forward to it

Jammyjamjamman commented 4 years ago

waves have same size in oceans and in rivers. Titi_son and me talked about it how to fix it.

Did you decide on how to fix this yet @titison and @titiger ?

Looking at the code, it would be quite easy to make it dependent on the depth of the water. If you wanted to make it dependent on the depth and the area of the body of water (more accurate), this would be more difficult.

I think the 2 modifications I'd make before merging this is make the wave amplitude and frequency depth dependent:

This might lead to weird looking waves in rivers with a deep trench, but I think it would be ok.