Helper script for capture cubemap and save it into PNG or JPG file More...

Inheritance diagram for OVRCubemapCapture:

Static Public Member Functions

static void TriggerCubemapCapture (Vector3 capturePos, int cubemapSize=2048, string pathName=null)
 Generate unity cubemap at specific location and save into JPG/PNG More...
 
static void RenderIntoCubemap (Camera ownerCamera, Cubemap outCubemap)
 
static bool SaveCubemapCapture (Cubemap cubemap, string pathName=null)
 Save unity cubemap into NPOT 6x1 cubemap/texture atlas in the following format PX NX PY NY PZ NZ More...
 

Public Attributes

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

Detailed Description

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 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.

Member Function Documentation

◆ RenderIntoCubemap()

static void OVRCubemapCapture.RenderIntoCubemap ( Camera  ownerCamera,
Cubemap  outCubemap 
)
static

◆ SaveCubemapCapture()

static bool OVRCubemapCapture.SaveCubemapCapture ( Cubemap  cubemap,
string  pathName = null 
)
static

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

◆ TriggerCubemapCapture()

static void OVRCubemapCapture.TriggerCubemapCapture ( Vector3  capturePos,
int  cubemapSize = 2048,
string  pathName = null 
)
static

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 "/"

Member Data Documentation

◆ autoTriggerAfterLaunch

bool OVRCubemapCapture.autoTriggerAfterLaunch = true

Enable the automatic screenshot trigger, which will capture a cubemap after autoTriggerDelay (seconds)

◆ autoTriggerDelay

float OVRCubemapCapture.autoTriggerDelay = 1.0f

◆ cubemapSize

int OVRCubemapCapture.cubemapSize = 2048

The cube face resolution

◆ pathName

string OVRCubemapCapture.pathName

The complete file path for saving the cubemap screenshot, including the filename and extension if pathName is blank, screenshots will be saved into USERPROFILE%

◆ triggeredByKey

KeyCode OVRCubemapCapture.triggeredByKey = KeyCode.F8

Trigger cubemap screenshot if user pressed key triggeredByKey


The documentation for this class was generated from the following file: