Skip to content

Null-MC/LuaLUT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuaLUT

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.

Usage

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 --script "src/lut.lua" --out "publish/LUT.png" --img "PNG" --format "RGB" --type "UNSIGNED_BYTE" -w 128 -h 128

Custom Variables

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"

Special Thanks

  • BuilderbOy, for providing very comprehensive Lua vector and matrix libraries.

About

A small tool for baking LUT images for Minecraft shaders using Lua scripting.

Topics

Resources

License

Stars

Watchers

Forks