Vuo  2.0.0
Classes | Macros | Functions
VuoSceneObjectRenderer.cc File Reference

Description

VuoSceneObjectRenderer implementation.

Definition in file VuoSceneObjectRenderer.cc.

Go to the source code of this file.

Classes

struct  VuoSceneObjectRenderer_Attributes
 OpenGL attribute locations. More...
 
struct  VuoSceneObjectRendererInternal
 Internal state data for a VuoSceneObjectRenderer instance. More...
 

Macros

#define ELEM(i)   (submesh.elementCount ? submesh.elements[i] : i)
 Returns the vertex index to use. More...
 
#define glGenVertexArrays   glGenVertexArraysAPPLE
 Stub. More...
 
#define glBindVertexArray   glBindVertexArrayAPPLE
 Stub. More...
 
#define glDeleteVertexArrays   glDeleteVertexArraysAPPLE
 Stub. More...
 

Functions

void VuoSceneObjectRenderer_destroy (VuoSceneObjectRenderer sor)
 Destroys and deallocates the image renderer. More...
 
VuoSceneObjectRenderer VuoSceneObjectRenderer_make (VuoShader shader)
 Creates a reference-counted object for applying a shader to a VuoSceneObject. More...
 
static void VuoSceneObjectRenderer_drawSingle (CGLContextObj cgl_ctx, struct VuoSceneObjectRendererInternal *sceneObjectRenderer, VuoSceneObject *sceneObject, float modelviewMatrix[16])
 Helper for VuoSceneObjectRenderer_draw. More...
 
static void VuoSceneObjectRenderer_copyElement (VuoSubmesh submesh, int start, VuoPoint4d *source, int count, VuoPoint4d *destination)
 Helper for VuoSceneObjectRenderer_drawSingleOnCPU. More...
 
static void VuoSceneObjectRenderer_drawSingleOnCPU (VuoSceneObject *sceneObject, float modelviewMatrix[16], VuoSceneObjectRenderer_CPUGeometryOperator cpuGeometryOperator)
 Helper for VuoSceneObjectRenderer_draw. More...
 
VuoSceneObjectRenderer_CPUGeometryOperator VuoSceneObjectRenderer_makeDeformer (VuoSceneObjectRenderer_Deformer deform)
 Converts VuoSceneObjectRenderer_Deformer into VuoSceneObjectRenderer_CPUGeometryOperator, to make it easier to implemnet common 3D mesh filters. More...
 
bool VuoSceneObjectRenderer_usingGPU (void)
 Returns true if this library will be using the GPU for transform feedback. More...
 
VuoSceneObject VuoSceneObjectRenderer_draw (VuoSceneObjectRenderer sor, VuoSceneObject sceneObject, VuoSceneObjectRenderer_CPUGeometryOperator cpuGeometryOperator)
 Produces a new VuoSceneObject by rendering sceneObject using either: More...
 

Class Documentation

◆ VuoSceneObjectRenderer_Attributes

struct VuoSceneObjectRenderer_Attributes
Class Members
GLint bitangent
unsigned int expectedOutputPrimitiveCount
bool mayChangeOutputPrimitiveCount
GLint normal
GLint position
GLint tangent
GLint textureCoordinate

◆ VuoSceneObjectRendererInternal

struct VuoSceneObjectRendererInternal
Class Members
VuoSceneObjectRenderer_Attributes lineAttributes
VuoSceneObjectRenderer_Attributes pointAttributes
GLuint query
VuoShader shader
GLuint shamFramebuffer
GLuint shamTexture
VuoSceneObjectRenderer_Attributes triangleAttributes
GLuint vertexArray

Macro Definition Documentation

◆ ELEM

#define ELEM (   i)    (submesh.elementCount ? submesh.elements[i] : i)

Returns the vertex index to use.

Definition at line 379 of file VuoSceneObjectRenderer.cc.

◆ glBindVertexArray

#define glBindVertexArray   glBindVertexArrayAPPLE

Stub.

Definition at line 17 of file VuoSceneObjectRenderer.cc.

◆ glDeleteVertexArrays

#define glDeleteVertexArrays   glDeleteVertexArraysAPPLE

Stub.

Definition at line 18 of file VuoSceneObjectRenderer.cc.

◆ glGenVertexArrays

#define glGenVertexArrays   glGenVertexArraysAPPLE

Stub.

Definition at line 16 of file VuoSceneObjectRenderer.cc.

Function Documentation

◆ VuoSceneObjectRenderer_copyElement()

static void VuoSceneObjectRenderer_copyElement ( VuoSubmesh  submesh,
int  start,
VuoPoint4d *  source,
int  count,
VuoPoint4d *  destination 
)
inlinestatic

Helper for VuoSceneObjectRenderer_drawSingleOnCPU.

Definition at line 384 of file VuoSceneObjectRenderer.cc.

◆ VuoSceneObjectRenderer_destroy()

void VuoSceneObjectRenderer_destroy ( VuoSceneObjectRenderer  sor)

Destroys and deallocates the image renderer.

This function may be called from any thread.

Definition at line 730 of file VuoSceneObjectRenderer.cc.

◆ VuoSceneObjectRenderer_draw()

VuoSceneObject VuoSceneObjectRenderer_draw ( VuoSceneObjectRenderer  sor,
VuoSceneObject  sceneObject,
VuoSceneObjectRenderer_CPUGeometryOperator  cpuGeometryOperator 
)

Produces a new VuoSceneObject by rendering sceneObject using either:

  • shader's GLSL vertex shader (if the current GPU adequately supports transform feedback)
  • or cpuGeometryOperator (if the current GPU has trouble with transform feedback)

VuoSubmeshes are left unchanged if they have an elementAssemblyMethod that differs from the shader's inputElementType.

cpuGeometryOperator's parameters serve as both input and output. It may decrease (down to 0) or increase (up to VuoSceneObjectRenderer_maxOutputVertices) the number of vertices it outputs.

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.) (Additionally, the caller is responsible for ensuring that the same VuoSceneObjectRenderer is not used simultaneously on multiple threads.)

Changed in Vuo 2.0.0:
Added cpuGeometryOperator argument.

Definition at line 681 of file VuoSceneObjectRenderer.cc.

◆ VuoSceneObjectRenderer_drawSingle()

static void VuoSceneObjectRenderer_drawSingle ( CGLContextObj  cgl_ctx,
struct VuoSceneObjectRendererInternal sceneObjectRenderer,
VuoSceneObject sceneObject,
float  modelviewMatrix[16] 
)
static

Helper for VuoSceneObjectRenderer_draw.

Applies a shader to a single sceneObject's VuoMesh (ignoring its childObjects).

Definition at line 137 of file VuoSceneObjectRenderer.cc.

◆ VuoSceneObjectRenderer_drawSingleOnCPU()

static void VuoSceneObjectRenderer_drawSingleOnCPU ( VuoSceneObject sceneObject,
float  modelviewMatrix[16],
VuoSceneObjectRenderer_CPUGeometryOperator  cpuGeometryOperator 
)
static

Helper for VuoSceneObjectRenderer_draw.

Applies cpuGeometryOperator to a single sceneObject's VuoMesh (ignoring its childObjects).

Definition at line 467 of file VuoSceneObjectRenderer.cc.

◆ VuoSceneObjectRenderer_make()

VuoSceneObjectRenderer VuoSceneObjectRenderer_make ( VuoShader  shader)

Creates a reference-counted object for applying a shader to a VuoSceneObject.

This function may be called from any thread.

Definition at line 80 of file VuoSceneObjectRenderer.cc.

◆ VuoSceneObjectRenderer_makeDeformer()

VuoSceneObjectRenderer_CPUGeometryOperator VuoSceneObjectRenderer_makeDeformer ( VuoSceneObjectRenderer_Deformer  deform)

Converts VuoSceneObjectRenderer_Deformer into VuoSceneObjectRenderer_CPUGeometryOperator, to make it easier to implemnet common 3D mesh filters.

The caller is responsible for calling Block_release on the returned block.

Changed in Vuo 2.0.0:
New.

Definition at line 570 of file VuoSceneObjectRenderer.cc.

◆ VuoSceneObjectRenderer_usingGPU()

bool VuoSceneObjectRenderer_usingGPU ( void  )

Returns true if this library will be using the GPU for transform feedback.

Changed in Vuo 2.0.0:
New.

Definition at line 630 of file VuoSceneObjectRenderer.cc.