Multi-level Water

Published July 14, 2017
Advertisement

So, I'm trying to figure out how to do water. Right now, I am doing water the "brain dead" way; any tile below a certain height is water, and water is created as a simple hexagonal plane with a partially transparent blue material applied. It works okay, but the ultimate end goal is to have water play a more involved role in the landscape. I'd like to have rivers, waterfalls, etc... and that means that I need to rethink how I do it. I'm trying to come up with ideas for the geometry of water.

Here is a shot of how the current water system might look if I use it unmodified for multi-level water:

water1.png.a769e6226e009cbc7c0b5893cb4980c6.png

Clearly, I need some sort of geometry to tie the pieces together. My first thought is to create a sort of "skirt" piece that is attached to the side of a water hex if that water hex has neighbors whose water height is lower than its own. Might end up looking something like this:

water2.png.006bcfd18fc640ad67d4537dfcaa1003.png

The issue with that, of course, is that I have to oversize the skirts to avoid Z-fighting with the underlying ground hex, and that means that skirt pieces overlap with adjacent skirt pieces on different hexes and with the water hex of the lower water levels. In combination with the alpha-blending, this creates bands or regions of darker color where two pieces of water blend together. I could use waterfall particle systems to help obscure this overlap, I think. Alternatively, I could use a solid material instead of a partially transparent one:

water3.png.765e6ea2b2774a08dd101fcd8a5ae9df.png

I dont like the look of it, though. Large areas of flat water look terrible. Granted, there will need to be improvements to the actual water material to make it look better regardless of how I handle the geometry, but for now I'm sorta stuck on how best to do this. I do have some ideas as to how I could perform the geometry stitching of the skirts to minimize overlap, but it'll take the creation of special pieces, and some special-case code. Not too difficult, I suppose, but still seems kinda messy.

Previous Entry New Gameplay Video
Next Entry Water
5 likes 4 comments

Comments

swiftcoder

Is the terrain tile below the water actually important? I'd be tempted to just mark the entire tile as "water", and render it as such (avoiding the additional layer altogether).

July 15, 2017 04:00 AM
Krohm

Any chance you have enough perf/functionality to just expand each prism to a buffer and somehow ray-walk it? After playing the Talos Principle I had to surrender to the fact Parallax Occlusion Mapping (of sort) is now fully viable so maybe having some kind of "fog collection buffer" with dual layers might work.

Plus, everyone and the dog is doing terrible screen-space reflections.

July 15, 2017 06:18 AM
JTippetts

@swiftcoder:

Well, if I keep with a partially-transparent water, then I'll need something to be drawn underneath it, otherwise you'll just see the blackness that lies at the heart of the world (or, at least, the distance-based fog that lies beyond the stuff you can see). If I go with a solid water approach, then I would certainly eliminate the ground tile.

 

@Krohm:

I have no idea what that would entail, to be honest. I'm not really looking to do reflections, either; I'd prefer to keep to something a bit more cartoony, in keeping with the style I have established so far, and I'm not sure reflections would really fit. Even something as simple as a cycling animated texture showing water flow and ripples or something would probably be more appropriate.

 

Trying out the options:

screen_2017_7_15_8_35_45.thumb.png.cec116ce85ebf8453616ec81a7916402.png

screen_2017_7_15_8_43_24.thumb.png.5eb8d31613d39b5c93709f524acb9006.png

 

I definitely prefer the partially transparent one, but that could just be the plainness of the non-textured primitive.

July 15, 2017 02:46 PM
JTippetts

This one doesn't have the overlap lines outlining the hexes.

screen_2017_7_15_8_57_8.thumb.png.ffbbc1f7a48013b8343d3609f877a1ca.png

July 15, 2017 02:59 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement