In-Game Realistic Ocean Thunderstorm

Hello, I’m back with another update on my ocean! For this video I made the waves bigger, and also used these two modules: Screen rain and 3D rain. I added both of these into the ocean test game, and I think it looks way more realistic now.

The ocean mesh has ~1000 bones (1 per vertex), and it updates all of them in under 1 millisecond! This means you won’t be experiencing any lag from this at all :slightly_smiling_face:

Update:

After optimizing some of the code, I cut the time from 1ms per 1000 bones down to 2ms per 4000 bones! This is probably as fast as I can get it without implementing any chunk / octree systems, which I will work on next.
The profiler label is just __index and __newindex spam, so there’s not much I can do anymore lol.

(every thin frame is either __index or __newindex)

38 Likes

Whoa! That’s really cool! Are you planning to add this to a game?

i think the droplets on screen dont fit with the realism of the rest. they are too round and stuff so i recommend changing that to something more realistic

5 Likes

That is amazing. I keep seeing people making these things and I just want them more every time, but honestly, that might as well not even be ROBLOX, because the ocean looks a lot like real life! Great job, PysephDEV! :smile:

2 Likes

@stqrrydev I’m planning on using it in two projects I’ve got brewing up, yeah.

@kaplablokje I’m using an open-source module for the screen rain so I don’t believe you can do much except for changing the fade time and size, but I’ll try messing around with the settings :tongue:

@Chilled_Seal Thank you! really appreciate it :slight_smile:

4 Likes

This looks amazing! I always love these ocean simulations! If you wouldn’t mind, could you create some basic form of this as an open source, or a tutorial on how to recreate something like this?

2 Likes

Hi
I’m trying to create a system like this, and am using Gerstner waves. The update time I’m getting for ~4000 bones is 16-18 milliseconds. How did you manage to get a 2 milliseconds update time?

Could you provide a link to the water texture you used?
Thanks.

1 Like

This is awesome! How is the buoyancy when it comes to floating objects, such as boats? I was thinking the same thing as @stqrrydev, is this going to be in a game? I would love to see some sort of simple pirate game with cannons on a wild sea. Looks fantastic.

This is fantastic, good luck to you!

Looks very realistic! I really really like it. You could work on the droplets, they look quite good but not as realistic as the waves. When you’re done with this project, it’d be great if you would open source it so we all can learn from you. Fantastic work! :slightly_smiling_face:

2 Likes

For anyone wondering, I found a solution:

Instead of updating the 4000 bones every single frame, and calculating 4000 ( * numberOfWaves) Gerstner wave offsets, this work can be spread over multiple frames. And the bones can be smoothly interpolated over these frames.

For example: if I spread the work over 25 frames, I only have to calculate 4000/25 = 160 bone offsets each frame. This is a massive improvement (25x)!

The problem now is that every bone only gets updated once every 25 frames, resulting in choppy movement. To smooth this out I use a custom module that smoothly interpolates the bone’s movement over the specified amount of frames.

I tried using TweenService, but it doesn’t work that well with this many bones… Keep in mind you have to calculate the bone’s position with an offset of 25 frames, you want to calculate what the offset will be 25 frames from now, not what it is right now

5 Likes