Distortion Renderer
This module renders the eyes textures into the display.
Summary
Important: This module functions must be called from the render thread.
Functions
void
CardboardDistortionRenderer_renderEyeToDisplay
( CardboardDistortionRenderer
*renderer, uint64_t target, int x, int y, int width, int height, const CardboardEyeTextureDescription
*left_eye, const CardboardEyeTextureDescription
*right_eye)
void
CardboardDistortionRenderer_setMesh
( CardboardDistortionRenderer
*renderer, const CardboardMesh
*mesh, CardboardEye
eye)
void
CardboardOpenGlEs2DistortionRenderer_create
(const CardboardOpenGlEsDistortionRendererConfig
*config)
CardboardOpenGlEs3DistortionRenderer_create
(const CardboardOpenGlEsDistortionRendererConfig
*config)
Functions
CardboardDistortionRenderer_destroy
void CardboardDistortionRenderer_destroy( CardboardDistortionRenderer *renderer )
Destroys and releases memory used by the provided distortion renderer object.
Must be called from render thread.
renderer
Must not be null. When it is unmet, a call to this function results in a no-op.
renderer
CardboardDistortionRenderer_renderEyeToDisplay
void CardboardDistortionRenderer_renderEyeToDisplay ( CardboardDistortionRenderer * renderer , uint64_t target , int x , int y , int width , int height , const CardboardEyeTextureDescription * left_eye , const CardboardEyeTextureDescription * right_eye )
Renders eye textures to a rectangle in the display.
Must be called from render thread.
renderer
Must not be null. left_eye
Must not be null. right_eye
Must not be null. renderer.command_buffer
Must be started. When it is unmet, a call to this function results in a no-op.
- OpenGL ES 2.x or 3.x:
GLuint. - Metal:
CardboardMetalDistortionRendererTargetConfig*. - Vulkan:
CardboardVulkanDistortionRendererTarget*. Parametersxx coordinate of the rectangle's lower left corner in pixels.yy coordinate of the rectangle's lower left corner in pixels.widthSize in pixels of the rectangle's width.heightSize in pixels of the rectangle's height.left_eyeLeft eye texture description.right_eyeRight eye texture description.
renderer
|
Distortion renderer object pointer.
|
target
|
Target configuration. This parameter is some other type transformed via
reinterpret_cast
to a uint64_t
. The original type of this parameter depends on the underlying API used as follows: |
CardboardDistortionRenderer_setMesh
void CardboardDistortionRenderer_setMesh ( CardboardDistortionRenderer * renderer , const CardboardMesh * mesh , CardboardEye eye )
Sets the distortion Mesh for a particular eye.
Must be called from render thread.
renderer
Must not be null. mesh
Must not be null. When it is unmet, a call to this function results in a no-op.
renderer
|
Distortion renderer object pointer.
|
|---|---|
mesh
|
Distortion mesh.
|
eye
|
Desired eye.
|
CardboardMetalDistortionRenderer_create
CardboardDistortionRenderer * CardboardMetalDistortionRenderer_create ( const CardboardMetalDistortionRendererConfig * config )
Creates a new distortion renderer object.
It uses Metal as the rendering API. Must be called from the render thread.
config
CardboardOpenGlEs2DistortionRenderer_create
CardboardDistortionRenderer * CardboardOpenGlEs2DistortionRenderer_create ( const CardboardOpenGlEsDistortionRendererConfig * config )
Creates a new distortion renderer object.
It uses OpenGL ES 2.0 as the rendering API. Must be called from the render thread.
config
CardboardOpenGlEs3DistortionRenderer_create
CardboardDistortionRenderer * CardboardOpenGlEs3DistortionRenderer_create ( const CardboardOpenGlEsDistortionRendererConfig * config )
Creates a new distortion renderer object.
It uses OpenGL ES 3.0 as the rendering API. Must be called from the render thread.
config
CardboardVulkanDistortionRenderer_create
CardboardDistortionRenderer * CardboardVulkanDistortionRenderer_create ( const CardboardVulkanDistortionRendererConfig * config )
Creates a new distortion renderer object.
It uses Vulkan as the rendering API. Must be called from the render thread.
config

