All examples · Shaders and post

LUT grading

What this example shows

lutGrade() looks every colour up in a grading table (a LUT) and moves towards what it says. It is grading, not limiting: a table moves colours about (a warm dusk, a cold night, an old photo) and takes none away.

A table is a file: a .cube, the text format grading tools write, or a strip image of the same numbers. useLoadLut reads both, and the table is a field of the effect, so changing the mood of a level is one assignment. effect.uniforms.amount says how far to go, from 0 (untouched) to 1, which is also how a grade fades in when the sun goes down.

Click to change table and ↑ ↓ for the amount. P adds a NES palette after the grade, and the order is the lesson: grade first, limit last. The other way round would grade colours the console could not show and then pick a neighbour for them.

Starting