VuoShader implementation.
- Copyright
- Copyright © 2012–2017 Kosada Incorporated. This code may be modified and distributed under the terms of the MIT License. For more information, see http://vuo.org/license.
|
void | VuoShader_free (void *shader) |
| Frees the CPU memory and GPU objects associated with the shader.
|
|
VuoShader | VuoShader_make (const char *name) |
| Creates a shader object, which contains multiple GL Program Objects.
|
|
VuoShader | VuoShader_make_VuoColor (VuoColor color) |
| Creates an unlit color shader object.
|
|
VuoShader | VuoShader_make_VuoShader (VuoShader shader) |
| Returns the passed shader (does not make a copy).
|
|
VuoShader | VuoShader_make_VuoImage (VuoImage image) |
| Creates an unlit image shader.
|
|
void | VuoShader_addSource (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, const char *vertexShaderSource, const char *geometryShaderSource, const char *fragmentShaderSource) |
| Associates GLSL shader source code with the specified inputPrimitiveMode of the specified shader .
|
|
void | VuoShader_setExpectedOutputPrimitiveCount (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, const unsigned int expectedOutputPrimitiveCount) |
| Specifies the number of primitives the geometry shader is expected to produce per invocation.
|
|
void | VuoShader_setMayChangeOutputPrimitiveCount (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, const bool mayChangeOutputPrimitiveCount) |
| Specifies whether the geometry shader may dynamically choose to skip outputting some primitives or output additional primitives.
|
|
unsigned int | VuoShader_getExpectedOutputPrimitiveCount (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode) |
| Returns the number of primitives the geometry shader is expected to produce per invocation.
|
|
bool | VuoShader_getMayChangeOutputPrimitiveCount (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode) |
| Returns true if the geometry shader may not output the expected primitive count.
|
|
bool | VuoShader_isTransformFeedback (VuoShader shader) |
| Returns true if each of shader 's defined inputPrimitiveMode s has a vertex shader (and optionally a geometry shader) but lacks a fragment shader.
|
|
static bool | VuoShader_ensureUploaded (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, VuoGlContext glContext) |
| Ensures that the source code for the specified inputPrimitiveMode is compiled, linked, and uploaded.
|
|
bool | VuoShader_getAttributeLocations (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, VuoGlContext glContext, int *positionLocation, int *normalLocation, int *tangentLocation, int *bitangentLocation, int *textureCoordinateLocation) |
| Outputs the shader program's vertex attribute locations (the same values as glGetAttribLocation() ).
|
|
void | VuoShader_initPerlinTexture (CGLContextObj cgl_ctx) |
| Create and load a 2D texture for a combined index permutation and gradient lookup table.
|
|
void | VuoShader_initGradTexture (CGLContextObj cgl_ctx) |
| Create and load a 2D texture for a 4D gradient lookup table.
|
|
static void | __attribute__ ((constructor)) VuoShaderContext_init(void) |
| Initializes VuoShaderContext_semaphore.
|
|
bool | VuoShader_activate (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, VuoGlContext glContext, VuoGlProgram *outputProgram) |
| Activates the shader program (glUseProgram() ) on the specified glContext , binds the shader's images to texture units, and uploads its unforms, so that the shader is ready for use in rendering.
|
|
void | VuoShader_deactivate (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, VuoGlContext glContext) |
| Deactivates the shader program on the specified glContext , and unbinds the shader's images from their texture units.
|
|
void | VuoShader_cleanupContext (VuoGlContext glContext) |
| Returns the context's shader state to normal (and clears VuoShader's internal cache).
|
|
VuoShader | VuoShader_makeFromJson (json_object *js) |
| Decodes the JSON object js , expected to contain a 64-bit integer (memory address or 0), to create a new VuoShader .
|
|
json_object * | VuoShader_getJson (const VuoShader value) |
| Encodes value as a JSON object.
|
|
json_object * | VuoShader_getInterprocessJson (const VuoShader value) |
| Calls VuoShader_getJson().
|
|
char * | VuoShader_getSummary (const VuoShader value) |
| Returns a summary of the shader: the text description provided to VuoShader_make.
|
|
VuoPoint2d | VuoShader_samplerCoordinatesFromVuoCoordinates (VuoPoint2d vuoCoordinates, VuoImage image) |
| Converts the provided vuoCoordinates into GLSL Sampler Coordinates relative to the provided image .
|
|
VuoReal | VuoShader_samplerSizeFromVuoSize (VuoReal vuoSize) |
| Converts an x-axis distance in Vuo Coordinates into GLSL Sampler Coordinates.
|
|