Dynamic Ocean Simulation?

@motorsep
Have you thought of/ used UDK for game development?? It’s mostly for FPS games but it is really great if you’re doing an FPS.

But no diffuse map baked?

It bakes the main displacement map, the normal map, and the foam for the diffuse yes.

Didn’t see your question, sorry :slight_smile:

UDK is discontinued, UE4 is a new thing. I’ve been looking into it and maybe in the future I might use it, if I have larger team and gain enough knowledge of the technology.

Currently it’s not practical (based on my circumstances) to use UE4 as it’s very raw, missing a lot of modules, etc.

I am using modified Doom 3 BFG engine for my current project.

I just looked at some images of the Doom 3 BFG engine and the graphics in them seem outdated. I was unaware that UDK is now discontinued… I guess the last update was in Feb? Anyway could I maybe get some screenshots of what you’re working on? I’m wondering if that engine can support such a high poly ocean simulation…

Lol, how can you judge game engine by looking at Doom 3 BFG game? Doom 3 BFG engine runs original assets that have not been improved.

Think of running Quake using UE4 without any effects - you’ll get just that - OpenGL accelerated Quake.

Anyhow, what I am making has specific art style: https://www.youtube.com/playlist?list=PL83EF655802BAA9F5

The engine is not as advanced as UE4 or Unity 5, but powerful enough to allow an indie developer to make good games. Note that a small indie team will never have capacity of making large AAA games. It takes years or work and outsourcing to make best looking indie games out there. So choosing Unity or UE4 or UDK will not help making better looking game by default than using Doom 3 BFG engine :wink:

All that besides the point :slight_smile: Ocean in games isn’t high poly at all. Maybe 100k polys, maybe 200k polys. Normal maps do the rest.

Ah. I see, yeah those graphics actually look pretty nice. Sorry for that mix up.

Anywho, I’m trying to figure out how to get an animated mesh exported… Unfortunately I don’t see a practical way of using shape keys for it. I can only get an ocean animated in Blender, and can’t figure out a way to export it into a game engine like you mentioned. Anyone have any ideas? Is there a plugin for Blender that will export a mesh that is animated by a Displacement modifier with an image sequence on it?

Thanks :slight_smile:

I have an add-on that transfers vertex deformations into keys for rigged mesh. In other words, I have 2 meshes, one is with Ocean Sim and its copy with bones in each vertex.

The problem is that Ocean Sim and in-game meshes have to be of the same topology for best results. So Ocean Sim has to run in lower resolution settings. However, that causes output EXR texture to be tiny, so it’s no use.

So what I basically need is to be able to run the Ocean Sim in lower resolution, but bake out 1024^2 or 2048^2 textures. Then it all will fall in place automatically.

Wait… cant you just use the EXR’s in the game engine to displace a plane in real-time? Or are the EXR’s too pixelated?

EXR is a bad format to use in real-time rendering for once (in games in particular; and it’s not supported by any game engines known to me) and it is way too low res. I need 1024^2 textures at minimum.

I’ve found that my EXR’s are 625x625… I’m guessing that if I bake another one at a higher resolution it will make them larger?

Are you planning on having the Ocean simulation tiled in the game

No, it has to be one mesh. So it has to be simulated for entire surface I need to be in the game.

I managed to bake some ocean displacement maps at 1600x1600, but I don’t know what resolution value will give me 1024x1024 or 2048x2048. I can link them to a download service if you’d like, then all you’d have to do is import the textures into Blender, subdivide a Plane a couple times until you have 100k-200k faces (like you said previously), then use the displacement EXR’s to displace the Plane. You could then (I presume) use your plugin to export that animated mesh to your game engine. I also have the normal map and the diffuse map for foam.

I hope this helps :slight_smile:

And I’m guessing that your game engine supports a water shader or things of the such to give color to the water? Or a somewhat reflective/glossy blue-ish surface?

I see. So instead of working with Ocean Sim directly it’s better to bake out maps, then use them to displace another mesh of the topology I need, and then transfer data to export.

How do you animate displacement having image sequence ?

Yeah, it has GLSL shaders and all that goodness.

Yes! We may have a solution to your problem :slight_smile: high five

You have to select multiple files to use an image sequence in Blender. It will automatically assume which images go on which frame based on the name of the file… Lets say “disp_180”, that would be seen as frame 180.

To select multiple files in Blender you can use the B key, it will bring up a sort of marquee select. Click and drag to make a box selection of the files, then use L-shift + L click to toggle selections on extra files you need or don’t need.

After you confirm the file selection there is nothing left to do but sit back and watch the waves. (Until you decide to stop dilly-dally-ing and export) :slight_smile:

OH! and also, something important you need to do.

Under the texture tab (when your plane is selected) there will be a “Colors” tab. You need to UNCHECK “Clamp”, or the troughs of your ocean surface will be flat.

Uh-oh… what are we going to do about the looping…

Play it forward and then backward and so on?