A small tool for baking LUT images for Minecraft shaders using Lua scripting. Supports 1D, 2D, and 3D textures; in BMP, PNG, and RAW formats.
Using the lua script below saved to a file "lut.lua", this will generate a 2D RGB PNG texture using the normalized texel coordinates (0-1).
function processTexel(x, y)
return 2.0 * vec(x, y, 1.0) - 1.0
end
Then run LuaLUT using the following command to generate a LUT.png image.
lualut -s "lut.lua" -i "PNG" -f "RGB" -t "BYTE" -w 128 -h 128
You can pass custom variables in from the commandline to your lua script.
function processPixel(x, y)
return vec(red, green, blue)
end
lualut <...> -var "red=1.0;green=0.5;blue=0.0"
- BuilderbOy, for providing very comprehensive Lua vector and matrix libraries.