Closed HogJonny-AMZN closed 2 years ago
Late here so I cannot test it out right now, but just looking at ociolutimage/main.cpp, maxwidth
can be passed as an option to ociolutimage. Otherwise it defaults to 2048.
"--maxwidth %d", &maxwidth, "Specify maximum width of the image (default: 2048)",
If you set maxwidth
to 4096, does that get you the result you are looking for?
Plugging in a cubesize of 64 and a maxwidth of 2048 into GetLutImageSize does set the output width to 2048 and height to 128, if my mental math is correct.
There is a 10 year old TODO inside that function that says:
// TODO: Do something smarter here to find a better multiple, // to create a more pleasing gradient rendition. // Use prime divisors / lowest common denominator, if possible?
I don't convert LUTs to images as part of my workflow, so I am out of my depth to judge how relevant that TODO is today.
You are a sleuth @EvanAW. I was following some documentation, this tool and it's options aren't fully documented. I was so in the rabbit hole I didn't think about looking at the tool code itself. That works. I would be nice if it in fact was smarter, generating a 16 or 32 cube works fine without additional params. I am also making assumptions there about my usage (realtime 3d rendering engine) and power of two image dimensions - I don't know if others use this tool in another way. But seems like a cube / 3d textures, the width/length will always be increments of the height.
I probably wouldn't do this but it works fine "ociolutimage --generate --cubesize 19", so I guess it simply breaks and needs the additional param once the width overruns 2048.
Also you can just run the tool without any arguments to get the usage help which includes the --maxwidth
flag.
One other way the tool gets used is to sample proprietary color transformations by passing a simple image through the process / software then extracting the LUT with the --extract
flag. This is where you might want to constrain the maximum width of your image so that it falls within the accepted texture size.
Closing this. As mentioned, one simply needs to set the maxwidth flag to get the desired result.
The above command creates an incorrectly formatted LUT. The dimensions are: w: 2048, h: 128 Should be: w: 4096, h: 64
The cells look like this
LUT is attached.
linear_64_LUT.zip