Top Description Constructors Methods
org.lwjgl.openvr

public Class VRCompositor

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Allows the application to interact with the compositor.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static boolean
nVRCompositor_GetCompositorBenchmarkResults(long pBenchmarkResults, int
should be set to sizeof(Compositor_BenchmarkResults)
nSizeOfBenchmarkResults
)

Unsafe version of: GetCompositorBenchmarkResults

public static void
nVRCompositor_GetCumulativeStats(long pStats, int nStatsSizeInBytes)

Unsafe version of: GetCumulativeStats

public static native void
nVRCompositor_GetCurrentFadeColor(boolean bBackground, long __functionAddress, long __result)

Unsafe version of: GetCurrentFadeColor

public static void
nVRCompositor_GetCurrentFadeColor(boolean bBackground, long __result)

Unsafe version of: GetCurrentFadeColor

public static boolean
nVRCompositor_GetFrameTiming(long pTiming, int unFramesAgo)

Unsafe version of: GetFrameTiming

public static int
nVRCompositor_GetFrameTimings(long pTiming, int nFrames)

Unsafe version of: GetFrameTimings

public static int
nVRCompositor_GetLastPoseForTrackedDeviceIndex(int unDeviceIndex, long pOutputPose, long pOutputGamePose)

Unsafe version of: GetLastPoseForTrackedDeviceIndex

public static int
nVRCompositor_GetLastPosePredictionIDs(long pRenderPosePredictionID, long pGamePosePredictionID)

Unsafe version of: GetLastPosePredictionIDs

public static int
nVRCompositor_GetLastPoses(long pRenderPoseArray, int unRenderPoseArrayCount, long pGamePoseArray, int unGamePoseArrayCount)

Unsafe version of: GetLastPoses

public static int
nVRCompositor_GetMirrorTextureD3D11(int eEye, long pD3D11DeviceOrResource, long ppD3D11ShaderResourceView)

Unsafe version of: GetMirrorTextureD3D11

public static int
nVRCompositor_GetMirrorTextureGL(int eEye, long pglTextureId, long pglSharedTextureHandle)

Unsafe version of: GetMirrorTextureGL

public static int
nVRCompositor_GetPosesForFrame(int unPosePredictionID, long pPoseArray, int unPoseArrayCount)

Unsafe version of: GetPosesForFrame

public static int
nVRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, long pchValue, int unBufferSize)

Unsafe version of: GetVulkanDeviceExtensionsRequired

public static int
public static int
nVRCompositor_SetSkyboxOverride(long pTextures, int unTextureCount)

Unsafe version of: SetSkyboxOverride

public static int
nVRCompositor_SetStageOverride_Async(long pchRenderModelPath, long pTransform, long pRenderSettings, int nSizeOfRenderSettings)

Unsafe version of: SetStageOverride_Async

public static int
nVRCompositor_Submit(int eEye, long pTexture, long pBounds, int nSubmitFlags)

Unsafe version of: Submit

public static int
nVRCompositor_WaitGetPoses(long pRenderPoseArray, int unRenderPoseArrayCount, long pGamePoseArray, int unGamePoseArrayCount)

Unsafe version of: WaitGetPoses

public static boolean
VRCompositor_CanRenderScene()

Returns true if the current process has the scene focus.

public static void
VRCompositor_ClearLastSubmittedFrame()

Clears the frame that was sent with the last call to Submit.

public static void
VRCompositor_ClearSkyboxOverride()

Resets compositor skybox back to defaults.

public static void
VRCompositor_ClearStageOverride()

Resets the stage to its default user specified setting.

public static void
VRCompositor_CompositorBringToFront()

Brings the compositor window to the front.

public static void
VRCompositor_CompositorDumpImages()

Writes back buffer and stereo left/right pair from the application to a 'screenshots' folder in the SteamVR runtime root.

public static void
VRCompositor_CompositorGoToBack()

Pushes the compositor window to the back.

public static void
VRCompositor_CompositorQuit()

DEPRECATED: Tells the compositor process to clean up and exit.

public static void
VRCompositor_FadeGrid(float fSeconds, boolean bFadeGridIn)

Fading the Grid in or out in fSeconds.

public static void
VRCompositor_FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, boolean bBackground)

Fades the view on the HMD to the specified color.

public static void
VRCompositor_ForceInterleavedReprojectionOn(boolean bOverride)

Override interleaved reprojection logic to force on.

public static void
VRCompositor_ForceReconnectProcess()

Force reconnecting to the compositor process.

public static boolean
VRCompositor_GetCompositorBenchmarkResults(Compositor_BenchmarkResults.Buffer pBenchmarkResults)

Returns true if pBenchmarkResults is filled it.

public static void
VRCompositor_GetCumulativeStats(CompositorCumulativeStats pStats, int
must be sizeof( Compositor_CumulativeStats )
nStatsSizeInBytes
)

Fills out stats accumulated for the last connected application.

public static void
VRCompositor_GetCumulativeStats(CompositorCumulativeStats pStats)

Fills out stats accumulated for the last connected application.

public static HmdColor
VRCompositor_GetCurrentFadeColor(boolean bBackground, HmdColor __result)

Get current fade color value.

public static float
VRCompositor_GetCurrentGridAlpha()

Get current alpha value of grid.

public static int
VRCompositor_GetCurrentSceneFocusProcess()

Returns the process ID of the process that is currently rendering the scene.

public static float
VRCompositor_GetFrameTimeRemaining()

Returns the time in seconds left in the current (as identified by FrameTiming's frameIndex) frame.

public static boolean
VRCompositor_GetFrameTiming(CompositorFrameTiming.Buffer pTiming)

Returns true if timing data is filled it.

public static int
VRCompositor_GetFrameTimings(CompositorFrameTiming.Buffer pTiming)

Interface for copying a range of timing data.

public static int

Returns:

0 when fading out from an app and the app's process Id when fading into an app
VRCompositor_GetLastFrameRenderer
()

Returns the process ID of the process that rendered the last frame (or 0 if the compositor itself rendered the frame).

public static int
VRCompositor_GetLastPoseForTrackedDeviceIndex(int unDeviceIndex, TrackedDevicePose pOutputPose, TrackedDevicePose pOutputGamePose)

Interface for accessing last set of poses returned by WaitGetPoses one at a time.

public static int
VRCompositor_GetLastPosePredictionIDs(IntBuffer pRenderPosePredictionID, IntBuffer pGamePosePredictionID)

Returns the frame id associated with the poses last returned by WaitGetPoses.

public static int
VRCompositor_GetLastPoses(TrackedDevicePose.Buffer pRenderPoseArray, TrackedDevicePose.Buffer pGamePoseArray)

Get the last set of poses returned by WaitGetPoses.

public static int
VRCompositor_GetMirrorTextureD3D11(int eEye, long pD3D11DeviceOrResource, PointerBuffer ppD3D11ShaderResourceView)

Opens a shared D3D11 texture with the undistorted composited image for each eye.

public static int
VRCompositor_GetMirrorTextureGL(int eEye, IntBuffer pglTextureId, PointerBuffer pglSharedTextureHandle)

Access to mirror textures from OpenGL.

public static int
VRCompositor_GetPosesForFrame(int unPosePredictionID, TrackedDevicePose.Buffer pPoseArray)

Get the most up-to-date predicted (or recorded - up to 100ms old) set of poses for a given frame id.

public static int
VRCompositor_GetTrackingSpace()

Gets current tracking space returned by WaitGetPoses.

public static int
VRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, ByteBuffer pchValue)

Returns 0.

public static String
VRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, int unBufferSize)

Returns 0.

public static int
public static String
public static void
VRCompositor_HideMirrorWindow()

DEPRECATED: Closes the headset view, either as a window or docked widget.

public static boolean
VRCompositor_IsCurrentSceneFocusAppLoading()

Indicates whether or not the current scene focus app is currently loading.

public static boolean
VRCompositor_IsFullscreen()

Return whether the compositor is fullscreen.

public static boolean
VRCompositor_IsMirrorWindowVisible()

DEPRECATED: Returns true if the headset view (either as a window or docked widget) is shown.

public static boolean
VRCompositor_IsMotionSmoothingEnabled()

Indicates whether or not motion smoothing is enabled by the user settings.

public static boolean
VRCompositor_IsMotionSmoothingSupported()

Indicates whether or not motion smoothing is supported by the current hardware.

public static void
VRCompositor_LockGLSharedTextureForAccess(long glSharedTextureHandle)

public static void
VRCompositor_PostPresentHandoff()

Call immediately after presenting your app's window (i.e. companion window) to unblock the compositor.

public static void
VRCompositor_ReleaseMirrorTextureD3D11(long pD3D11ShaderResourceView)

Releases a shared D3D11 texture.

public static boolean
VRCompositor_ReleaseSharedGLTexture(int glTextureId, long glSharedTextureHandle)

public static void
VRCompositor_SetExplicitTimingMode(int eTimingMode)

Vulkan/D3D12 Only

There are two purposes for SetExplicitTimingMode:

  1. To get a more accurate GPU timestamp for when the frame begins in Vulkan/D3D12 applications.
  2. (Optional) To avoid having WaitGetPoses access the Vulkan queue so that the queue can be accessed from another thread while WaitGetPoses is executing.
public static int
VRCompositor_SetSkyboxOverride(Texture.Buffer pTextures)

Override the skybox used in the compositor (e.g. for during level loads when the app can't feed scene images fast enough)

Order is Front, Back, Left, Right, Top, Bottom.

public static int
VRCompositor_SetStageOverride_Async(ByteBuffer pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings, int nSizeOfRenderSettings)

Override the stage model used in the compositor to replace the grid.

public static int
VRCompositor_SetStageOverride_Async(ByteBuffer pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings)

Override the stage model used in the compositor to replace the grid.

public static int
VRCompositor_SetStageOverride_Async(CharSequence pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings)

Override the stage model used in the compositor to replace the grid.

public static void
public static boolean
VRCompositor_ShouldAppRenderWithLowResources()

Let an app know it should be rendering with low resources.

public static void
VRCompositor_ShowMirrorWindow()

DEPRECATED: Opens the headset view (as either a window or docked widget depending on user's preferences) that displays what the user sees in the headset.

public static int

Returns:

return codes:
  • IsNotSceneApplication (make sure to call VR_Init with VRApplication_Scene)
  • DoNotHaveFocus (some other app has taken focus)
  • TextureIsOnWrongDevice (application did not use proper AdapterIndex - see IVRSystem.GetDXGIOutputInfo)
  • SharedTexturesNotSupported (application needs to call CreateDXGIFactory1 or later before creating DX device)
  • TextureUsesUnsupportedFormat (scene textures must be compatible with DXGI sharing rules - e.g. uncompressed, no mips, etc.)
  • InvalidTexture (usually means bad arguments passed in)
  • AlreadySubmitted (app has submitted two left textures or two right textures in a single frame - i.e. before calling WaitGetPoses again)
VRCompositor_Submit
(int eEye, Texture pTexture, VRTextureBounds pBounds, int nSubmitFlags)

Updated scene texture to display.

public static int

Returns:

VR#EVRCompositorError_VRCompositorError_RequestFailed if SetExplicitTimingMode is not enabled
VRCompositor_SubmitExplicitTimingData
()

Vulkan/D3D12 Only

Submit explicit timing data.

public static void
VRCompositor_SuspendRendering(boolean bSuspend)

Temporarily suspends rendering (useful for finer control over scene transitions).

public static void
VRCompositor_UnlockGLSharedTextureForAccess(long glSharedTextureHandle)

public static int
VRCompositor_WaitGetPoses(TrackedDevicePose.Buffer pRenderPoseArray, TrackedDevicePose.Buffer pGamePoseArray)

Scene applications should call this function to get poses to render with (and optionally poses predicted an additional frame out to use for gameplay).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

VRCompositorback to summary
protected VRCompositor()

Method Detail

nVRCompositor_GetCompositorBenchmarkResultsback to summary
public static boolean nVRCompositor_GetCompositorBenchmarkResults(long pBenchmarkResults, int nSizeOfBenchmarkResults)

Unsafe version of: GetCompositorBenchmarkResults

Parameters
nSizeOfBenchmarkResults:int

should be set to sizeof(Compositor_BenchmarkResults)

nVRCompositor_GetCumulativeStatsback to summary
public static void nVRCompositor_GetCumulativeStats(long pStats, int nStatsSizeInBytes)

Unsafe version of: GetCumulativeStats

nVRCompositor_GetCurrentFadeColorback to summary
public static native void nVRCompositor_GetCurrentFadeColor(boolean bBackground, long __functionAddress, long __result)

Unsafe version of: GetCurrentFadeColor

nVRCompositor_GetCurrentFadeColorback to summary
public static void nVRCompositor_GetCurrentFadeColor(boolean bBackground, long __result)

Unsafe version of: GetCurrentFadeColor

nVRCompositor_GetFrameTimingback to summary
public static boolean nVRCompositor_GetFrameTiming(long pTiming, int unFramesAgo)

Unsafe version of: GetFrameTiming

nVRCompositor_GetFrameTimingsback to summary
public static int nVRCompositor_GetFrameTimings(long pTiming, int nFrames)

Unsafe version of: GetFrameTimings

nVRCompositor_GetLastPoseForTrackedDeviceIndexback to summary
public static int nVRCompositor_GetLastPoseForTrackedDeviceIndex(int unDeviceIndex, long pOutputPose, long pOutputGamePose)

Unsafe version of: GetLastPoseForTrackedDeviceIndex

nVRCompositor_GetLastPosePredictionIDsback to summary
public static int nVRCompositor_GetLastPosePredictionIDs(long pRenderPosePredictionID, long pGamePosePredictionID)

Unsafe version of: GetLastPosePredictionIDs

nVRCompositor_GetLastPosesback to summary
public static int nVRCompositor_GetLastPoses(long pRenderPoseArray, int unRenderPoseArrayCount, long pGamePoseArray, int unGamePoseArrayCount)

Unsafe version of: GetLastPoses

nVRCompositor_GetMirrorTextureD3D11back to summary
public static int nVRCompositor_GetMirrorTextureD3D11(int eEye, long pD3D11DeviceOrResource, long ppD3D11ShaderResourceView)

Unsafe version of: GetMirrorTextureD3D11

nVRCompositor_GetMirrorTextureGLback to summary
public static int nVRCompositor_GetMirrorTextureGL(int eEye, long pglTextureId, long pglSharedTextureHandle)

Unsafe version of: GetMirrorTextureGL

nVRCompositor_GetPosesForFrameback to summary
public static int nVRCompositor_GetPosesForFrame(int unPosePredictionID, long pPoseArray, int unPoseArrayCount)

Unsafe version of: GetPosesForFrame

nVRCompositor_GetVulkanDeviceExtensionsRequiredback to summary
public static int nVRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, long pchValue, int unBufferSize)

Unsafe version of: GetVulkanDeviceExtensionsRequired

nVRCompositor_GetVulkanInstanceExtensionsRequiredback to summary
public static int nVRCompositor_GetVulkanInstanceExtensionsRequired(long pchValue, int unBufferSize)

Unsafe version of: GetVulkanInstanceExtensionsRequired

nVRCompositor_SetSkyboxOverrideback to summary
public static int nVRCompositor_SetSkyboxOverride(long pTextures, int unTextureCount)

Unsafe version of: SetSkyboxOverride

nVRCompositor_SetStageOverride_Asyncback to summary
public static int nVRCompositor_SetStageOverride_Async(long pchRenderModelPath, long pTransform, long pRenderSettings, int nSizeOfRenderSettings)

Unsafe version of: SetStageOverride_Async

nVRCompositor_Submitback to summary
public static int nVRCompositor_Submit(int eEye, long pTexture, long pBounds, int nSubmitFlags)

Unsafe version of: Submit

nVRCompositor_WaitGetPosesback to summary
public static int nVRCompositor_WaitGetPoses(long pRenderPoseArray, int unRenderPoseArrayCount, long pGamePoseArray, int unGamePoseArrayCount)

Unsafe version of: WaitGetPoses

VRCompositor_CanRenderSceneback to summary
public static boolean VRCompositor_CanRenderScene()

Returns true if the current process has the scene focus.

Annotations
@NativeType:bool
VRCompositor_ClearLastSubmittedFrameback to summary
public static void VRCompositor_ClearLastSubmittedFrame()

Clears the frame that was sent with the last call to Submit. This will cause the compositor to show the grid until Submit is called again.

VRCompositor_ClearSkyboxOverrideback to summary
public static void VRCompositor_ClearSkyboxOverride()

Resets compositor skybox back to defaults.

VRCompositor_ClearStageOverrideback to summary
public static void VRCompositor_ClearStageOverride()

Resets the stage to its default user specified setting.

VRCompositor_CompositorBringToFrontback to summary
public static void VRCompositor_CompositorBringToFront()

Brings the compositor window to the front. This is useful for covering any other window that may be on the HMD and is obscuring the compositor window.

VRCompositor_CompositorDumpImagesback to summary
public static void VRCompositor_CompositorDumpImages()

Writes back buffer and stereo left/right pair from the application to a 'screenshots' folder in the SteamVR runtime root.

VRCompositor_CompositorGoToBackback to summary
public static void VRCompositor_CompositorGoToBack()

Pushes the compositor window to the back. This is useful for allowing other applications to draw directly to the HMD.

VRCompositor_CompositorQuitback to summary
public static void VRCompositor_CompositorQuit()

DEPRECATED: Tells the compositor process to clean up and exit. You do not need to call this function at shutdown. Under normal circumstances the compositor will manage its own life cycle based on what applications are running.

VRCompositor_FadeGridback to summary
public static void VRCompositor_FadeGrid(float fSeconds, boolean bFadeGridIn)

Fading the Grid in or out in fSeconds.

VRCompositor_FadeToColorback to summary
public static void VRCompositor_FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, boolean bBackground)

Fades the view on the HMD to the specified color.

The fade will take fSeconds, and the color values are between 0.0 and 1.0. This color is faded on top of the scene based on the alpha parameter. Removing the fade color instantly would be FadeToColor( 0.0, 0.0, 0.0, 0.0, 0.0 ). Values are in un-premultiplied alpha space.

VRCompositor_ForceInterleavedReprojectionOnback to summary
public static void VRCompositor_ForceInterleavedReprojectionOn(boolean bOverride)

Override interleaved reprojection logic to force on.

VRCompositor_ForceReconnectProcessback to summary
public static void VRCompositor_ForceReconnectProcess()

Force reconnecting to the compositor process.

VRCompositor_GetCompositorBenchmarkResultsback to summary
public static boolean VRCompositor_GetCompositorBenchmarkResults(Compositor_BenchmarkResults.Buffer pBenchmarkResults)

Returns true if pBenchmarkResults is filled it. Sets pBenchmarkResults with the result of the compositor benchmark.

Annotations
@NativeType:bool
VRCompositor_GetCumulativeStatsback to summary
public static void VRCompositor_GetCumulativeStats(CompositorCumulativeStats pStats, int nStatsSizeInBytes)

Fills out stats accumulated for the last connected application.

Parameters
nStatsSizeInBytes:int

must be sizeof( Compositor_CumulativeStats )

VRCompositor_GetCumulativeStatsback to summary
public static void VRCompositor_GetCumulativeStats(CompositorCumulativeStats pStats)

Fills out stats accumulated for the last connected application.

VRCompositor_GetCurrentFadeColorback to summary
public static HmdColor VRCompositor_GetCurrentFadeColor(boolean bBackground, HmdColor __result)

Get current fade color value.

Annotations
@NativeType:HmdColor_t
VRCompositor_GetCurrentGridAlphaback to summary
public static float VRCompositor_GetCurrentGridAlpha()

Get current alpha value of grid.

VRCompositor_GetCurrentSceneFocusProcessback to summary
public static int VRCompositor_GetCurrentSceneFocusProcess()

Returns the process ID of the process that is currently rendering the scene.

Annotations
@NativeType:uint32_t
VRCompositor_GetFrameTimeRemainingback to summary
public static float VRCompositor_GetFrameTimeRemaining()

Returns the time in seconds left in the current (as identified by FrameTiming's frameIndex) frame.

Due to "running start", this value may roll over to the next frame before ever reaching 0.0.

VRCompositor_GetFrameTimingback to summary
public static boolean VRCompositor_GetFrameTiming(CompositorFrameTiming.Buffer pTiming)

Returns true if timing data is filled it. Sets oldest timing info if nFramesAgo is larger than the stored history.

Be sure to set timing.size = sizeof(Compositor_FrameTiming) on struct passed in before calling this function.

Annotations
@NativeType:bool
VRCompositor_GetFrameTimingsback to summary
public static int VRCompositor_GetFrameTimings(CompositorFrameTiming.Buffer pTiming)

Interface for copying a range of timing data. Frames are returned in ascending order (oldest to newest) with the last being the most recent frame. Only the first entry's m_nSize needs to be set, as the rest will be inferred from that. Returns total number of entries filled out.

Annotations
@NativeType:uint32_t
VRCompositor_GetLastFrameRendererback to summary
public static int VRCompositor_GetLastFrameRenderer()

Returns the process ID of the process that rendered the last frame (or 0 if the compositor itself rendered the frame).

Returns:int

0 when fading out from an app and the app's process Id when fading into an app

Annotations
@NativeType:uint32_t
VRCompositor_GetLastPoseForTrackedDeviceIndexback to summary
public static int VRCompositor_GetLastPoseForTrackedDeviceIndex(int unDeviceIndex, TrackedDevicePose pOutputPose, TrackedDevicePose pOutputGamePose)

Interface for accessing last set of poses returned by WaitGetPoses one at a time.

It is okay to pass NULL for either pose if you only want one of the values.

Returns:int

VR#EVRCompositorError_VRCompositorError_IndexOutOfRange if unDeviceIndex not less than VR#k_unMaxTrackedDeviceCount otherwise VR#EVRCompositorError_VRCompositorError_None

Annotations
@NativeType:EVRCompositorError
VRCompositor_GetLastPosePredictionIDsback to summary
public static int VRCompositor_GetLastPosePredictionIDs(IntBuffer pRenderPosePredictionID, IntBuffer pGamePosePredictionID)

Returns the frame id associated with the poses last returned by WaitGetPoses.

Deltas between IDs correspond to number of headset vsync intervals.

Annotations
@NativeType:EVRCompositorError
VRCompositor_GetLastPosesback to summary
public static int VRCompositor_GetLastPoses(TrackedDevicePose.Buffer pRenderPoseArray, TrackedDevicePose.Buffer pGamePoseArray)

Get the last set of poses returned by WaitGetPoses.

Annotations
@NativeType:EVRCompositorError
VRCompositor_GetMirrorTextureD3D11back to summary
public static int VRCompositor_GetMirrorTextureD3D11(int eEye, long pD3D11DeviceOrResource, PointerBuffer ppD3D11ShaderResourceView)

Opens a shared D3D11 texture with the undistorted composited image for each eye.

Use ReleaseMirrorTextureD3D11 when finished instead of calling Release on the resource itself.

Annotations
@NativeType:EVRCompositorError
VRCompositor_GetMirrorTextureGLback to summary
public static int VRCompositor_GetMirrorTextureGL(int eEye, IntBuffer pglTextureId, PointerBuffer pglSharedTextureHandle)

Access to mirror textures from OpenGL.

Annotations
@NativeType:EVRCompositorError
VRCompositor_GetPosesForFrameback to summary
public static int VRCompositor_GetPosesForFrame(int unPosePredictionID, TrackedDevicePose.Buffer pPoseArray)

Get the most up-to-date predicted (or recorded - up to 100ms old) set of poses for a given frame id.

Annotations
@NativeType:EVRCompositorError
VRCompositor_GetTrackingSpaceback to summary
public static int VRCompositor_GetTrackingSpace()

Gets current tracking space returned by WaitGetPoses.

Annotations
@NativeType:ETrackingUniverseOrigin
VRCompositor_GetVulkanDeviceExtensionsRequiredback to summary
public static int VRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, ByteBuffer pchValue)

Returns 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing null. The string will be a space separated list of required device extensions to enable in VkCreateDevice.

Annotations
@NativeType:uint32_t
VRCompositor_GetVulkanDeviceExtensionsRequiredback to summary
public static String VRCompositor_GetVulkanDeviceExtensionsRequired(long pPhysicalDevice, int unBufferSize)

Returns 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing null. The string will be a space separated list of required device extensions to enable in VkCreateDevice.

Annotations
@NativeType:uint32_t
VRCompositor_GetVulkanInstanceExtensionsRequiredback to summary
public static int VRCompositor_GetVulkanInstanceExtensionsRequired(ByteBuffer pchValue)

Returns 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing null. The string will be a space separated list of-required instance extensions to enable in VkCreateInstance.

Annotations
@NativeType:uint32_t
VRCompositor_GetVulkanInstanceExtensionsRequiredback to summary
public static String VRCompositor_GetVulkanInstanceExtensionsRequired(int unBufferSize)

Returns 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing null. The string will be a space separated list of-required instance extensions to enable in VkCreateInstance.

Annotations
@NativeType:uint32_t
VRCompositor_HideMirrorWindowback to summary
public static void VRCompositor_HideMirrorWindow()

DEPRECATED: Closes the headset view, either as a window or docked widget.

VRCompositor_IsCurrentSceneFocusAppLoadingback to summary
public static boolean VRCompositor_IsCurrentSceneFocusAppLoading()

Indicates whether or not the current scene focus app is currently loading.

This is inferred from its use of FadeGrid to explicitly fade to the compositor to cover up the fact that it cannot render at a sustained full framerate during this time.

Annotations
@NativeType:bool
VRCompositor_IsFullscreenback to summary
public static boolean VRCompositor_IsFullscreen()

Return whether the compositor is fullscreen.

Annotations
@NativeType:bool
VRCompositor_IsMirrorWindowVisibleback to summary
public static boolean VRCompositor_IsMirrorWindowVisible()

DEPRECATED: Returns true if the headset view (either as a window or docked widget) is shown.

Annotations
@NativeType:bool
VRCompositor_IsMotionSmoothingEnabledback to summary
public static boolean VRCompositor_IsMotionSmoothingEnabled()

Indicates whether or not motion smoothing is enabled by the user settings.

If you want to know if motion smoothing actually triggered due to a late frame, check CompositorFrameTiming m_nReprojectionFlags & VRCompositor_ReprojectionMotion instead.

Annotations
@NativeType:bool
VRCompositor_IsMotionSmoothingSupportedback to summary
public static boolean VRCompositor_IsMotionSmoothingSupported()

Indicates whether or not motion smoothing is supported by the current hardware.

Annotations
@NativeType:bool
VRCompositor_LockGLSharedTextureForAccessback to summary
public static void VRCompositor_LockGLSharedTextureForAccess(long glSharedTextureHandle)
VRCompositor_PostPresentHandoffback to summary
public static void VRCompositor_PostPresentHandoff()

Call immediately after presenting your app's window (i.e. companion window) to unblock the compositor.

This is an optional call, which only needs to be used if you can't instead call WaitGetPoses immediately after Present(). For example, if your engine's render and game loop are not on separate threads, or blocking the render thread until 3ms before the next vsync would introduce a deadlock of some sort. This function tells the compositor that you have finished all rendering after having Submitted buffers for both eyes, and it is free to start its rendering work. This should only be called from the same thread you are rendering on.

VRCompositor_ReleaseMirrorTextureD3D11back to summary
public static void VRCompositor_ReleaseMirrorTextureD3D11(long pD3D11ShaderResourceView)

Releases a shared D3D11 texture.

VRCompositor_ReleaseSharedGLTextureback to summary
public static boolean VRCompositor_ReleaseSharedGLTexture(int glTextureId, long glSharedTextureHandle)
Annotations
@NativeType:bool
VRCompositor_SetExplicitTimingModeback to summary
public static void VRCompositor_SetExplicitTimingMode(int eTimingMode)

Vulkan/D3D12 Only

There are two purposes for SetExplicitTimingMode:

  1. To get a more accurate GPU timestamp for when the frame begins in Vulkan/D3D12 applications.
  2. (Optional) To avoid having WaitGetPoses access the Vulkan queue so that the queue can be accessed from another thread while WaitGetPoses is executing.

More accurate GPU timestamp for the start of the frame is achieved by the application calling SubmitExplicitTimingData immediately before its first submission to the Vulkan/D3D12 queue. This is more accurate because normally this GPU timestamp is recorded during WaitGetPoses. In D3D11, WaitGetPoses queues a GPU timestamp write, but it does not actually get submitted to the GPU until the application flushes. By using SubmitExplicitTimingData, the timestamp is recorded at the same place for Vulkan/D3D12 as it is for D3D11, resulting in a more accurate GPU time measurement for the frame.

Avoiding WaitGetPoses accessing the Vulkan queue can be achieved using SetExplicitTimingMode as well. If this is desired, the application should set the timing mode to VR#EVRCompositorTimingMode_VRCompositorTimingMode_Explicit_ApplicationPerformsPostPresentHandoff and MUST call PostPresentHandoff itself. If these conditions are met, then WaitGetPoses is guaranteed not to access the queue. Note that PostPresentHandoff and SubmitExplicitTimingData will access the queue, so only WaitGetPoses becomes safe for accessing the queue from another thread.

VRCompositor_SetSkyboxOverrideback to summary
public static int VRCompositor_SetSkyboxOverride(Texture.Buffer pTextures)

Override the skybox used in the compositor (e.g. for during level loads when the app can't feed scene images fast enough)

Order is Front, Back, Left, Right, Top, Bottom. If only a single texture is passed, it is assumed in lat-long format. If two are passed, it is assumed a lat-long stereo pair.

Annotations
@NativeType:EVRCompositorError
VRCompositor_SetStageOverride_Asyncback to summary
public static int VRCompositor_SetStageOverride_Async(ByteBuffer pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings, int nSizeOfRenderSettings)

Override the stage model used in the compositor to replace the grid.

RenderModelPath is a full path the an OBJ file to load. This file will be loaded asynchronously from disk and uploaded to the gpu by the runtime. Once ready for rendering, the VREvent VR#EVREventType_VREvent_Compositor_StageOverrideReady will be sent. Use FadeToGrid to reveal. Call ClearStageOverride to free the associated resources when finished.

Annotations
@NativeType:EVRCompositorError
VRCompositor_SetStageOverride_Asyncback to summary
public static int VRCompositor_SetStageOverride_Async(ByteBuffer pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings)

Override the stage model used in the compositor to replace the grid.

RenderModelPath is a full path the an OBJ file to load. This file will be loaded asynchronously from disk and uploaded to the gpu by the runtime. Once ready for rendering, the VREvent VR#EVREventType_VREvent_Compositor_StageOverrideReady will be sent. Use FadeToGrid to reveal. Call ClearStageOverride to free the associated resources when finished.

Annotations
@NativeType:EVRCompositorError
VRCompositor_SetStageOverride_Asyncback to summary
public static int VRCompositor_SetStageOverride_Async(CharSequence pchRenderModelPath, HmdMatrix34 pTransform, CompositorStageRenderSettings pRenderSettings)

Override the stage model used in the compositor to replace the grid.

RenderModelPath is a full path the an OBJ file to load. This file will be loaded asynchronously from disk and uploaded to the gpu by the runtime. Once ready for rendering, the VREvent VR#EVREventType_VREvent_Compositor_StageOverrideReady will be sent. Use FadeToGrid to reveal. Call ClearStageOverride to free the associated resources when finished.

Annotations
@NativeType:EVRCompositorError
VRCompositor_SetTrackingSpaceback to summary
public static void VRCompositor_SetTrackingSpace(int eOrigin)

Sets tracking space returned by WaitGetPoses.

Parameters
eOrigin:int

one of:

VR#ETrackingUniverseOrigin_TrackingUniverseSeated
VR#ETrackingUniverseOrigin_TrackingUniverseStanding
VR#ETrackingUniverseOrigin_TrackingUniverseRawAndUncalibrated
VRCompositor_ShouldAppRenderWithLowResourcesback to summary
public static boolean VRCompositor_ShouldAppRenderWithLowResources()

Let an app know it should be rendering with low resources.

Annotations
@NativeType:bool
VRCompositor_ShowMirrorWindowback to summary
public static void VRCompositor_ShowMirrorWindow()

DEPRECATED: Opens the headset view (as either a window or docked widget depending on user's preferences) that displays what the user sees in the headset.

VRCompositor_Submitback to summary
public static int VRCompositor_Submit(int eEye, Texture pTexture, VRTextureBounds pBounds, int nSubmitFlags)

Updated scene texture to display.

If pBounds is NULL the entire texture will be used. If called from an OpenGL app, consider adding a glFlush after submitting both frames to signal the driver to start processing, otherwise it may wait until the command buffer fills up, causing the app to miss frames.

OpenGL dirty state: glBindTexture

Parameters
eEye:int

one of:

VR#EVREye_Eye_LeftVR#EVREye_Eye_Right
nSubmitFlags:int

one of:

VR#EVRSubmitFlags_Submit_DefaultVR#EVRSubmitFlags_Submit_LensDistortionAlreadyApplied
VR#EVRSubmitFlags_Submit_GlRenderBufferVR#EVRSubmitFlags_Submit_Reserved
VR#EVRSubmitFlags_Submit_TextureWithDepthVR#EVRSubmitFlags_Submit_FrameDiscontinuty
VR#EVRSubmitFlags_Submit_VulkanTextureWithArrayDataVR#EVRSubmitFlags_Submit_GlArrayTexture
VR#EVRSubmitFlags_Submit_Reserved2VR#EVRSubmitFlags_Submit_Reserved3
Returns:int

return codes:

  • IsNotSceneApplication (make sure to call VR_Init with VRApplication_Scene)
  • DoNotHaveFocus (some other app has taken focus)
  • TextureIsOnWrongDevice (application did not use proper AdapterIndex - see IVRSystem.GetDXGIOutputInfo)
  • SharedTexturesNotSupported (application needs to call CreateDXGIFactory1 or later before creating DX device)
  • TextureUsesUnsupportedFormat (scene textures must be compatible with DXGI sharing rules - e.g. uncompressed, no mips, etc.)
  • InvalidTexture (usually means bad arguments passed in)
  • AlreadySubmitted (app has submitted two left textures or two right textures in a single frame - i.e. before calling WaitGetPoses again)
Annotations
@NativeType:EVRCompositorError
VRCompositor_SubmitExplicitTimingDataback to summary
public static int VRCompositor_SubmitExplicitTimingData()

Vulkan/D3D12 Only

Submit explicit timing data. When SetExplicitTimingMode is true, this must be called immediately before the application's first vkQueueSubmit (Vulkan) or ID3D12CommandQueue::ExecuteCommandLists (D3D12) of each frame. This function will insert a GPU timestamp write just before the application starts its rendering. This function will perform a vkQueueSubmit on Vulkan so must not be done simultaneously with VkQueue operations on another thread.

Returns:int

VR#EVRCompositorError_VRCompositorError_RequestFailed if SetExplicitTimingMode is not enabled

Annotations
@NativeType:EVRCompositorError
VRCompositor_SuspendRenderingback to summary
public static void VRCompositor_SuspendRendering(boolean bSuspend)

Temporarily suspends rendering (useful for finer control over scene transitions).

VRCompositor_UnlockGLSharedTextureForAccessback to summary
public static void VRCompositor_UnlockGLSharedTextureForAccess(long glSharedTextureHandle)
VRCompositor_WaitGetPosesback to summary
public static int VRCompositor_WaitGetPoses(TrackedDevicePose.Buffer pRenderPoseArray, TrackedDevicePose.Buffer pGamePoseArray)

Scene applications should call this function to get poses to render with (and optionally poses predicted an additional frame out to use for gameplay). This function will block until "running start" milliseconds before the start of the frame, and should be called at the last moment before needing to start rendering.

Annotations
@NativeType:EVRCompositorError