Jump to content
  • Advertisement
  • entries
  • comments
  • views

Multi-level Water



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:


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:


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:


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.


Recommended Comments

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).

Share this comment

Link to comment

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.

Share this comment

Link to comment


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.



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:




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

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!