Vuo
1.2.1
|
VuoSceneRenderer interface.
Typedefs | |
typedef void * | VuoSceneRenderer |
An object for rendering a scenegraph. | |
Functions | |
VuoSceneRenderer | VuoSceneRenderer_make (VuoGlContext glContext, float backingScaleFactor) |
Creates a reference-counted object for rendering a scenegraph. | |
void | VuoSceneRenderer_regenerateProjectionMatrix (VuoSceneRenderer sceneRenderer, unsigned int width, unsigned int height) |
Using the first camera found in the scene (or VuoSceneObject_makeDefaultCamera() if there is no camera in the scene), recalculates the projection matrix based on the specified viewport width and height . | |
void | VuoSceneRenderer_draw (VuoSceneRenderer sceneRenderer) |
Uploads the scene to the GPU (if it's changed), and renders it. | |
void | VuoSceneRenderer_renderToImage (VuoSceneRenderer sceneRenderer, VuoImage *image, VuoImageColorDepth imageColorDepth, VuoMultisample multisample, VuoImage *depthImage) |
Creates an OpenGL Framebuffer Object, and uses it to render the scene to image and depthImage . | |
void | VuoSceneRenderer_setRootSceneObject (VuoSceneRenderer sceneRenderer, VuoSceneObject rootSceneObject) |
Changes the scenegraph to be rendered. | |
VuoSceneObject | VuoSceneRenderer_getRootSceneObject (VuoSceneRenderer sceneRenderer, bool *isValid) |
Returns the scenegraph to be rendered. | |
void | VuoSceneRenderer_setCameraName (VuoSceneRenderer sceneRenderer, VuoText cameraName, VuoBoolean useLeftCamera) |
Changes the name of the camera to look for. | |
Variables | |
dispatch_semaphore_t | VuoSceneRenderer_vertexArraySemaphore |
Work around apparent GL driver bug, wherein attempting to simultaneously bind the same buffer to multiple VAOs on separate contexts causes a crash. | |
typedef void* VuoSceneRenderer |
An object for rendering a scenegraph.
void VuoSceneRenderer_draw | ( | VuoSceneRenderer | sr | ) |
Uploads the scene to the GPU (if it's changed), and renders it.
This function may be called from any thread. (However, the caller is responsible for ensuring that the GL context is not used simultaneously on multiple threads.)
VuoSceneObject VuoSceneRenderer_getRootSceneObject | ( | VuoSceneRenderer | sr, |
bool * | isValid | ||
) |
Returns the scenegraph to be rendered.
This function only returns valid data after VuoSceneRenderer_draw has been called.
This function may be called from any thread.
VuoSceneRenderer VuoSceneRenderer_make | ( | VuoGlContext | glContext, |
float | backingScaleFactor | ||
) |
Creates a reference-counted object for rendering a scenegraph.
This function may be called from any thread.
void VuoSceneRenderer_regenerateProjectionMatrix | ( | VuoSceneRenderer | sr, |
unsigned int | width, | ||
unsigned int | height | ||
) |
Using the first camera found in the scene (or VuoSceneObject_makeDefaultCamera() if there is no camera in the scene), recalculates the projection matrix based on the specified viewport width
and height
.
This function may be called from any thread.
void VuoSceneRenderer_renderToImage | ( | VuoSceneRenderer | sceneRenderer, |
VuoImage * | image, | ||
VuoImageColorDepth | imageColorDepth, | ||
VuoMultisample | multisample, | ||
VuoImage * | depthImage | ||
) |
Creates an OpenGL Framebuffer Object, and uses it to render the scene to image
and depthImage
.
void VuoSceneRenderer_setCameraName | ( | VuoSceneRenderer | sr, |
VuoText | cameraName, | ||
VuoBoolean | useLeftCamera | ||
) |
Changes the name of the camera to look for.
The first camera whose name contains cameraName
will be rendered (next time VuoSceneRenderer_draw()
is called), or, if no camera matches, VuoSceneObject_makeDefaultCamera()
will be used.
If cameraName
is stereoscopic, useLeftCamera
selects between the left and right cameras in the stereo pair.
This function may be called from any thread.
void VuoSceneRenderer_setRootSceneObject | ( | VuoSceneRenderer | sr, |
VuoSceneObject | rootSceneObject | ||
) |
Changes the scenegraph to be rendered.
This function retains the scene, but it isn't uploaded to the GPU until you call VuoSceneRenderer_draw.
This function may be called from any thread.
dispatch_semaphore_t VuoSceneRenderer_vertexArraySemaphore |
Work around apparent GL driver bug, wherein attempting to simultaneously bind the same buffer to multiple VAOs on separate contexts causes a crash.
(Try running CompareCameras.vuo without this.)
Also, using VuoSceneObjectRenderer and VuoSceneRender simultaneously seems to lead to crashes, so we also use this semaphore to serialize OpenGL Transform Feedback. https://b33p.net/kosada/node/8498