Distortion Renderer
This module renders the eyes textures into the display.
Summary
Important: This module functions must be called from the render thread.
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.
Details | |||
---|---|---|---|
Parameters |
|
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*
.Parameters x
x coordinate of the rectangle's lower left corner in pixels.y
y coordinate of the rectangle's lower left corner in pixels.width
Size in pixels of the rectangle's width.height
Size in pixels of the rectangle's height.left_eye
Left eye texture description.right_eye
Right eye texture description.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
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.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Distortion renderer object pointer
|
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.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Distortion renderer object pointer
|
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.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Distortion renderer object pointer
|
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.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Distortion renderer object pointer
|