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

UOculusXRPassthroughLayerBase Class

Extends UStereoLayerShape
Represents a layer used for passthrough.
The Passthrough API enables you to show the user's real environment in your mixed reality experiences. It offers several options to customize the appearance of passthrough, such as adjusting opacity, highlight salient edges in the image, or control the color reproduction. For passthrough to be visible, it must be enabled in the Meta XR Plugin via the UOculusXRHMDRuntimeSettings::bInsightPassthroughEnabled property.

Fields

Specifies whether passthrough should appear on top of (when LayerOrder is PassthroughLayerOrder_Overlay) or beneath (when LayerOrder is PassthroughLayerOrder_Underlay) the virtual content. The default is Overlay.
Defines the passthrough opacity. It can be used to blend between passthrough and VR when LayerOrder is set to Overlay, or to dim passthrough when LayerOrder is set to Underlay.
Enables or disables edge rendering. Use this flag to toggle the edge rendering but retain the previously selected color (including alpha) in the UI when it is disabled.
Color for the edge rendering.
Enables or disables the color mapping for this layer
Represents the color mapping technique applied to this layer. Prefer setting it with SetColorMapType() method
Controls whether to use a color map curve or a gradient. Use it together with ColorMapCurve property, or set it with EnableColorMapCurve().
Contains color mapping gradient which is used to convert grayscale passthrough to color. This property only has an effect if ColorMapType is set to ColorMapType_GrayscaleToColor.
Contains contrast setting for color mapping. Ranges from -1 (minimum) to 1 (maximum). This property only has an effect if ColorMapType is set to ColorMapType_ColorAdjustment, ColorMapType_Grayscale or ColorMapType_GrayscaleToColor.
Contains brightness setting for color mapping. Ranges from -1 (minimum) to 1 (maximum). This property only has an effect if ColorMapType is set to ColorMapType_ColorAdjustment, ColorMapType_Grayscale or ColorMapType_GrayscaleToColor.
Contains posterize setting for grayscale and grayscale to color mappings. Ranges from 0 to 1, where 0 = no posterization (no effect), 1 = reduce to two colors.
Contains saturation for color adjustment mapping. Ranges from -1 (minimum) to 1 (maximum).
Controls how ColorMapType_ColorLut color mapping technique is applied to passthrough. If the value is 0, then the appearance of Passthrough is unchanged. If it is 1, the colors are fully taken from the LUT. Values between 0 and 1 lead to a linear interpolation between the original color and the LUT color. If two LUTs are provided LutWeight is used to blend them. This value can be animated to create smooth transitions.
Color LUT properties. If only ColorLUTSource is provided it will be blended with passthrough layer using following formula: Result = ColorLUTSource * LutWeight + Passthrough * ( 1 - LutWeight )
Color LUT properties. If both ColorLUTSource and ColorLUTTarget are provided they will be blended using following formula: Result = ColorLUTsSource * ( 1 - LutWeight ) + ColorLUTsTarget * LutWeight
Contains the color value that will be multiplied to the pixel color values during compositing. Default is white = (1,1,1,1). This property only has an effect if ColorMapType is set to ColorMapType_GrayscaleToColor.
Contains the color value that will be added to the pixel color values during compositing. Default is black = (0,0,0,0). This property only has an effect if ColorMapType is set to ColorMapType_GrayscaleToColor.

Protected Fields

TArray< FLinearColor > ColorArray[Get]
TArray< FLinearColor > NeutralColorArray[Get]

Member Functions

This method changes the passthrough texture opacity. See TextureOpacityFactor for more details.
Parameters
InOpacity
New value of the passthrough texture opacity.
This method allows to enable or disable the edge rendering in this passthrough layer. See bEnableEdgeColor for more details.
Parameters
bInEnableEdgeColor
Specify true to enable edge rendering.
This method allows to enable or disable the color mapping technique which is configured for this passthrough layer.
Parameters
bInEnableColorMap
Specify true to enable the color mapping, and false to disable it.
Enable or disables the color map curve used to convert grayscale passthrough to color. This mehtod only has an effect when the color mapping type is set to ColorMapType_GrayscaleToColor. See bUseColorMapCurve for more details.
Parameters
bInEnableColorMapCurve
Specify true to apply the color map curve.
This method controls the color of the edges when edge rendering is enabled. See EdgeColor for more details.
Parameters
InEdgeColor
Edge rendering color.
Sets the color map controls for grayscale and grayscale to rgb color mappings. The method fails if ColorMapType is not set to ColorMapType_Grayscale or ColorMapType_GrayscaleToColor.
Parameters
InContrast
Contast of passthrough. Valid range: [-1, 1]. A value of 0 means that contrast is left unchanged.
InBrightness
Brightness of passthrough. Valid range: [-1, 1]. A value of 0 means that brightness is left unchanged.
InPosterize
Posterize of passthrough. Ranges from 0 to 1, where 0 = no posterization (no effect), 1 = reduce to two colors.
This method allows to configure brightness and contrast adjustment for Passthrough images. It fails if ColorMapType is not set to ColorMapType_ColorAdjustment.
Parameters
InContrast
Contast of passthrough. Valid range: [-1, 1]. A value of 0 means that contrast is left unchanged.
InBrightness
Brightness of passthrough. Valid range: [-1, 1]. A value of 0 means that brightness is left unchanged.
InSaturation
Saturation of passthrough. Valid range: [-1, 1]. A value of 0 means that saturation is left unchanged.
This method allows to configure the color scale and offset values applied to passthrough pixels. The method only has an effect if ColorMapType is set to ColorMapType_GrayscaleToColor.
Parameters
InColorScale
Color value that will be multiplied to the pixel color values during compositing. Default is {1,1,1,1}
InColorOffset
Color value that will be added to the pixel color values during compositing. Default is {0,0,0,0}.
Sets the color curve that will be added to the color map in grayscale modes --> will be converted into a gradient
Sets the color mapping technique applied to the passthrough texture if bEnableColorMap is set to true
Set color map array directly instead through a color curve. This method only has an affect when ColorMapType is set to ColorMapType_GrayscaleToColor
Clears any color maps previously applied to this layer and sets ColorMapType to ColorMapType_None value
Specifies whether passthrough should appear on top of (PassthroughLayerOrder_Overlay) or beneath (PassthroughLayerOrder_Underlay) the virtual content. The default is Overlay. See LayerOrder property for more details
Sets Color LUT source. If ColorMapType is Color LUT, then source will be blended with passthrough using folowing formula: Result = ColorLUTSource * LutWeight + Passthrough * (1 - LutWeight ) If ColorMapType is Interpolated Color LUT, then source will be blended with color LUT target using folowing formula: Result = ColorLUTSource * ( 1 - LutWeight ) + ColorLUTTarget * LutWeight
Sets Color LUT target. If ColorMapType is Interpolated Color LUT, then target will be blended with passthrough using folowing formula: Result = ColorLUTSource * ( 1 - LutWeight ) + ColorLUTTarget * LutWeight Note: If ColorLUTSource is not specified, Color LUT will be not be applied to the Passthrough layer.
Sets the color LUT weight. See LutWeight for more details
Removes color grading if any is active
void ClearLUTsReferences ( )
virtual void BeginDestroy ( )

Protected Functions

TArray< FLinearColor > GenerateColorArrayFromColorCurve
( const UCurveLinearColor * InColorMapCurve )
TArray< FLinearColor > GetOrGenerateNeutralColorArray ( )
TArray< FLinearColor > GenerateColorArray
( bool bInUseColorMapCurve,
const UCurveLinearColor * InColorMapCurve )
TArray< FLinearColor > GetColorArray
( bool bInUseColorMapCurve,
const UCurveLinearColor * InColorMapCurve )
FColorLutDesc GenerateColorLutDescription
( float InLutWeight,
void MarkStereoLayerDirty ( )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon