Unity 1.30 Reference Guide

OVROverlay Class Reference

Add OVROverlay script to an object with an optional mesh primitive rendered as a TimeWarp overlay instead by drawing it into the eye buffer.
MonoBehaviour inherited by OVROverlay.

Public Types

enum
OverlayShape {
OverlayShape.Quad = OVRPlugin.OverlayShape.Quad, OverlayShape.Cylinder = OVRPlugin.OverlayShape.Cylinder, OverlayShape.Cubemap = OVRPlugin.OverlayShape.Cubemap, OverlayShape.OffcenterCubemap = OVRPlugin.OverlayShape.OffcenterCubemap, OverlayShape.Equirect = OVRPlugin.OverlayShape.Equirect
}
Determines the on-screen appearance of a layer.
enum
OverlayType {
}
Whether the layer appears behind or infront of other content in the scene.

Data Fields

OverlayType
Specify overlay's type
bool
If true, the texture's content is copied to the compositor each frame.
bool
If true, the layer would be used to present protected content (e.g.
bool
If true, the layer will be created as an external surface.
int
The width which will be used to create the external surface.
int
The height which will be used to create the external surface.
int
The compositionDepth defines the order of the OVROverlays in composition.
OverlayShape
Specify overlay's shape
Texture []
The left- and right-eye Textures to show in the layer.
System.IntPtr
The Surface object (Android only).
ExternalSurfaceObjectCreated
Will be triggered after externalSurfaceTextueObject get created.

Private Data Fields

OverlayShape
LayerTexture []
OVRPlugin.LayerDesc
int
int
int
layerId ( )
GCHandle
IntPtr
int
int
Renderer
rend ( )

Object Data

IntPtr []
bool

Object Data

const int

Object Data

static OVROverlay []

Private Static Fields

static Material
static Material

Properties

OVRPlugin.LayerLayout
layout ( ) [Get]
int

Public Member Functions

delegate void
void
OverrideOverlayTextureInfo ( Texture srcTexture, IntPtr nativePtr, UnityEngine.VR.VRNode node )
Use this function to set texture and texNativePtr when app is running GetNativeTexturePtr is a slow behavior, the value should be pre-cached

Private Member Functions

bool
CreateLayer ( int mipLevels, int sampleCount, OVRPlugin.EyeTextureFormat etFormat, int flags, OVRPlugin.Sizei size, OVRPlugin.OverlayShape shape )
bool
CreateLayerTextures ( bool useMipmaps, OVRPlugin.Sizei size, bool isHdr )
void
void
bool
OVRPlugin.LayerDesc
bool
PopulateLayer ( int mipLevels, bool isHdr, OVRPlugin.Sizei size, int sampleCount, int stage )
bool
SubmitLayer ( bool overlay, bool headLocked, OVRPose pose, Vector3 scale, int frameIndex )
void
Awake ( )
void
void
void
bool
ComputeSubmit ( ref OVRPose pose, ref Vector3 scale, ref bool overlay, ref bool headLocked )
void

Detailed Description

This will take full advantage of the display resolution and avoid double resampling of the texture.
We support 3 types of Overlay shapes right now
  1. Quad : This is most common overlay type , you render a quad in Timewarp space.
  2. Cylinder: [Mobile Only][Experimental], Display overlay as partial surface of a cylinder
    • The cylinder's center will be your game object's center
    • We encoded the cylinder's parameters in transform.scale, **[scale.z] is the radius of the cylinder **[scale.y] is the height of the cylinder **[scale.x] is the length of the arc of cylinder
  • Limitations **Only the half of the cylinder can be displayed, which means the arc angle has to be smaller than 180 degree, [scale.x] / [scale.z] <= PI **Your camera has to be inside of the inscribed sphere of the cylinder, the overlay will be faded out automatically when the camera is close to the inscribed sphere's surface. **Translation only works correctly with vrDriver 1.04 or above
  1. Cubemap: Display overlay as a cube map
  2. OffcenterCubemap: [Mobile Only] Display overlay as a cube map with a texture coordinate offset
    • The actually sampling will looks like [color = texture(cubeLayerSampler, normalize(direction) + offset)] instead of [color = texture( cubeLayerSampler, direction )]
    • The extra center offset can be feed from transform.position
    • Note: if transform.position's magnitude is greater than 1, which will cause some cube map pixel always invisible Which is usually not what people wanted, we don't kill the ability for developer to do so here, but will warn out.
  3. Equirect: Display overlay as a 360-degree equirectangular skybox.

Member Enumeration Documentation

enum OVROverlay.OverlayShape
Determines the on-screen appearance of a layer.
Enumerator
Quad= OVRPlugin.OverlayShape.Quad
Cylinder= OVRPlugin.OverlayShape.Cylinder
Cubemap= OVRPlugin.OverlayShape.Cubemap
OffcenterCubemap= OVRPlugin.OverlayShape.OffcenterCubemap
Equirect= OVRPlugin.OverlayShape.Equirect
enum OVROverlay.OverlayType
Whether the layer appears behind or infront of other content in the scene.
Enumerator
None
Underlay
Overlay

Field Documentation

OverlayType OVROverlay.currentOverlayType ( )
Specify overlay's type
bool OVROverlay.isDynamic ( )
If true, the texture's content is copied to the compositor each frame.
bool OVROverlay.isProtectedContent ( )
If true, the layer would be used to present protected content (e.g.
HDCP). The flag is effective only on PC.
bool OVROverlay.isExternalSurface ( )
If true, the layer will be created as an external surface.
externalSurfaceObject contains the Surface object. It's effective only on Android.
int OVROverlay.externalSurfaceWidth ( )
The width which will be used to create the external surface.
It's effective only on Android.
int OVROverlay.externalSurfaceHeight ( )
The height which will be used to create the external surface.
It's effective only on Android.
int OVROverlay.compositionDepth ( )
The compositionDepth defines the order of the OVROverlays in composition.
The overlay/underlay with smaller compositionDepth would be composited in the front of the overlay/underlay with larger compositionDepth.
OverlayShape OVROverlay.currentOverlayShape ( )
Specify overlay's shape
Texture [] OVROverlay.textures ( )
The left- and right-eye Textures to show in the layer.
Note:
If you need to change the texture on a per-frame basis, please use OverrideOverlayTextureInfo(..) to avoid caching issues.
System.IntPtr OVROverlay.externalSurfaceObject ( )
The Surface object (Android only).
ExternalSurfaceObjectCreated OVROverlay.externalSurfaceObjectCreated ( )
Will be triggered after externalSurfaceTextueObject get created.

Object Data Documentation

OverlayShape OVROverlay.prevOverlayShape ( )
LayerTexture [] OVROverlay.layerTextures ( )
OVRPlugin.LayerDesc OVROverlay.layerDesc ( )
int OVROverlay.stageCount ( )
int OVROverlay.layerIndex ( )
int OVROverlay.layerId ( )
GCHandle OVROverlay.layerIdHandle ( )
IntPtr OVROverlay.layerIdPtr ( )
int OVROverlay.frameIndex ( )
int OVROverlay.prevFrameIndex ( )
Renderer OVROverlay.rend ( )

Object Data Documentation

IntPtr [] OVROverlay.texturePtrs ( )
bool OVROverlay.isOverridePending ( )

Object Data Documentation

const int OVROverlay.maxInstances ( )

Object Data Documentation

OVROverlay [] OVROverlay.instances ( )

Private Static Field Documentation

Material OVROverlay.tex2DMaterial ( )
Material OVROverlay.cubeMaterial ( )

Property Documentation

OVRPlugin.LayerLayout OVROverlay.layout ( )
int OVROverlay.texturesPerStage ( )

Member Function Documentation

delegate void OVROverlay.ExternalSurfaceObjectCreated ( )
void OVROverlay.OverrideOverlayTextureInfo ( Texture srcTexture, IntPtr nativePtr, UnityEngine.VR.VRNode node )
Use this function to set texture and texNativePtr when app is running GetNativeTexturePtr is a slow behavior, the value should be pre-cached

Object Data Documentation

bool OVROverlay.CreateLayer ( int mipLevels, int sampleCount, OVRPlugin.EyeTextureFormat etFormat, int flags, OVRPlugin.Sizei size, OVRPlugin.OverlayShape shape )
bool OVROverlay.CreateLayerTextures ( bool useMipmaps, OVRPlugin.Sizei size, bool isHdr )
void OVROverlay.DestroyLayerTextures ( )
void OVROverlay.DestroyLayer ( )
bool OVROverlay.LatchLayerTextures ( )
OVRPlugin.LayerDesc OVROverlay.GetCurrentLayerDesc ( )
bool OVROverlay.PopulateLayer ( int mipLevels, bool isHdr, OVRPlugin.Sizei size, int sampleCount, int stage )
bool OVROverlay.SubmitLayer ( bool overlay, bool headLocked, OVRPose pose, Vector3 scale, int frameIndex )
void OVROverlay.Awake ( )
void OVROverlay.OnEnable ( )
void OVROverlay.OnDisable ( )
void OVROverlay.OnDestroy ( )
bool OVROverlay.ComputeSubmit ( ref OVRPose pose, ref Vector3 scale, ref bool overlay, ref bool headLocked )
void OVROverlay.LateUpdate ( )
The documentation for this class was generated from the following file: Oculus/VR/Scripts/OVROverlay.cs