PirateHell beta

@ceiphren
Looking great, even without fancy water colors! Thumbs up! Any idea if and how it differs from the projected grid of @matthias (GitHub - mschell/jme3test: JMonkeyEngine water rendering) when it comes to performance?

For my ship simulator I am currently perfectly happy with the projected grid, but if there is an improvement in performance… XD

Maybe one tip (for if you want to implement buoyancy): Make sure it is possible to get the height at any location by either a getter or a possibility to detect the wave with a ray.

@husky. Which test do you mean?

@normen: I think its impossible for the gpu to calculate this in a vertex shader 'cause the results hardly depend on each other (which makes it hard to parallelize). On the other hand that would be my preferred way. The fourier transformation of 30-40k vertices is really expensive.

Currently I have round about 350 fps on a i5@2.6ghz with 1280*800 resolution. I think this should be fast enough.

Ah, the Java files are here: jme3test/src/jme3test/water at master · mschell/jme3test · GitHub

With these files I made the water of my ship simulator. I was wondering if yours will perform better when ready, although it is hard to compare, since yours is not ready of course. Again, I do not have any performance issues (yet), it was just a question. I use this water with my buoyancy control to make the ships riding the waves.

And here we go with the third demo. Now we got something like an ocean texture. The refraction color is still missing and also I want the rippling effect from the post water shader.

A fun fact is that i do not completely understand what’s going on. That in mind I think the result is quite nice.

[video]http://youtu.be/ArhZUflm0jo [/video]

edit: @nehon: I don’t really understand how you create the shorelines. How can you calculate the height between the current terrain vertex and the water surface in the shader?

3 Likes

That’s really nice - just need buoyancy effects for the ship now :smiley:

ohhhhh dude that’s just brilliant!!
we need that into core.
this + buoyancy and that’s actual friggin real water!!!

How is the performance? edit : I mean versus the Water filter

About foam, it’s one of the advantages of the post process effect, I have the depths buffer of the scene as a texture and the water itself is not a geometry.
I reconstruct the position in world space of the rendered fragment.
It’s a bit hard to explain how the surface point is computed without a drawing, but that’s the intersection between the eye vector and the water plane. the eye vector being the vector between the camera position and the computed fragment position.
You can’t use this, because you don’t have the depth of the scene.

what you could do though is to pass the terrain height map and just add the height value from the height map to the water height when it comes to foam rendering.
I’ve seen in you video that foam is rendered when the waves are high enough so that would be the same, but the higher the terrain would be the more you’d have foam.

What’s too bad is that you won’t be able to have foam around your boats with this solution. That was a nice free side effect of the Water Filter.
Or…you could render an additional height map with the boat position and just fetch from the terrain height map and this one .

for example this would be your terrain height map :

and you would render a map like this :

this way you could have foam around ships.
This map can even be 128x128 I guess it’s plenty enough. Something like @zarch image painter could help you achieve this. Ofc you would only repaint the map if ships moved since last frame.

1 Like

@nehon: yesterday I started some talk in the core chat that would make this easier too, as well as terrain and streaming basically going back to the old idea of making the Mesh object responsible for more than just storing some direct buffers. It wasn’t really fruitful yet though

Yeah, this is looking really good.

Adding foam around the ship would be epic though - and also I notice that the horizon isn’t quite convincing. I think that is because the edge of the rendering is reached at a point where the height of the waves is still visible. I think if you “flatten” the waves as they approach the horizon it would improve the illusion a lot as it would make them seem like they are getting further away faster…

@nehon: Help me to make this thing awesome and I will contribute it to the engine. :slight_smile:

The performance is not bad at all but the wave calculation is very expensive. So its much slower than the water filter… Currently I have no appropriate mesh to fill the scenery with an ocean. So there’s much performance tweaking possible.

@ceiphren said: @nehon: Help me to make this thing awesome and I will contribute it to the engine. :)
sure! How do you want me to help?

@nehon: Do you have a jabber-account or another messenger? Could be quite a bit off topic for the pirates to discuss the ocean development.

@ceiphren, i sent you a PM

I came back from a recent trip on a ferry, and took some video footage for you ocean game making folks! Hopefully it may help with the waves/sounds/effects. I would say the crossing was in the mid range of “rockyness”. They wouldn’t let us outside, because it was too windy, so I could only get footage inside.

Showing as far down as I could look

2 Likes

Nice vid! The waves I was in when I was bringing my ship back wasn’t that big (still up to 10 feet in some cases) but it does toss ya a bit more when your boat is only 65 feet long.

Pathfinder leaving Cape Cod

Note: Sorry about the quality. Not exactly using the latest of video technology almost 4 years ago.

@wezrule: Nice. Quite a good reference. ^^

I’ve released a new beta version of pirate hell:

http://hub.jmonkeyengine.org/forum/topic/piratehell-second-beta-2/

have fun and don’t forget to report every issue you’ve found.

stay tuned for more.

ceiphren