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

OVRCubemapCapture Class

Extends MonoBehaviour
Helper script for capture cubemap and save it into PNG or JPG file.
How it works: 1) This script can be attached to a existing game object, you can also use prefab Assets\OVR\Prefabs\OVRCubemapCaptureProbe There are 2 ways to trigger a capture if you attached this script to a game object.
  • Automatic capturing: if [autoTriggerAfterLaunch] is true, a automatic capturing will be triggered after [autoTriggerDelay] seconds.
  • Keyboard trigger: press key [triggeredByKey], a capturing will be triggered. 2) If you like to trigger the screen capture in your code logic, just call static function [OVRCubemapCapture.TriggerCubemapCapture] with proper input arguments.

Fields

autoTriggerAfterLaunch : bool
Enable the automatic screenshot trigger, which will capture a cubemap after autoTriggerDelay (seconds)
Signature
bool OVRCubemapCapture.autoTriggerAfterLaunch
autoTriggerDelay : float
Signature
float OVRCubemapCapture.autoTriggerDelay
cubemapSize : int
The cube face resolution.
Signature
int OVRCubemapCapture.cubemapSize
pathName : string
The complete file path for saving the cubemap screenshot, including the filename and extension if pathName is blank, screenshots will be saved into USERPROFILE%\Documents\OVR_ScreenShot360.
Signature
string OVRCubemapCapture.pathName
triggeredByKey : KeyCode
Trigger cubemap screenshot if user pressed key triggeredByKey.
Signature
KeyCode OVRCubemapCapture.triggeredByKey

Static Methods

RenderIntoCubemap ( ownerCamera , outCubemap )
Signature
static void OVRCubemapCapture.RenderIntoCubemap(Camera ownerCamera, Cubemap outCubemap)
Parameters
ownerCamera: Camera
outCubemap: Cubemap
Returns
void
SaveCubemapCapture ( cubemap , pathName )
Save unity cubemap into NPOT 6x1 cubemap/texture atlas in the following format PX NX PY NY PZ NZ.
Supported format: PNG/JPG Default file name: using current time OVR_hh_mm_ss.png
Signature
static bool OVRCubemapCapture.SaveCubemapCapture(Cubemap cubemap, string pathName=null)
Parameters
cubemap: Cubemap
pathName: string
Returns
bool
TriggerCubemapCapture ( capturePos , cubemapSize , pathName )
Generate unity cubemap at specific location and save into JPG/PNG.
Default save folder: your app's persistentDataPath Default file name: using current time OVR_hh_mm_ss.png Note1: this will take a few seconds to finish Note2: if you only want to specify path not filename, please end [pathName] with "/"
Signature
static void OVRCubemapCapture.TriggerCubemapCapture(Vector3 capturePos, int cubemapSize=2048, string pathName=null)
Parameters
capturePos: Vector3
cubemapSize: int
pathName: string
Returns
void