API reference
API reference
Select your platform
No SDKs available
No versions available

OVRPassthroughColorLut Class

Extends IDisposable
This class represents a color look-up table (LUT) that can be applied to an OVRPassthroughLayer in order to change the color reproduction of that passthrough layer.
Color LUTs map each RGB input color to a new RGB(A) color. It unlocks a number of effects:
  • Color grading and color correction
  • Stylizations, such as posterization or hue rotation
  • Color filtering and chroma keying
To apply a color LUT to a Passthrough layer, create a new instance of OVRPassthroughColorLut and call OVRPassthroughLayer.SetColorLut(). For more information and examples, see Color Mapping Techniques.

Member Enumerations

Enumeration ColorChannels

Rgb
= OVRPlugin.PassthroughColorLutChannels.Rgb
Rgba
= OVRPlugin.PassthroughColorLutChannels.Rgba

Properties

The size of one edge of the color cube spanned by the LUT.
For example, a resolution of 16 means that the LUT encompasses 16 * 16 * 16 colors. This property is defined at construction time and cannot be modified.
The color channels contained in each of the resulting colors.
Can be ColorChannels.Rgb or ColorChannels.Rgba. This property is defined at construction time and cannot be modified.
Deprecated
  • use IsValid instead.
Checks if the current state of the LUT is valid for use by an OVRPassthroughLayer.

Member Functions

Initialize the color LUT data from a texture.
Color channels are inferred from texture format. Use UpdateFrom() to update LUT data after construction.
Parameters
initialLutTexture
Texture to initialize the LUT from
flipY
Flag to inform whether the LUT texture should be flipped vertically. This is needed for LUT images which have color (0, 0, 0) in the top-left corner. Some color grading systems, e.g. Unity post-processing, have color (0, 0, 0) in the bottom-left corner, in which case flipping is not needed.
Set the color LUT data from an array of Color.
The resolution is inferred from the array size, thus the size needs to be a result of resolution = size ^ 3 * numColorChannels, where numColorChannels depends on channels. Use UpdateFrom() to update color LUT data after construction.
Parameters
initialColorLut
Color array to initialize the LUT from
channels
Color channels for one color LUT entry
Set the color LUT data from an array of Color.
The resolution is inferred from the array size, thus the size needs to be a result of resolution = size ^ 3 * numColorChannels, where numColorChannels depends on channels. Use UpdateFrom() to update color LUT data after construction.
Parameters
initialColorLut
Color32 array to initialize the LUT from
channels
Color channels for one color LUT entry
Set the color LUT data from an array of Color.
The resolution is inferred from the array size, thus the size needs to be a result of resolution = size ^ 3 * numColorChannels, where numColorChannels depends on channels. Use UpdateFrom() to update color LUT data after construction.
Parameters
initialColorLut
Color byte array to initialize the LUT from
channels
Color channels for one color LUT entry
Updates color LUT data from an array of Color.
The resolution (number of colors) must match the original specification at construction time. The alpha value is ignored if ColorChannels was set to Rgb.
Parameters
colors
Color array
Updates color LUT data from an array of Color32.
The resolution (number of colors) must match the original specification at construction time. The alpha value is ignored if ColorChannels was set to Rgb.
Parameters
colors
Color array
Updates color LUT data from an array of RGB(A) values.
The resolution (number of colors) must match the original specification at construction time. The expected number of bytes per color is 3 if ColorChannels was set to Rgb, 4 if it was set to Rgba.
Parameters
colors
Array of consecutive RGB(A) color tuples
Update color LUT data from a texture.
Color channels and resolution must match the original.
Parameters
lutTexture
Color LUT texture
flipY
Flag to inform whether the LUT texture should be flipped vertically. This is needed for LUT images which have color (0, 0, 0) in the top-left corner. Some color grading systems, e.g. Unity post-processing, have color (0, 0, 0) in the bottom-left corner, in which case flipping is not needed.
Free the system resources associated with the color LUT.
Subsequent calls to OVRPassthroughLayer.SetColorLut() with this instance will fail.

Static Member Functions

Check if the given texture is formatted correctly for the use as color LUT.
Parameters
texture
Texture to check
errorMessage
Error message describing acceptance fail reason
Returns
Did you find this page helpful?
Thumbs up icon
Thumbs down icon