Jump to content

Of water and waves


wraitii
 Share

Recommended Posts

  On 15/07/2012 at 3:54 PM, Pureon said:

What's wrong with the Mediterranean Coves map? Strange that it would be different to the other maps.

Good question. It could be a weird (but not necessarily faulty) piece of geometry or map setting that throws the renderer off in some way, but I don't know what exactly.

Link to comment
Share on other sites

I'll take a look at that in the debugger. Since the water code doesn't really rely on anything else in the game, it's completely possible that there are special cases I haven't yet considered that would crash. In particular since I'm not the most proficient programmer.

Link to comment
Share on other sites

It breaks every map in that every map's setting will probably have to be adjusted if we use some changes. If you want to push quick changes, it's probably better to use myconid's watertest or biwater branches, which are cheap improvements.

However, depending on when Alpha 11 is set to be released, this may still make alpha 11.

Link to comment
Share on other sites

I take it from TRAC that Alpha 11 is for mid-late august. I'm fairly confident this should take no more than 2 weeks to wrap up.

To give a todo list:

-Need to fix all and any segfaults/bad memory accesses.

-Need to have waves (I'm on that but for some reason it doesn't work I'll investigate).

-Need to redo the scenario and random map water settings (probably quick, but necessary).

-Should try to definitely fix some border issues on the super fancy shader. Since I distort the depth buffer, it gives a few quirky pixels. It's certainly fixable, however.

Edited by wraitii
Link to comment
Share on other sites

I've seen comments here, or somewhere else that there is some complaints about the quality of the water texture. I've taken the liberty of regenerating 60 frames of animated looping water. The photoshop plugin outputs a color map in the RGB (maybe useful for adding white caps to waves?) and then uses the alpha channel to store a bump map. If I gave you 60 of the attached files would that be something you could work with... or would you need that bump map extracted and turned into a normal map for you?

I was also thinking... I could generate more animated maps if they might be useful? Waterfall or maybe an animated caustic light map that could be applied to the terrain below the water?

water01.zip

Link to comment
Share on other sites

I should be able to convert it to normal maps, though it might take me a bit of time, but that's not really a problem.

For other textures... If you find a way to make the caustic light map nice, that would be interesting (as a decal), because I don't think I can reuse the trick I'm using for foam.

Link to comment
Share on other sites

  On 16/07/2012 at 1:15 AM, Gen.Kenobi said:

@zoot: Can you rephrase your question about Blender?

Can Blender simulate water like shown in the video above and export a heightmap of the water surface at each frame? Thinking less about oceans and more about ponds and pools.

Link to comment
Share on other sites

  On 16/07/2012 at 9:52 AM, zoot said:

Can Blender simulate water like shown in the video above and export a heightmap of the water surface at each frame? Thinking less about oceans and more about ponds and pools.

Sure. I'll have to look into the exporting of height maps, but it's possible.

Gonna need to watch a few tutorials first, to get me going. But what exactly are you looking for? :P

Link to comment
Share on other sites

Well, it is purely hypothetical at this point, but if we have animated heightmaps, I assume we can do all sorts of optical effects on the fly, including normal mapping and caustics (per the paper linked above). That way we can have unique water animations for every pond, fountain, waterfall etc., complete with reflections, shadows, caustics and so on, with minimal work. We could also use it to create wakes, like suggested by myconid and quantumstate here, with full optical animations.

Link to comment
Share on other sites

Got some quad stuff going on with the waves, but I'm not really happy with it. It either looks rough (given that to do that properly I must go 360), or there's clipping problems... or rendering problems. And I can have other issues with concave stuffs, and with angles getting weird. I may go with some clever texturing job, or some clever axis-aligned quad, it looks like it would basically be easier and just as good. I'll see.

Link to comment
Share on other sites

Okay, so I've finished my first shot at waves. It rocks along with the foam, slightly moves up and down but not too much. The vertices are a bit rough, it doesn't look extremely smooth, there are a few textures that get squished here and there. I haven't had time yet to do that.

The system is pretty easy to understand, harder to have in practice: I basically look for the shore, create a point there and another a bit farther at sea, and then connect all those contiguous points. This has the benefit of completely lacking the "holes" or overlapping when using quads. It may however produce artifacts if the water is a too concave pond (I think the RM map Oasis should be able to showcase that), or when two patches of land are too close together. The effect is sort of scaled with waviness for now, but it's not perfect.

Here's the mesh around the afore-screenshoted island (you can see why it doesn't look smooth: it's pinned to the vertices' position to some extent):

post-9128-0-01738100-1342519644_thumb.jp

Here's two shots showing the waves when far from the shore and when on the beach:

post-9128-0-27867900-1342519630_thumb.jppost-9128-0-92889800-1342519634_thumb.jp

I'll try to smooth the effect now, and fix a few problems, and treat a few special cases. If somebody cares, it would be great to have a nice animated wave texture (from the sea on to the crashing on the beach, then the starting to retreat to the water). Or at least something a tad nicer than what I've added.

Warning: I have not really optimized the wave mesh generation, so Atlas may be very slow for now. Also, it only works on superfancy, I think.

It may crash in some circumstances, I haven't really tested yet.

Edited by wraitii
Link to comment
Share on other sites

Looking good :) - try this file. Would it be possible - instead of using an animated file... to take this sprite and cause it to start from a squished state (for example 16x128) fade in, advance to the shore (expanding to it's full size 64x128), linger, stretch it even further (maybe 96x128) in a retreat and fade back into transparency. Meanwhile, another wave would be starting it's cycle behind it.

post-3-0-87499500-1342528927_thumb.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...