Passthrough Color LUT Tutorial
Updated: Jan 4, 2025
In this tutorial, you will modify the
Passthrough Basic Tutorial to set up a simple color LUT (color look up table)-enhanced passthrough environment. Here are the steps:
- In the Project tab, under the Assets folder, create a new folder named Passthrough Color LUT Tutorial, and then select it to make it the current folder for new objects.
- In the Project Hierarchy, right click SampleScene, and choose Save Scene As. Give the new scene a unique name, such as PassthroughColorLUTTutorial. This becomes the active scene in the Hierarchy.
- Remove any game objects from the scene, except for the Directional Light and OVRCameraRig.
Create the PassthroughColorLUTController Script
- On the top menu, go to Assets > Create > C# Script, and name it PassthroughColorLUTController.
- Double-click the new script to open it.
Create a serialized Texture2D field by adding the following code snippet to the PassthroughColorLUTController class. Later, we will assign our Texture2D asset to it in the Inspector.
[SerializeField]
private Texture2D _2dColorLUT;
public Texture2D ColorLUT2D => _2dColorLUT;
private OVRPassthroughColorLut ovrpcl;
private OVRPassthroughLayer passthroughLayer;
void Start()
{
OVRCameraRig ovrCameraRig = FindObjectOfType<OVRCameraRig>();
if (ovrCameraRig == null)
{
Debug.LogError("Scene does not contain an OVRCameraRig");
return;
}
passthroughLayer = ovrCameraRig.GetComponent<OVRPassthroughLayer>();
if (passthroughLayer == null)
{
Debug.LogError("OVRCameraRig does not contain an OVRPassthroughLayer component");
return;
}
ovrpcl = new OVRPassthroughColorLut(_2dColorLUT, flipY: false);
passthroughLayer.SetColorLut(ovrpcl, weight: 1);
}
For this tutorial, the relevant action is setting the passed-in LUT image into the passthrough layer. When we create the color LUT object, we specify the passed-in LUT image, and a value of false for flipY (the image we will use is already flipped -- that is, the solid black portion of the image is to the lower right).
When we call
SetColorLut, we provide the passed-in LUT image, and a weight value of
1, since we want the colors to be taken fully from the LUT.
- Save the script.
Assign the Script to OVRCameraRig
- In the Hierarchy window, click OVRCameraRig.
- In the Inspector, scroll to the bottom and choose Add Component.
- Search for the PassthroughColorLUTController and add it.
Add the Color LUT Texture2D to PassthroughColorLUTController
- In the Inspector, expand the Passthrough Color LUT Controller component.
- Save the following inverted-lut image to your Assets folder. This image comes from the Starter Samples project. Make sure the Compression value of the asset is set to
None.

- Drag the inverted-lut asset to the Passthrough Color LUT Controller component 2d Color LUT field.
Your project should resemble the following figure:
Alternatively, Assign Color LUT Texture directly to OVRPassthroughLayer
You can achieve the same outcome without utilizing a separate script, PassthroughColorLUTController, by directly assigning the Color LUT texture to the OVRPassthroughLayer component.
- In the Hierarchy window, click OVRCameraRig.
- In the Inspector, expand the OVR Passthrough Layer component.
- In the Color Control dropdown, choose Color LUT.
- Drag the inverted-lut asset to the OVR Passthrough Layer component LUT field. If prompted, select Fix image compression.
Save, Build, and Run the Project
- On the top menu, go to File > Save, and then go to File > Save Project.
- On the top menu, go to File > Build Settings to open the settings window.
- Remove the previous scenes from the Scenes in Build pane. Then click Add Open Scenes. Only your new PassthroughColorLUTTutorial should be in the build.
- Make sure that the Run Device is set to Meta Quest headset that is connected via USB cable.
- Click Build and Run.
- Save the .APK file.
Put on the headset to test the color effect. Your passthrough environment should resemble the following figure:
Reference: The Full Passthrough Color LUT Controller Script
For your reference, here is the full controller script.
using UnityEngine;
public class PassthroughColorLUTController : MonoBehaviour
{
[SerializeField]
private Texture2D _2dColorLUT;
public Texture2D ColorLUT2D => _2dColorLUT;
private OVRPassthroughColorLut ovrpcl;
private OVRPassthroughLayer passthroughLayer;
void Start()
{
OVRCameraRig ovrCameraRig = FindObjectOfType<OVRCameraRig>();
if (ovrCameraRig == null)
{
Debug.LogError("Scene does not contain an OVRCameraRig");
return;
}
passthroughLayer = ovrCameraRig.GetComponent<OVRPassthroughLayer>();
if (passthroughLayer == null)
{
Debug.LogError("OVRCameraRig does not contain an OVRPassthroughLayer component");
return;
}
ovrpcl = new OVRPassthroughColorLut(_2dColorLUT, flipY: false);
passthroughLayer.SetColorLut(ovrpcl, weight: 1);
}
void Update()
{
}
}