Level liquids
One of the visually sore points of my level graphics were the water tiles: they were static, visibly repeating, and the transitions were a bit like dithering. It was very different to the overworld water, which uses a variety of transition masks, and some complex shaders for the water surface instead of repeating tiles.
My goal for this week was to improve the water and make it look more like the overworld water quality. This of course resulted in copying over the shader and making several adjustments as the overworld water looks like ocean and the level water should look different.
Another natural extension was to be able to parameterize this "level liquid" shader to be able to render things other than water. At the moment I've added support for lava, blood and poison, although the latter two are "reskins" of the basic water preset.
When entities move in a liquid, they still get partially covered (amount depends on liquid depth) and the covered part is distorted. This reuses the previous code, which involves the use of stencil buffer and re-rendering only the underwater sprite regions.
Lava is bright, so when everything else is dark, it should really be emitting some light. That was another bit of refactoring done, and now that works as well. So, being stealthy around lava might not be as effective anymore.
What's not done (but is not a priority yet), is to add effects while traversing such tiles, e.g. poison should make you poisoned, lava should burn you etc.