I have been working on a personal rendering engine these days. Find the previous tease here. This demo is for LUT post processing effect test. Here I used some lookup tables from Unreal Engine to apply color transforms in a shader.
Spec
3D textures are used, and the size of lookup table is (16x16)x16.
channels:
Shader
Apply the lookup table after the final combination of all the other passes. Since the output value of ‘combine pass’ is followed by an tone mapping processing, none of the RGB values will reach 1.0. And it is better to use some precomputed numbers. (etc. 0.03125 is 1/32)
And mipmap mode needed to be disabled for a lookup table image. Use GL_LINEAR
for a better looking.
Demo
For test, Here is a LutController
Component attached to gameControl
GameObject, which can switch lookup tables by pushing left or right key.
Assets
- Character and animation from mixamo.
- Model by SilverTm from UE4 Marketplace.