Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 07:57:14 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Ocean shaders and crashing waves on shores
Pages: [1]
Print
Author Topic: Ocean shaders and crashing waves on shores  (Read 2720 times)
GameDevil
Level 0
*


View Profile
« on: April 17, 2016, 02:56:39 PM »

Hi Everyone,

I'd like to discuss ocean shaders with you and see what you think of my idea for one. I'd also like to read about your ideas for ocean shaders if you have them.

The main issue that comes up is having crashing waves on the shore line. It's simple on its own, but to have it as part of the ocean as a whole is another story. The middle of the ocean can be generated with plugins such as Ocean in Blender. What this plugin will do is displace a plane so that the surface looks like animated sea water. The edges of this plane also happen to rise up as high as any wave in the center. So how do we make it small crashing waves, the types we see on a beach, along its edges?


Perhaps masks can assist? Personally, I use Blender and Unreal Engine 4.11.1. I'll be approaching the idea in a manner that is as generalized as I can make it for those who don't use Blender or Unreal.

What I would do is use the Ocean plugin in Blender to make a displaced plane, then bake a sequence of displacement maps that are looped. In Unreal, I would create a shader with an animated texture and displace it with the displacement map sequence I made of the ocean surface. To prevent the extremities from moving too far on the vertical axis along the edges, and basically flapping off of the landscape, I would apply an alpha mask. It would be black at the center and fade to white on the edges, or 0% along the edges and 100% in the center. You can adjust it any way you like to get the most realistic look.

For the smaller waves that would crash on the beach, I would use a decal and instance it at certain points. First, you would set up a perimeter along the shore, where you want these waves to start, and set up colliders there so that when the ocean touches them, they would create an instance of the smaller wave decal and send it towards the shore. The decal should be animated as well, and textured appropriately. Perhaps the ocean plugin in Blender could create this as well (separately from the first, of course). It just needs to look like the waves you'd see by the beach. Basically highest in the center, and curved outward towards the beach. You'll also want them to gain height quickly at the start, and gradually fall off to nearly flat at the end of it.

Now, for the last touches, the wetness on the beach that seeps into the sand. You can create yet another animated decal for that and trigger them on a timer, timed to fit in with the smaller wave decals as they hit the beach, and fade away towards center when the wave recedes.


I haven't put this together yet, so I don't have any screenshots or demos. I hope you can make sense of it, and perhaps someone here has the time to try it out? I'd be happy to see it working.
Logged
InfiniteStateMachine
Level 10
*****



View Profile
« Reply #1 on: April 18, 2016, 06:52:38 AM »

I noticed you mentioned you are using the unreal engine. Are you aware of the ocean plugin community project? Even if you don't want to use it there's some great discussion in there on how it's made.

https://forums.unrealengine.com/showthread.php?42092-Community-Project-WIP-Weather-amp-Ocean-Water-Shader

Logged

GameDevil
Level 0
*


View Profile
« Reply #2 on: April 18, 2016, 01:07:37 PM »

I noticed you mentioned you are using the unreal engine. Are you aware of the ocean plugin community project? Even if you don't want to use it there's some great discussion in there on how it's made.

https://forums.unrealengine.com/showthread.php?42092-Community-Project-WIP-Weather-amp-Ocean-Water-Shader



Yes, I was aware of it. Thanks for linking for others who might not be. The methods they're using are a bit more complex than what I'm suggesting, and you really need to know your stuff to be able to implement it from scratch. They get really in depth with it and even have buoyancy and ripples from weather. Mine is ridiculously simple compared to theirs, and not on the same level at all. Still, I figure if you're not making a cinematic or a game based mostly in the Ocean, you don't need to have something as complicated.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic