Live progress #20 – Water

Last 2 evenings I’ve spent researching into water rendering tutorials, looking for a nice water effect shader. It is quite hard to find one. Most of the times the result is less than satisfactory and older OpenGL functions are used, resulting in complicated pipeline. Luckily I have found a few good ones, so here’s my first attempt – this is a test-bed example:

2014-06-21 water shader

Notice how deep water has more deep colors and how far away water surface is more reflective. Colors and coefficients can be tweaked to make water look more muddy or crystal clear. Shallow water with the same as above settings looks good too:

2014-06-21 water shader 2

There are no ripples and no sun specular highlight yet, I might add them later or see into trying out a different water shader first. This one has some imperfections:

2014-06-21 water shader 3

See the deep water color, when the water depth changes quickly it is noticeable that the volume color is rendered on the water surface. That wont be noticeable much in the game, if there are no plateaus underwater. Another limitation is that only flat water surface is allowed and that surface has to be one per whole map. I can make it 2-3, but that would eat some more performance, because each next one will require additional rendering pass (~30% fps).

Questions for discussion:
– single flat water surface per level, is that acceptable?
– several unconnected flat water surfaces per level, is that acceptable?
– how important for mapmaking is to be able to edit water height level for each tile?
– anything related?

This entry was posted in Live progress. Bookmark the permalink.

4 Responses to Live progress #20 – Water

  1. The Dark Lord says:

    I’m not entirely sure if I understood everything correctly. ‘Single flat water surface per level’ means all water on the map has the same height? Would waterfalls be impossible to make? If so, then it’s not acceptable. Pretty maps need waterfalls!
    Unconnected flat water surfaces per level is acceptable, but 2-3 is not much…
    I don’t know how map making will work in this game so I can’t answer your third question.

    • Krom says:

      I’m planning to release a private alpha with MapEditor once I have all the essential elements.

      You are right, single plane water surface is very limiting, but some games seem to be fine with that (AoE, 0AD, SimCity?).. I agree that for NG we need to have extra effort put into maps artisticity.

      Do you know any examples of RTS games with water that can change height along the map? (I mean not only waterfalls between 2 flat lakes, but mountain rivers, rivers on smooth slopes, etc.)

      • The Dark Lord says:

        Actually, no, I don’t. And I don’t think it’s really necessary either (I think it would be really hard to make it look nice, although IF you succeed it can look awesome), it’s just that 2 or 3 unconnected surfaces is too few. 🙂

        • Krom says:

          Can you link some reference pics please?
          I’m looking for maps that will need more than 4 water areas.

Leave a Reply to Krom Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.