Creating Passthrough Color LUTs
Updated: Jun 26, 2024
Color lookup tables (LUT) can be stored in a regular image by flattening one of its dimensions into a 2D image. This is an example of what a color LUT looks like:
You can use regular Texture 2D assets as color LUTs in
OVRPassthroughLayer, but the texture must satisfy some requirements to work and create the desired effect:
- The LUT resolution (R, number of values per dimension) must be a power of 2. Common values are 16, 32, and 64.
- The image must contain R tiles, where each tile represents all red and green values for one specific blue value. Each tile contains R x R pixels, where the x-axis corresponds to red and the y-axis corresponds to green.
- The tiles can either be stacked horizontally or arranged in a square (examples).
Square layouts are only possible if the square root of R is an integer, for example 16 or 64.
Creating a LUT texture in an image editor
Color LUTs can be generated by leveraging the color adjustment tools provided by any image editing software, such as Adobe Photoshop or GIMP. This tutorial demonstrates how to make adjustments in Photoshop, but the steps for other image editors are similar.
To create your own color LUT texture, follow these steps:
- In Adobe Photoshop, open a representative image for the expected user environment (for example, a living room). To approximate the final experience as closely as possible, this should be a screenshot of passthrough, taken on the targeted headset(s). You can use one of the reference screenshots provided at the end of this document.
- Open the Adjustments tab (Windows > Adjustments).
- Add any desired adjustment layer, such as Curves or Color Balance as in the example below.
- Click on the added adjustment layers to show their Properties tab. Tune the properties to create the desired change in color.
- Once you are happy with the results, open one of the neutral color LUT images found on Neutral Color LUTs in Photoshop.
- Larger LUTs reflect color changes more accurately, but have a bigger performance impact. Experiment with different resolutions and using the smallest one that meets your desired quality.
- Go to Window > Arrange > 2-up Vertical to see the two images side by side.
- Drag all of your adjustments layers from the passthrough screenshot to the neutral color LUT image.
- Go to File > Save As... and save the modified LUT image. Use a lossless image format such as PNG.
Save these images and load them in your image editor to preview color grading effects before applying them to a neutral LUT image.
Cold / natural lighting:
Warm / artificial lighting:
To apply a LUT texture in your app, do the following:
- Import the image into your Unity project.
- Apply the color LUT to a passthrough layer as outlined in Customize Passthrough.
- Ensure that Flip Vertically is checked in OVRPassthroughLayer if you used one of the neutral color LUTs provided above.