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

OVROverlay Class

Extends MonoBehaviour
Enables efficient rendering of UI elements and media as compositor layers that bypass Unity's rendering pipeline.
Overlays are rendered directly by the VR compositor at native display resolution for improved visual quality. Supports multiple shapes (quad, cylinder, equirect, cubemap), stereo textures, and advanced filtering options. Use for UI elements, HUD components, video playback, and content requiring maximum visual clarity. Works with OVRManager for VR runtime integration and OVRPlugin for native functionality.

Protected Fields

frameIndex : int
Current frame index used for swap chain stage selection and texture update timing.
Increments each frame for dynamic overlays to cycle through available texture stages.
Signature
int frameIndex
isOverridePending : bool
Indicates whether a texture override operation is pending application.
Set to true when OverrideOverlayTextureInfo is called, reset after processing.
Signature
bool isOverridePending
layerDesc : OVRPlugin.LayerDesc
Layer descriptor containing the complete specification for the overlay layer as submitted to the compositor.
Defines all rendering parameters including format, size, layout, and feature flags.
Signature
OVRPlugin.LayerDesc layerDesc
layerIdHandle : GCHandle
GC handle maintaining a pinned reference to the layerId for safe compositor access.
Prevents garbage collection from moving the layerId value while compositor holds a pointer to it.
Signature
GCHandle layerIdHandle
layerIdPtr : IntPtr
Native pointer to the pinned layerId value for efficient compositor communication.
Allows VR runtime to directly access and modify the layer ID without managed/native transitions.
Signature
IntPtr layerIdPtr
layerTextures : LayerTexture[]
Array of texture structures for each eye/stage.
Single entry for mono, two entries for stereo rendering.
Signature
LayerTexture [] layerTextures
prevFrameIndex : int
Previous frame index used to detect when texture updates are needed and prevent duplicate processing.
Helps optimize rendering by avoiding redundant texture population within the same frame.
Signature
int prevFrameIndex
rend : Renderer
Reference to the Renderer component attached to this GameObject, if any.
Used for backward compatibility and automatic renderer visibility management.
Signature
Renderer rend
stageCount : int
Number of texture stages in the compositor swap chain for this overlay layer.
Typically 3 for triple buffering to prevent blocking during texture updates.
Signature
int stageCount
texturePtrs : IntPtr[]
Signature
IntPtr [] texturePtrs

Fields

colorOffset : Vector4
RGBA color offset added to the overlay when overridePerLayerColorScaleAndOffset is enabled.
Each component is added to the corresponding channel after colorScale multiplication. Default value (0,0,0,0) applies no offset. Use for color tinting, brightness boost, or fade to color.
Signature
Vector4 colorOffset
colorScale : Vector4
RGBA color multiplier applied to the overlay when overridePerLayerColorScaleAndOffset is enabled.
Each component multiplies the corresponding channel in the source texture before colorOffset is applied. Default value (1,1,1,1) applies no scaling. Use for brightness adjustment, color tinting, or transparency fading.
Signature
Vector4 colorScale
compositionDepth : int
Controls depth ordering within the same OverlayType.
Lower values render first (behind).
Signature
int compositionDepth
currentOverlayShape : OverlayShape
Defines the geometric projection and rendering method for the overlay layer.
Each shape provides different ways to display content in 3D space, from flat panels to immersive 360-degree environments. Choose based on content type: Quad for UI/video, Cylinder for wrap-around content, Cubemap/Equirect for 360° content, Passthrough for mixed reality. Some shapes have platform limitations (Cylinder/OffcenterCubemap are mobile-only, Fisheye not supported on OpenXR).
Signature
OverlayShape currentOverlayShape
currentOverlayType : OverlayType
Controls overlay depth ordering relative to scene content.
Combined with compositionDepth for final render order. Determines whether overlay renders behind, in front, or disabled relative to scene content. Underlay for backgrounds/skyboxes, Overlay for UI/HUD, None to disable rendering completely.
Signature
OverlayType currentOverlayType
destRectLeft : Rect
Destination rectangle for left eye in normalized coordinates (0-1).
Requires overrideTextureRectMatrix enabled to take effect.
Signature
Rect destRectLeft
destRectRight : Rect
Destination rectangle for right eye in normalized coordinates (0-1).
Requires overrideTextureRectMatrix enabled to take effect.
Signature
Rect destRectRight
externalSurfaceHeight : int
[Android Only] Specifies the height in pixels for the external surface when isExternalSurface is enabled.
This dimension determines the resolution of the media content that can be rendered to the surface. Ensure the width/height ratio matches your content's aspect ratio to prevent distortion. Use the lowest resolution that provides acceptable quality. Some image producers may override these dimensions to match source content size.
Signature
int externalSurfaceHeight
externalSurfaceObject : System.IntPtr
The Surface object (Android only).
Signature
System.IntPtr externalSurfaceObject
externalSurfaceObjectCreated : ExternalSurfaceObjectCreated
Will be triggered after externalSurfaceTextueObject get created.
Signature
ExternalSurfaceObjectCreated externalSurfaceObjectCreated
externalSurfaceWidth : int
[Android Only] Specifies the width in pixels for the external surface when isExternalSurface is enabled.
This dimension determines the resolution of the media content that can be rendered to the surface. Choose dimensions that match your media content resolution for optimal quality. Higher resolutions consume more GPU resources. Some image producers may override these dimensions to match source content size.
Signature
int externalSurfaceWidth
hidden : bool
Controls overlay visibility.
When true, the overlay is hidden from rendering. Use this property to dynamically show/hide overlays without disabling the component. This is useful when the overlay may be frequently hidden and shown, without the performance hit of full layer teardown and setup.
Signature
bool hidden
invertTextureRects : bool
Inverts texture coordinates vertically to support legacy content where the texture origin was at the top-left.
Modern VR systems typically use bottom-left as the texture origin, so this property provides backward compatibility. Enable when working with legacy textures or content that appears upside-down in the overlay.
Signature
bool invertTextureRects
isAlphaPremultiplied : bool
Specifies whether the texture's alpha channel has been pre-multiplied with the RGB color channels.
This affects alpha blending behavior during overlay composition with scene content. In premultiplied alpha, RGB values are already multiplied by alpha (e.g., red pixel (1,0,0) with 50% alpha becomes (0.5,0,0,0.5)). Enable for modern rendering pipelines that use premultiplied alpha. Disable for standard "straight alpha" textures.
Signature
bool isAlphaPremultiplied
isDynamic : bool
Controls whether texture content is updated every frame (dynamic) or once (static).
Dynamic mode enables video and animated UI but consumes more GPU resources.
Signature
bool isDynamic
isExternalSurface : bool
[Android Only] Enables external surface rendering for advanced video and media integration.
When true, creates an Android Surface object that can be used with MediaPlayer, Camera2 API, or other native Android media frameworks. Use for video playback, camera feeds, or streaming content. External surfaces provide optimal video performance by bypassing Unity's texture management.
Signature
bool isExternalSurface
isProtectedContent : bool
Enables protected content rendering to prevent the overlay from appearing in screenshots, recordings, or screen captures.
When true, the layer uses HDCP (High-bandwidth Digital Content Protection) or similar mechanisms to protect copyrighted content. Use for DRM-protected media, copyrighted video content, or sensitive information. May have performance overhead and platform limitations.
Signature
bool isProtectedContent
layerTextureFormat : OVRPlugin.EyeTextureFormat
Specifies the pixel format for the overlay layer's texture data.
Controls color depth, precision, and gamma correction behavior. Use sRGB for standard UI/video, floating point for HDR content, linear for custom color management. The system automatically detects HDR formats from texture types. Higher precision formats consume more memory and bandwidth.
Signature
OVRPlugin.EyeTextureFormat layerTextureFormat
noDepthBufferTesting : bool
Disables depth buffer-based compositing and forces overlay ordering based solely on compositionDepth and currentOverlayType.
When true, prevents the overlay from being occluded by scene geometry even when "Shared Depth Buffer" is enabled in the VR runtime. Enable for UI elements that should always be visible (HUD, menus). Disable for 3D UI that should interact with scene geometry.
Signature
bool noDepthBufferTesting
overridePerLayerColorScaleAndOffset : bool
Enables per-layer color adjustment by applying custom color scaling and offset transformations.
When true, allows fine-tuning the visual appearance of overlays without modifying source textures. Use colorScale and colorOffset to control the adjustments. Final color = (SourceColor * colorScale) + colorOffset. More efficient than CPU texture modifications.
Signature
bool overridePerLayerColorScaleAndOffset
overrideTextureRectMatrix : bool
Enables the use of custom source and destination rectangles instead of default full-texture mapping.
When true, the srcRectLeft, srcRectRight, destRectLeft, and destRectRight properties control texture sampling and positioning. Use for stereo layouts, texture atlasing, or custom viewport positioning.
Signature
bool overrideTextureRectMatrix
srcRectLeft : Rect
Source rectangle for left eye in normalized coordinates (0,0) to (1,1).
For side-by-side stereo: use (0,0,0.5,1). For over-under: use (0,0.5,1,1).
Signature
Rect srcRectLeft
srcRectRight : Rect
Source rectangle for right eye in normalized coordinates (0,0) to (1,1).
For side-by-side stereo: use (0.5,0,0.5,1). For over-under: use (0,0,1,0.5).
Signature
Rect srcRectRight
textures : Texture[]
Defines the texture content displayed by the overlay layer for left and right eyes respectively.
Array index 0 contains the left eye texture, index 1 contains the right eye texture. For mono content, only index 0 is used and the same texture is displayed to both eyes. Use Cubemap textures for Cubemap shapes, Texture2D/RenderTexture for others. For dynamic content, use OverrideOverlayTextureInfo() to avoid expensive native pointer lookups per frame.
Signature
Texture [] textures
useAutomaticFiltering : bool
Enables intelligent filtering where the runtime automatically selects optimal image enhancement based on performance headroom and content.
Recommended for most applications.
Signature
bool useAutomaticFiltering
useBicubicFiltering : bool
Enables bicubic texture filtering for higher quality image scaling at the cost of increased GPU processing.
Provides smoother visual results compared to standard bilinear filtering when textures are scaled up or down. Use for high-resolution UI elements, text overlays, or detailed images when you have sufficient GPU budget. Consider useAutomaticFiltering to let the runtime decide based on performance characteristics.
Signature
bool useBicubicFiltering
useEfficientSharpen : bool
Enables efficient sharpening filter to enhance edge clarity and text readability with moderate performance impact.
This is a performance-optimized alternative to useExpensiveSharpen that provides good quality enhancement with reasonable GPU cost. Sharpening enhances edge contrast to make content appear crisper. Use for text-heavy UI overlays, soft/blurry images, or content with fine details. Cannot be used simultaneously with super sampling unless using useAutomaticFiltering.
Signature
bool useEfficientSharpen
useEfficientSupersample : bool
Enables efficient super sampling for improved visual quality with moderate performance impact.
This is a performance-optimized alternative to useExpensiveSuperSample that provides better quality with reasonable GPU cost. Super sampling renders content at higher resolution then downsamples for display, reducing aliasing. Use for text overlays, UI elements with fine details, or when visual quality is prioritized over performance. Cannot be used simultaneously with sharpening filters unless using useAutomaticFiltering.
Signature
bool useEfficientSupersample
useExpensiveSharpen : bool
Enables expensive sharpening filter for enhanced edge clarity.
WARNING: Performance-intensive feature that should only be used when you have sufficient GPU budget and require the highest possible visual quality. Not recommended for most applications.
Consider useAutomaticFiltering instead, to achieve better quality filtering when performance headroom allows.
Signature
bool useExpensiveSharpen
useExpensiveSuperSample : bool
Enables expensive super sampling for maximum image quality.
WARNING: Performance-intensive feature that should only be used when you have sufficient GPU budget and require the highest possible visual quality. Not recommended for most applications.
Consider useAutomaticFiltering instead, to achieve better quality filtering when performance headroom allows.
Signature
bool useExpensiveSuperSample
useLegacyCubemapRotation : bool
Enables legacy cubemap rotation behavior for backward compatibility.
DEPRECATED: This setting will be removed in future versions. Fix your cubemap textures instead of relying on this legacy behavior.
Signature
bool useLegacyCubemapRotation

Protected Static Fields

cubeMaterial : readonly Material[]
Array of materials used for blitting individual cubemap faces to overlay swap chains.
Each material extracts and processes a specific face of the cubemap.
Signature
readonly Material [] cubeMaterial
tex2DMaterial : Material
Shared material used for blitting 2D textures to overlay swap chains.
Contains the shader and settings for efficient texture copying and format conversion.
Signature
Material tex2DMaterial

Static Fields

instances : readonly List< OVROverlay >
Global registry of all active OVROverlay instances in the scene.
Used by the overlay system to manage layer indices, track overlay lifecycle, and optimize resource allocation. Provides automatic layer index assignment, efficient reuse of destroyed overlay slots, and proper cleanup coordination. Not thread-safe - use only on main Unity thread. Total overlay count can impact VR compositor performance.
Signature
readonly List<OVROverlay> instances

Protected Properties

layout : OVRPlugin.LayerLayout
[Get]
Determines texture layout for the overlay layer based on configured textures.
Returns Stereo if separate left/right eye textures are provided on Android, otherwise Mono.
Signature
OVRPlugin.LayerLayout layout
texturesPerStage : int
[Get]
Returns the number of textures needed per stage based on the current layout configuration.
Returns 2 for stereo layout (separate left/right eye textures), 1 for mono layout (shared texture).
Used to determine array sizes for texture management and processing loops. Stereo layout is only supported on Android platforms with separate eye textures.
Signature
int texturesPerStage

Properties

isOverlayVisible : bool
[Get]
Indicates whether the overlay layer is currently visible and successfully submitted to the compositor.
Updated each frame during rendering to reflect the actual visibility state.
This property is set to true when the overlay is successfully submitted to the VR compositor and not hidden via the hidden flag. Used to determine whether to disable the associated Renderer component for performance optimization.
Signature
bool isOverlayVisible
layerId : int
[Get]
The unique identifier assigned by the VR compositor for this overlay layer.
This handle is used internally to reference the layer in all compositor operations and submissions. Set to 0 initially, positive values indicate active layer, reset to 0 when destroyed. Used for texture submission, property updates, and cleanup operations. Managed on main Unity thread only. A layerId of 0 indicates initialization failure or destroyed state.
Signature
int layerId
layerIndex : int
[Get]
Index of this overlay instance within the global instances registry.
Used for layer composition ordering and efficient overlay management.
Signature
int layerIndex
OpenVROverlayKey : string
[Get]
Signature
string OpenVROverlayKey
previewInEditor : bool
[Get][Set]
[Editor Only] Enables preview visualization of the overlay in the Unity Scene view using a mesh renderer.
This helps with positioning and setup during development but has no effect at runtime. Creates a visual representation for positioning overlays, visualizing size/shape, and debugging placement. Only approximates VR appearance and may not represent all shapes accurately. No impact on runtime performance.
Signature
bool previewInEditor

Protected Methods

BlitSubImage ( src , width , height , mat , rect )
Performs optimized texture blitting to a specific region using command buffer operations.
Renders the source texture to a sub-region with custom projection and viewport settings. Uses scissor rectangle and viewport offsetting to blit only the necessary region, reducing GPU bandwidth. Integrates with Unity's command buffer system for efficient GPU command submission.
Signature
void BlitSubImage(Texture src, int width, int height, Material mat, Rect rect)
Parameters
src: Texture  Source texture to blit from
width: int  Full target texture width in pixels
height: int  Full target texture height in pixels
mat: Material  Material/shader to use for the blit operation
rect: Rect  Target rectangle in pixel coordinates within the destination texture
Returns
void
CreateLayer ( mipLevels , sampleCount , etFormat , flags , size , shape )
Creates a new overlay layer in the VR compositor with the specified parameters.
Handles layer descriptor creation, compositor setup, and instance registry management.
Signature
bool CreateLayer(int mipLevels, int sampleCount, OVRPlugin.EyeTextureFormat etFormat, int flags, OVRPlugin.Sizei size, OVRPlugin.OverlayShape shape)
Parameters
mipLevels: int  Number of mip levels for the layer texture
sampleCount: int  Sample count for multisampling
etFormat: OVRPlugin.EyeTextureFormat  Texture format for the layer
flags: int  Layer feature flags
size: OVRPlugin.Sizei  Layer texture dimensions
shape: OVRPlugin.OverlayShape  Geometric shape of the overlay
Returns
bool  True if layer creation succeeded, false otherwise
CreateLayerTextures ( useMipmaps , size , isHdr )
Creates compositor-managed texture swap chains for this overlay layer.
Signature
bool CreateLayerTextures(bool useMipmaps, OVRPlugin.Sizei size, bool isHdr)
Parameters
useMipmaps: bool  Whether to create textures with mipmap support
size: OVRPlugin.Sizei  Dimensions of the textures to create in pixels
isHdr: bool  Whether to use HDR texture format (16-bit floating point)
Returns
bool  True if new textures were created or texture copying is needed for this frame
DestroyLayer ()
Destroys the overlay layer and releases all associated compositor resources.
Cleans up the layer ID, destroys textures, and removes the overlay from the global instances registry. Performs comprehensive cleanup: hides overlay, removes from registry, destroys layer, releases handles, resets state. Can be called multiple times safely. Automatically invoked by OnDisable, OnDestroy, and TrySubmitLayer when needed.
Signature
void DestroyLayer()
Returns
void
DestroyLayerTextures ()
Destroys all layer textures and cleans up swap chain resources.
Called during layer teardown to free compositor texture memory.
Signature
void DestroyLayerTextures()
Returns
void
GetBlitRect ( eyeId , width , height , invertRect )
Calculates the pixel-perfect blit rectangle for texture copying operations.
Converts normalized source rectangles to exact pixel coordinates with appropriate padding. For stereo textures, uses appropriate eye rectangle. For shared textures, calculates union of both eyes. Adds 2-pixel border to handle texture filtering edge cases.
Signature
Rect GetBlitRect(int eyeId, int width, int height, bool invertRect)
Parameters
eyeId: int  Eye index (0=left, 1=right) for stereo or shared texture rectangle calculation
width: int  Target texture width in pixels
height: int  Target texture height in pixels
invertRect: bool  Whether to invert Y coordinates for different texture coordinate systems
Returns
Rect  Pixel-accurate rectangle with 2-pixel padding for safe blitting operations
GetCurrentLayerDesc ()
Creates a layer descriptor structure with current overlay configuration for compositor submission.
Analyzes texture properties and overlay settings to generate the appropriate layer specification. Automatically detects HDR formats from texture types, sets feature flags based on enabled properties, and calculates appropriate dimensions from external surfaces or texture dimensions.
Signature
OVRPlugin.LayerDesc GetCurrentLayerDesc()
Returns
OVRPlugin.LayerDesc  Complete layer descriptor containing format, size, flags, and shape information for the compositor
LatchLayerTextures ()
Validates and caches native texture pointers for overlay rendering.
Ensures application textures are properly prepared and accessible to the VR compositor.
Signature
bool LatchLayerTextures()
Returns
bool  True if all required textures are valid and ready for rendering
PopulateLayer ( mipLevels , isHdr , size , sampleCount , stage )
Copies application textures to compositor swap chain textures using optimized blitting operations.
Handles format conversion, alpha premultiplication, and texture rectangle processing.
Signature
bool PopulateLayer(int mipLevels, bool isHdr, OVRPlugin.Sizei size, int sampleCount, int stage)
Parameters
mipLevels: int  Number of mip levels to populate
isHdr: bool  Whether to use HDR rendering format
size: OVRPlugin.Sizei  Texture dimensions
sampleCount: int  MSAA sample count
stage: int  Swap chain stage index to populate
Returns
bool  True if texture population succeeded
SetupEditorPreview ()
Creates or destroys the editor preview object based on previewInEditor setting.
Manages Unity editor visualization for overlay positioning and debugging.
Signature
void SetupEditorPreview()
Returns
void
SubmitLayer ( overlay , headLocked , noDepthBufferTesting , pose , scale , frameIndex )
Submits the overlay layer to the VR compositor with configured rendering parameters.
Handles filtering validation, texture matrix updates, and alpha premultiplication settings.
Signature
bool SubmitLayer(bool overlay, bool headLocked, bool noDepthBufferTesting, OVRPose pose, Vector3 scale, int frameIndex)
Parameters
overlay: bool  Whether to render as overlay (true) or underlay (false)
headLocked: bool  Whether the overlay is locked to head movement
noDepthBufferTesting: bool  Whether to disable depth buffer testing
pose: OVRPose  World-space pose of the overlay
scale: Vector3  Scale transformation for the overlay
frameIndex: int  Frame index for swap chain synchronization
Returns
bool  True if overlay submission succeeded and is visible

Methods

ExternalSurfaceObjectCreated ()
Signature
delegate void ExternalSurfaceObjectCreated()
Returns
delegate void
OverrideOverlayTextureInfo ( srcTexture , nativePtr , node )
Overrides the overlay texture information for dynamic texture updates at runtime.
Use this method to efficiently update overlay textures without triggering expensive native texture pointer lookups each frame. GetNativeTexturePtr() is expensive - pre-cache the pointer and use this method instead of directly assigning to textures array.
Signature
void OverrideOverlayTextureInfo(Texture srcTexture, IntPtr nativePtr, UnityEngine.XR.XRNode node)
Parameters
srcTexture: Texture  The source texture to display in the overlay
nativePtr: IntPtr  Pre-cached native texture pointer obtained from GetNativeTexturePtr()
node: UnityEngine.XR.XRNode  XR node specifying which eye (LeftEye=0, RightEye=1) to update
Returns
void
ResetEditorPreview ()
Resets the editor preview by toggling the previewInEditor setting.
Forces recreation of the preview visualization object with current overlay settings.
Signature
void ResetEditorPreview()
Returns
void
SetPerLayerColorScaleAndOffset ( scale , offset )
Sets custom color scaling and offset values for the overlay layer and enables color adjustment.
This method provides a convenient way to apply color transformations without manually setting individual properties.
Applies the provided scale and offset values. The final color is calculated as: (SourceColor * scale) + offset.
Signature
void SetPerLayerColorScaleAndOffset(Vector4 scale, Vector4 offset)
Parameters
scale: Vector4  RGBA color multiplier values. Default (1,1,1,1) applies no scaling.
offset: Vector4  RGBA color offset values added after scaling. Default (0,0,0,0) applies no offset.
Returns
void
SetSrcDestRects ( srcLeft , srcRight , destLeft , destRight )
Configures texture mapping rectangles for stereo rendering by setting source and destination rectangles for both left and right eyes simultaneously.
Source rectangles define which portion of the input texture is sampled (normalized 0-1 coordinates). Destination rectangles define where the content appears in the final overlay rendering.
Signature
void SetSrcDestRects(Rect srcLeft, Rect srcRight, Rect destLeft, Rect destRight)
Parameters
srcLeft: Rect  Source rectangle for left eye texture sampling (normalized 0-1)
srcRight: Rect  Source rectangle for right eye texture sampling (normalized 0-1)
destLeft: Rect  Destination rectangle for left eye rendering (normalized 0-1)
destRight: Rect  Destination rectangle for right eye rendering (normalized 0-1)
Returns
void
UpdateTextureRectMatrix ()
Updates the internal texture rectangle matrix for advanced UV coordinate transformations.
Handles coordinate conversions for external surfaces, texture inversion, and fisheye projections. Converts source/destination rectangles into GPU-ready transformation matrices. External surfaces use inverted Y coordinates, fisheye applies -0.5 offset for centering. Populates textureRectMatrix with scale/bias values for compositor UV transformation.
Signature
void UpdateTextureRectMatrix()
Returns
void

Protected Static Methods

NeedsTexturesForShape ( shape )
Determines if the specified overlay shape requires texture content.
Passthrough shapes don't need textures as they display real-world content.
Signature
static bool NeedsTexturesForShape(OverlayShape shape)
Parameters
shape: OverlayShape  The overlay shape to check
Returns
bool  True if the shape requires texture content, false for passthrough shapes

Static Methods

IsPassthroughShape ( shape )
Determines whether the specified overlay shape is a passthrough type that displays real-world content.
Passthrough shapes don't require texture content as they render camera or environment data directly.
Passthrough shapes include: ReconstructionPassthrough, SurfaceProjectedPassthrough, KeyboardHandsPassthrough, and KeyboardMaskedHandsPassthrough. These shapes are used for mixed reality applications where real-world content is integrated with virtual elements.
Signature
static bool IsPassthroughShape(OverlayShape shape)
Parameters
shape: OverlayShape  The overlay shape to check
Returns
bool  True if the shape displays real-world content, false if it requires application textures

Inner Struct

LayerTexture Struct

Texture information for a single eye/stage in the overlay rendering pipeline.
Manages Unity textures and compositor swap chain textures for multi-buffered rendering. Contains both application textures from textures and compositor-managed swap chain for efficient GPU rendering. Used in layerTextures array with one entry per eye/stage for stereo or mono content.

Fields

appTexture : Texture
Unity application texture provided through textures array.
Contains the original texture source for overlay rendering. This is the source texture that gets copied to the compositor swap chain for VR display. Can be Texture2D, RenderTexture, or Cubemap.
Signature
Texture appTexture
appTexturePtr : IntPtr
Native pointer to application texture for direct compositor access. Cached pointer for efficient texture submission to VR runtime.
Signature
IntPtr appTexturePtr
swapChain : Texture[]
Compositor-managed textures forming the swap chain for multi-buffered rendering. Array of textures provided by VR compositor for direct rendering.
Signature
Texture [] swapChain
swapChainPtr : IntPtr[]
Native pointers to each swap chain texture for efficient GPU memory access. Cached native handles for direct GPU texture operations.
Signature
IntPtr [] swapChainPtr

Inner Enums

OverlayShape Enum

Geometric shape and projection method for overlay rendering.
Platform support varies by shape. Defines rendering projections from flat quads to 360° environments. Used with currentOverlayShape property. Each shape interprets Transform components differently for positioning, rotation, and scaling. Supports standard surfaces (Quad, Cylinder), 360° content (Cubemap, Equirect), and mixed reality (Passthrough shapes).

Enumeration Constants

MemberValueDescription
Quad
OVRPlugin.OverlayShape.Quad
Flat rectangular surface for UI panels and video content. Most efficient option. Position: Uses Transform.position for world placement. Rotation: Uses Transform.rotation for orientation. Scale: Transform.lossyScale defines width (X), height (Y), and depth (Z, typically ignored).
Cylinder
OVRPlugin.OverlayShape.Cylinder
Cylindrical surface wrapping around user. [Mobile Only] Position: Uses Transform.position for cylinder center. Rotation: Uses Transform.rotation for cylinder orientation. Scale: lossyScale.z defines radius, lossyScale.x defines the arc angle, lossyScale.y defines height.
Cubemap
OVRPlugin.OverlayShape.Cubemap
360° cube map using 6 faces. Requires Cubemap texture. Position: Always positioned at head camera location (Transform.position ignored). Rotation: Uses Transform.rotation with platform-specific adjustments. Scale: Transform.lossyScale typically ignored as cubemap fills entire view. Legacy rotation behavior controlled by useLegacyCubemapRotation.
OffcenterCubemap
OVRPlugin.OverlayShape.OffcenterCubemap
Off-center cube map with custom positioning. [Mobile Only] Position: Transform.position defines offset from head center (magnitude must be ≤ 1.0 to avoid invisible pixels). Rotation: Uses Transform.rotation. Scale: Transform.lossyScale typically ignored as cubemap fills entire view. Used for asymmetric 360° environments or rooms with off-center viewing positions.
Equirect
OVRPlugin.OverlayShape.Equirect
Equirectangular projection for 360° content at infinite distance. 2:1 aspect ratio optimal. Position: Rendered at infinite distance (Transform.position typically ignored). Rotation: Uses Transform.rotation for environment orientation. Scale: Transform.scale has no effect on the visuals of the layer. Ideal for skyboxes and distant 360° backgrounds.
ScaledEquirect
OVRPlugin.OverlayShape.ScaledEquirect
Finite-distance equirectangular projection with depth positioning. Position: Uses Transform.position for distance from viewer (enables parallax and depth perception). Rotation: Uses Transform.rotation for orientation. Scale: Transform.lossyScale controls apparent size at the specified distance. Allows 360° content with spatial depth relationships.
ReconstructionPassthrough
OVRPlugin.OverlayShape.ReconstructionPassthrough
Passthrough overlay displaying real-world environment with reconstruction. No texture required.
SurfaceProjectedPassthrough
OVRPlugin.OverlayShape.SurfaceProjectedPassthrough
Surface-projected passthrough mapping virtual content onto real surfaces. No texture required.
Fisheye
OVRPlugin.OverlayShape.Fisheye
Fisheye projection for wide field of view content. Not supported on OpenXR. Position: Uses Transform.position for placement. Rotation: Uses Transform.rotation for orientation. Scale: Transform.lossyScale controls fisheye effect intensity and apparent size.
KeyboardHandsPassthrough
OVRPlugin.OverlayShape.KeyboardHandsPassthrough
Passthrough showing hands over keyboard for mixed reality typing. No texture required.
KeyboardMaskedHandsPassthrough
OVRPlugin.OverlayShape.KeyboardMaskedHandsPassthrough
Masked passthrough showing hands over keyboard with occlusion handling. No texture required.

OverlayType Enum

Depth ordering and compositing behavior relative to main scene content.
Ordered by compositionDepth within each type. Controls whether overlay renders behind (Underlay), in front (Overlay), or disabled (None) relative to scene content.

Enumeration Constants

MemberDescription
None
Disables overlay rendering completely.
Underlay
Renders behind main scene content. Ideal for background environments and skyboxes.
Overlay
Renders in front of main scene content. Most common type for UI elements and HUD components.