Module Reflecting water
#include <macawgpu.h>To draw water that reflects: draw the scene into a picture from a camera mirrored in the water, draw the main scene, call gpu_mask(1), draw the water's surface, call gpu_mask(0), then call gpu_water.
Functions
- gpu_mask
- While it's on, the triangles you draw don't show: they mark which pixels are water, for
gpu_water. - gpu_clearmask
- Clears the marked water pixels without drawing anything.
- gpu_waterdefaults
- Fills in every one of
gpu_water's options with its usual value, so you can change only the ones you want. - gpu_water
- Mixes a reflection into the marked water pixels, with ripples, a tint and a drifting surface, then clears the marks.