↓ Skip to main content
  1. posts/

Water Surface Shader for 2D Pixel Art Games

··Index: 5·

Water surface shader for 2D Pixel art games

This tutorial shows how to recreate the water reflections from “Potions” with Love2D and Lua. The author liked the real-time reflections and wavy distortion in that game and wanted to get the same effect.

Most of the post builds up a small project step by step: hand-drawn sprites, tiles for ground and water, water bodies and animated water tiles. Reflections come next, through a class for drawable sprites, and at first they look wrong. To fix them, the author keeps reflections inside the bounds of the water bodies and tints them blue to mimic the way water absorbs some of the light. After that comes a displacement shader for the wavy distortion, and the last part compares this approach to the shader technique used in “Potions”.

Related