3D LUTs are always created outside Flame. After you perform basic monitor calibration and take calibration measurements using the appropriate calibration device, you can work with your film lab to generate a 3D LUT file to account for both the characteristics of the monitor and the characteristics of the film stock you are using. Ideally, 3D LUTs should be developed for a particular monitor and a particular film stock.
A 3D LUT represents a colour conversion from one colour space to another. It applies a transformation on each value of a colour cube in RGB space. However, 3D LUTs use a more sophisticated method of mapping colour values between different colour spaces than 1D LUTs. Where 1D LUTs represent a transformation in which each colour channel (red, blue, and green) is independently mapped, 3D LUTs represent a transformation in which each colour channel is affected by the other two channels. For example, a highly saturated blue on film will also have an effect on the red and green channels, which 3D LUTs take into account. 3D LUTs can take into account the characteristics of both your monitor and the film stock you are using.
A colour cube can be subdivided into any number of vertices (NxNxN), where each vertex corresponds to an RGB value. You can apply a 3D translation to any of these values (dR,dG,dB) to map equivalent colours between colour spaces. Each RGB value, then, would have an equivalent transformed RGB value (R',G',B'). A 3D LUT maps these equivalents.
The first line of a 3D LUT file determines the level of segmentation of the colour cube, which determines how many vertices there are to assign values to. While each colour channel could be segmented differently, Flame supports a uniform RGB segmentation of 17. The first line of the 3D LUT indicates at what 17 intervals input and output values are matched. All RGB values are represented in the 10-bit colour space. So, the first line of a 3D LUT indicates the 17 sampling intervals in the 10-bit space:
The RGB colour cube, then, is divided by 17 vertices on each of the R, G, and B axes corresponding to these values, resulting in 17x17x17 RGB values. This is the same number and ratio of vertices that are output in the 3D LUT files created by the Kodak Display Manager.
The 3D LUT file then lists transformed RGB colour output values for each input colour value.
The 3D LUT list assigns a colour value for every vertex. The RGB values on the first line in the list are for (0,0,0), those on the second line are for (0,0,1), and those on the third line are for (0,0,2). Values for the blue index are incremented first, followed by the green index, followed by the red index, until the whole list of 17x17x17 is complete.
The vertex ordering is represented by the following:
For example, suppose the third line of the vertex list in a 3D LUT file is:
The third line in the list corresponds to the vertex in the 3D colour cube at the following coordinates: (0,0,2). Using the 17x17x17 subdivided colour cube, and the intervals indicated in the first line of the file, these coordinates correspond to the input colour (R=0, G=0, B=128).
That means that the input colour (0,0,128) will be mapped to the output colour (12,30,141).
Since most input colour values fall between the RGB values corresponding to the 17 sampling intervals, output colour values often result from an interpolation between the surrounding vertices.