Vuo  2.3.2
Macros | Typedefs | Functions
VuoSceneObjectRenderer.h File Reference

Description

VuoSceneObjectRenderer interface.

Definition in file VuoSceneObjectRenderer.h.

Go to the source code of this file.

Macros

#define VuoSceneObjectRenderer_maxOutputVertices   9
 The maximum number of vertices a VuoSceneObjectRenderer_CPUGeometryOperator function can output. More...
 

Typedefs

typedef void * VuoSceneObjectRenderer
 Context data for applying a shader to a VuoSceneObject. More...
 
typedef void(^ VuoSceneObjectRenderer_CPUGeometryOperator) (float *modelMatrix, float *modelMatrixInverse, int *vertexCount, float *positions, float *normals, float *textureCoordinates, float *colors)
 A function that modifies a primitive (triangle, line, or point). More...
 
typedef VuoPoint3d(^ VuoSceneObjectRenderer_Deformer) (VuoPoint3d position, VuoPoint3d normal, VuoPoint2d textureCoordinate)
 A function that changes the position of a single vertex. More...
 

Functions

VuoSceneObjectRenderer VuoSceneObjectRenderer_make (VuoShader shader)
 Creates a reference-counted object for applying a shader to a VuoSceneObject. More...
 
VuoSceneObjectRenderer_CPUGeometryOperator VuoSceneObjectRenderer_makeDeformer (VuoSceneObjectRenderer_Deformer deformer)
 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 sceneObjectRenderer, VuoSceneObject object, VuoSceneObjectRenderer_CPUGeometryOperator cpuGeometryOperator)
 Produces a new VuoSceneObject by rendering sceneObject using either: More...
 

Macro Definition Documentation

◆ VuoSceneObjectRenderer_maxOutputVertices

#define VuoSceneObjectRenderer_maxOutputVertices   9

The maximum number of vertices a VuoSceneObjectRenderer_CPUGeometryOperator function can output.

Just large enough to support vuo.scene.spike.

Changed in Vuo 2.0.0:
New.

Definition at line 32 of file VuoSceneObjectRenderer.h.

Typedef Documentation

◆ VuoSceneObjectRenderer

typedef void* VuoSceneObjectRenderer

Context data for applying a shader to a VuoSceneObject.

Definition at line 21 of file VuoSceneObjectRenderer.h.

◆ VuoSceneObjectRenderer_CPUGeometryOperator

typedef void(^ VuoSceneObjectRenderer_CPUGeometryOperator) (float *modelMatrix, float *modelMatrixInverse, int *vertexCount, float *positions, float *normals, float *textureCoordinates, float *colors)

A function that modifies a primitive (triangle, line, or point).

Roughly equivalent to an OpenGL Vertex Shader + Geometry Shader.

All 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.

Changed in Vuo 2.0.0:
New.

Definition at line 43 of file VuoSceneObjectRenderer.h.

◆ VuoSceneObjectRenderer_Deformer

typedef VuoPoint3d(^ VuoSceneObjectRenderer_Deformer) (VuoPoint3d position, VuoPoint3d normal, VuoPoint2d textureCoordinate)

A function that changes the position of a single vertex.

(A simplified version of VuoSceneObjectRenderer_CPUGeometryOperator.)

Changed in Vuo 2.0.0:
New.

Definition at line 57 of file VuoSceneObjectRenderer.h.

Function Documentation

◆ 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 740 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 79 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 550 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 689 of file VuoSceneObjectRenderer.cc.