VuoShader C type definition.
Definition in file VuoShader.h.
Go to the source code of this file.
Classes | |
struct | VuoSubshader |
References to shader source code and shader code uploaded to the GPU. More... | |
struct | VuoShaderUniform |
Holds values to eventually be assigned to a GL Program Object's uniforms. More... | |
union | VuoShaderUniform.value |
Typedefs | |
typedef void * | VuoShaderFile |
See VuoShaderFile. More... | |
typedef struct _VuoShader * | VuoShader |
A graphics shader program, specifying how to render a 3D object or a 2D image. More... | |
Functions | |
Creating standard shaders | |
VuoShader | VuoShader_makeDefaultShader (void) |
Returns a shared instance of the default (unlit checkerboard) shader. More... | |
VuoShader | VuoShader_makeUnlitImageShader (VuoImage image, VuoReal alpha) |
Returns a shader that renders objects with an image (ignoring lighting). More... | |
VuoShader | VuoShader_makeUnlitAlphaPassthruImageShader (VuoImage image, bool flipped) |
Returns a shader that renders objects with an image (ignoring lighting). More... | |
VuoShader | VuoShader_makeGlTextureRectangleShader (VuoImage image, VuoReal alpha) |
Returns a shader that renders objects with an image (ignoring lighting). More... | |
VuoShader | VuoShader_makeGlTextureRectangleAlphaPassthruShader (VuoImage image, bool flipped) |
Returns a shader that renders objects with an image (ignoring lighting). More... | |
VuoShader | VuoShader_makeUnlitColorShader (VuoColor color) |
Returns a shader that renders a solid color . More... | |
VuoShader | VuoShader_makeUnlitCircleShader (VuoColor color, VuoReal sharpness) |
Returns a shader that renders a solid color circle. More... | |
VuoShader | VuoShader_makeUnlitRoundedRectangleShader (VuoColor color, VuoReal sharpness, VuoReal roundness, VuoReal aspect) |
Returns a shader that renders a solid color rounded rectangle. More... | |
VuoShader | VuoShader_makeUnlitRoundedRectangleTrackShader (VuoColor background, VuoColor active, VuoReal sharpness, VuoReal roundness, VuoReal aspect, VuoBoolean isHorizontal, VuoReal value) |
Returns a shader that renders a solid color rounded rectangle with a split color based on value. More... | |
VuoShader | VuoShader_makeUnlitCheckmarkShader (VuoColor color, VuoColor outline, float thickness) |
Returns a shader that renders a solid color checkmark with outline and outline thickness. More... | |
VuoShader | VuoShader_makeLitColorShader (VuoColor diffuseColor, VuoColor highlightColor, VuoReal shininess) |
Returns a shader that renders a color with lighting. More... | |
VuoShader | VuoShader_makeLitImageShader (VuoImage image, VuoReal alpha, VuoColor highlightColor, VuoReal shininess) |
Returns a shader that renders an image with lighting. More... | |
VuoShader | VuoShader_makeLitImageDetailsShader (VuoImage image, VuoReal alpha, VuoImage specularImage, VuoImage normalImage) |
Returns a shader that renders an image with lighting and surface details. More... | |
VuoShader | VuoShader_makeLinearGradientShader (void) |
Returns a linear gradient shader. More... | |
void | VuoShader_setLinearGradientShaderValues (VuoShader shader, VuoList_VuoColor colors, VuoPoint2d start, VuoPoint2d end, VuoReal aspect, VuoReal noiseAmount) |
Sets parameters for the linear gradient shader using the provided colors and start and end coordinates. More... | |
VuoShader | VuoShader_makeRadialGradientShader (void) |
Returns a radial gradient shader. More... | |
void | VuoShader_setRadialGradientShaderValues (VuoShader shader, VuoList_VuoColor colors, VuoPoint2d center, VuoReal radius, VuoReal width, VuoReal height, VuoReal noiseAmount) |
Sets parameters for the radial gradient shader using the provided colors, center point, and radius. More... | |
VuoShader | VuoShader_makeFrostedGlassShader (void) |
Returns a frosted glass shader. More... | |
void | VuoShader_setFrostedGlassShaderValues (VuoShader shader, VuoColor color, VuoReal brightness, VuoPoint2d noisePosition, VuoReal noiseTime, VuoReal noiseAmount, VuoReal noiseScale, VuoReal chromaticAberration, VuoInteger levels, VuoReal roughness, VuoReal spacing, VuoInteger iterations, float aspectRatio) |
Sets parameters for the frosted glass shader. More... | |
Using shaders | |
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. More... | |
unsigned int | VuoShader_getExpectedOutputPrimitiveCount (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode) |
Returns the number of primitives the geometry shader is expected to produce per invocation. More... | |
bool | VuoShader_getMayChangeOutputPrimitiveCount (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode) |
Returns true if the geometry shader may not output the expected primitive count. More... | |
bool | VuoShader_upload (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, VuoGlContext glContext, void *outIssues) VuoWarnUnusedResult |
Compiles and uploads the shader, outputting any issues in a VuoShaderIssues instance. More... | |
bool | VuoShader_getAttributeLocations (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, VuoGlContext glContext, int *positionLocation, int *normalLocation, int *textureCoordinateLocation, int *colorLocation) VuoWarnUnusedResult |
Outputs the shader program's vertex attribute locations (the same values as glGetAttribLocation() ). More... | |
bool | VuoShader_activate (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, VuoGlContext glContext, VuoGlProgram *outputProgram) VuoWarnUnusedResult |
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. More... | |
void | VuoShader_deactivate (VuoShader shader, const VuoMesh_ElementAssemblyMethod inputPrimitiveMode, VuoGlContext glContext) |
Unbinds the shader's images from their texture units. More... | |
void | VuoShader_resetContext (VuoGlContext glContext) |
Disuses whatever shader (if any) is currently active on glContext . More... | |
void | VuoShader_setUniform_VuoImage (VuoShader shader, const char *uniformIdentifier, const VuoImage image) |
Sets a VuoImage input value on the specified shader . More... | |
void | VuoShader_setUniform_VuoBoolean (VuoShader shader, const char *uniformIdentifier, const VuoBoolean boolean) |
Sets a bool uniform value on the specified shader . More... | |
void | VuoShader_setUniform_VuoInteger (VuoShader shader, const char *uniformIdentifier, const VuoInteger integer) |
Sets an int uniform value on the specified shader . More... | |
void | VuoShader_setUniform_VuoReal (VuoShader shader, const char *uniformIdentifier, const VuoReal real) |
Sets a float uniform value on the specified shader . More... | |
void | VuoShader_setUniform_VuoPoint2d (VuoShader shader, const char *uniformIdentifier, const VuoPoint2d point2d) |
Sets a vec2 uniform value on the specified shader . More... | |
void | VuoShader_setUniform_VuoPoint3d (VuoShader shader, const char *uniformIdentifier, const VuoPoint3d point3d) |
Sets a vec3 uniform value on the specified shader . More... | |
void | VuoShader_setUniform_VuoPoint4d (VuoShader shader, const char *uniformIdentifier, const VuoPoint4d point4d) |
Sets a vec4 uniform value on the specified shader . More... | |
void | VuoShader_setUniform_VuoColor (VuoShader shader, const char *uniformIdentifier, const VuoColor color) |
Sets a color uniform value on the specified shader accepting a VuoColor. More... | |
void | VuoShader_setUniform_VuoList_VuoBoolean (VuoShader shader, const char *uniformIdentifier, const VuoList_VuoBoolean booleans) |
Sets a list of bool uniform values on the specified shader . More... | |
void | VuoShader_setUniform_VuoList_VuoInteger (VuoShader shader, const char *uniformIdentifier, const VuoList_VuoInteger integers) |
Sets a list of int uniform values on the specified shader . More... | |
void | VuoShader_setUniform_VuoList_VuoReal (VuoShader shader, const char *uniformIdentifier, const VuoList_VuoReal reals) |
Sets a list of float uniform values on the specified shader . More... | |
void | VuoShader_setUniform_VuoList_VuoPoint2d (VuoShader shader, const char *uniformIdentifier, const VuoList_VuoPoint2d point2ds) |
Sets a list of vec2 uniform values on the specified shader . More... | |
void | VuoShader_setUniform_VuoList_VuoPoint3d (VuoShader shader, const char *uniformIdentifier, const VuoList_VuoPoint3d point3ds) |
Sets a list of vec3 uniform values on the specified shader . More... | |
void | VuoShader_setUniform_VuoList_VuoPoint4d (VuoShader shader, const char *uniformIdentifier, const VuoList_VuoPoint4d point4ds) |
Sets a list of vec4 uniform values on the specified shader . More... | |
void | VuoShader_setUniform_VuoList_VuoColor (VuoShader shader, const char *uniformIdentifier, const VuoList_VuoColor colors) |
Sets a list of color uniform values on the specified shader 's uniform uniformIdentifier of type vec4 . More... | |
void | VuoShader_setUniform_mat2 (VuoShader shader, const char *uniformIdentifier, float *mat2) |
Sets a mat2 (column-major 2x2 matrix) uniform value on the specified shader . More... | |
void | VuoShader_setUniform_mat3 (VuoShader shader, const char *uniformIdentifier, float *mat3) |
Sets a mat3 (column-major 3x3 matrix) uniform value on the specified shader . More... | |
void | VuoShader_setUniform_mat4 (VuoShader shader, const char *uniformIdentifier, float *mat4) |
Sets a mat4 (column-major 4x4 matrix) uniform value on the specified shader . More... | |
VuoShader | VuoShader_make_VuoColor (VuoColor color) |
Creates an unlit color shader object. More... | |
VuoShader | VuoShader_make_VuoShader (VuoShader shader) |
Returns the passed shader (does not make a copy). More... | |
VuoShader | VuoShader_make_VuoImage (VuoImage image) |
Creates an unlit image shader. More... | |
VuoImage | VuoShader_getUniform_VuoImage (VuoShader shader, const char *uniformIdentifier) |
Returns the VuoImage for the specified uniformIdentifier , or NULL if none matches. More... | |
VuoImage | VuoShader_getFirstImage (VuoShader shader) |
Returns the first-added, non-NULL VuoImage uniform value, or NULL if there are no image uniforms. More... | |
VuoPoint2d | VuoShader_samplerCoordinatesFromVuoCoordinates (VuoPoint2d vuoCoordinates, VuoImage image) |
Converts the provided vuoCoordinates into GLSL Sampler Coordinates relative to the provided image . More... | |
VuoReal | VuoShader_samplerSizeFromVuoSize (VuoReal vuoSize) |
Converts an x-axis distance in Vuo Coordinates into GLSL Sampler Coordinates. More... | |
VuoPoint2d | VuoShader_samplerRectCoordinatesFromNormalizedCoordinates (VuoPoint2d normalizedCoordinates, VuoInteger imageWidth, VuoInteger imageHeight) |
Converts the provided normalizedCoordinates into GLSL sampler2DRect coordinates relative to the provided width/height. More... | |
bool | VuoShader_isOpaque (VuoShader shader) |
Returns true if the shader, as configured, will produce fully opaque output. More... | |
bool | VuoShader_isPopulated (VuoShader shader) |
Returns true if the shader is anything other than the default (blue/purple gradient checkerboard). More... | |
Creating shaders from GLSL source code | |
#define | VUOSHADER_GLSL_SOURCE(version, source) "#version " #version "\n" #source |
A macro to facilitate defining a GLSL shader in a C source file. More... | |
VuoShader | VuoShader_make (const char *name) |
Creates a shader object, which contains multiple GL Program Objects. More... | |
VuoShader | VuoShader_makeFromFile (VuoShaderFile *shaderFile) |
Creates a shader object from a VuoShaderFile. More... | |
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 . More... | |
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. More... | |
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. More... | |
void | VuoShader_setTransparent (VuoShader shader, const bool isTransparent) |
See VuoShader::isTransparent . More... | |
Summary, serialization, and reference counting | |
#define | VuoShader_REQUIRES_INTERPROCESS_JSON |
This type has a _getInterprocessJson() function. More... | |
char * | VuoShader_getSummary (const VuoShader value) |
Returns a summary of the shader: the text description provided to VuoShader_make. More... | |
VuoShader | VuoShader_makeFromJson (struct json_object *js) |
Decodes the JSON object js , expected to contain a 64-bit integer (memory address or 0), to create a new VuoShader . More... | |
struct json_object * | VuoShader_getJson (const VuoShader value) |
Encodes value as a JSON object. More... | |
struct json_object * | VuoShader_getInterprocessJson (const VuoShader value) |
Calls VuoShader_getJson(). More... | |
VuoShader | VuoShader_makeFromString (const char *str) |
Automatically generated function. More... | |
char * | VuoShader_getString (const VuoShader value) |
Automatically generated function. More... | |
void | VuoShader_retain (VuoShader value) |
Automatically generated function. More... | |
void | VuoShader_release (VuoShader value) |
Automatically generated function. More... | |
typedef void* VuoShaderFile |
See VuoShaderFile.
Definition at line 33 of file VuoShader.h.