Mate, you've thought about this is some detail.

There is a problem with this approach though.. I don't think my engine can support it..

The water effect is only a visual trick rendered after everything else to be reflected has already been sent to the screen.
It can only ever reflect things which are on screen and doesn't have any idea about Z order when it comes to render time. Also, it can only ever be at the bottom of the screen and at most 72 pixels high (unless I change the reflection ratio) I tried it at 128 pixels last night and it went crazy.

Any additional layers containing water will be reflected in the water block at the bottom as there's no other way (using the current design) of only getting the reflections of the sprites. This would require an additional pass through the renderable object list to render to a new off screen surface. This would increase the render effort by a third.

Basically, my Renderring system is quite simple.

The game level has many layers arranged in Z order.

I render each layer in turn

Each layer contains tiles and entities which if in the cameras view, are rendered.

Each entity can have its own render function for things which need a bit more work (like the water effect). They can manipulate their own textures etc.. but basically render themselves to the target surface.


To implement the background water system would mean that the mountain layer would have an additional entity which would be a version of the water effect.

This effect would be different to the current water effect, it would need a sky texture to reflect off.. (trivial) it would also need to make a pass over the background image to create the reflection of the mountains, rendering only to the masked area and alpha blitting the clouds for that line. (expensive)
All of this is do-able and would make at least a nice layered reflection of the cloud layer with a rippled relfection of the surrounding mountains..

but the current water block problem would still exist. The water block would be reflecting things which already had a reflection in the other water block. This is because it is reflecting everything, not just sprites as it can only work on the final image because my engine doesn't use any compositing so to speak... Things ae just drawn in place over the top of other things.

If I can think of a better way to do this, I'll revisit it. But I'm fairly happy with the effect as it stands at the moment, especially since the game is 2D and rendered entirely in Software I'll spend a little more time trying to get it looking a bit more authentic, but I've got a lot of issues left to solve and I don't want to get hung up on this too much.

Oh if only I was using a 3D engine with a real terrain engine and shader powered water

Does this explain how I'm doing things?