Inventor/oivShaderState.h File Reference

This file contains fonction to acces built-in GLSL uniforms. More...

Go to the source code of this file.

Defines

#define OIV_PROJECTION_TYPE_ORTHO   0
#define OIV_PROJECTION_TYPE_PERSPECTIVE   1
#define OIV_LIGHT_TYPE_NONE   0
#define OIV_LIGHT_TYPE_POINT   1
#define OIV_LIGHT_TYPE_SPOT   2
#define OIV_LIGHT_TYPE_DIRECTIONAL   3

Functions

int OivMaxLights ()
int OivMaxClipPlanes ()
int OivMaxTextureCoordinates ()
int OivMaxTextureUnits ()
mat4 OivModelMatrix ()
mat4 OivModelMatrixInverse ()
mat4 OivViewMatrix ()
mat4 OivViewMatrixInverse ()
mat4 OivModelViewMatrix ()
mat4 OivModelViewMatrixInverse ()
mat3 OivNormalMatrix ()
mat4 OivProjectionMatrix ()
mat4 OivProjectionMatrixInverse ()
mat4 OivModelViewProjectionMatrix ()
mat4 OivTextureMatrix (int unit)
vec2 OivViewportSize ()
vec2 OivViewVolumeSize ()
int OivViewProjectionType ()
bool OivHasLighting ()
bool OivHasTwoSidedLighting ()
bool OivHasPerPixelLighting ()
bool OivHasColorMaterial ()
vec4 OivGlobalAmbient ()
bool OivLightSourceEnabled (int id)
int OivLightSourceType (int id)
vec4 OivLightSourcePosition (int id)
vec3 OivLightSourceSpotDirection (int id)
float OivLightSourceSpotExponent (int id)
float OivLightSourceSpotCutoff (int id)
float OivLightSourceSpotCosCutoff (int id)
vec4 OivLightSourceAmbient (int id)
vec4 OivLightSourceDiffuse (int id)
vec4 OivLightSourceSpecular (int id)
float OivLightSourceConstantAttenuation (int id)
float OivLightSourceLinearAttenuation (int id)
float OivLightSourceQuadraticAttenuation (int id)
int OivMaxLightId ()
vec4 OivFrontMaterialAmbient ()
vec4 OivFrontMaterialDiffuse ()
vec4 OivFrontMaterialSpecular ()
vec4 OivFrontMaterialEmissive ()
float OivFrontMaterialShininess ()
vec4 OivBackMaterialAmbient ()
vec4 OivBackMaterialDiffuse ()
vec4 OivBackMaterialSpecular ()
vec4 OivBackMaterialEmissive ()
float OivBackMaterialShininess ()
vec4 OivFrontSceneColor ()
vec4 OivFrontLightProductAmbient (int id)
vec4 OivFrontLightProductDiffuse (int id)
vec4 OivFrontLightProductSpecular (int id)
vec4 OivBackLightProductAmbient (int id)
vec4 OivBackLightProductDiffuse (int id)
vec4 OivBackLightProductSpecular (int id)
bool OivClipPlaneEnabled (int id)
vec4 OivClipPlane (int id)
vec4 OivFogColor ()
float OivFogDensity ()
float OivFogStart ()
float OivFogEnd ()
float OivFogScale ()
int OivFogType ()
vec4 OivObjectPlaneS (int i)
vec4 OivObjectPlaneT (int i)
vec4 OivObjectPlaneR (int i)
vec4 OivObjectPlaneQ (int i)

Detailed Description

This file contains fonction to acces built-in GLSL uniforms.

Definition in file oivShaderState.h.


Define Documentation

#define OIV_LIGHT_TYPE_DIRECTIONAL   3
#define OIV_LIGHT_TYPE_NONE   0
#define OIV_LIGHT_TYPE_POINT   1
#define OIV_LIGHT_TYPE_SPOT   2
#define OIV_PROJECTION_TYPE_ORTHO   0
#define OIV_PROJECTION_TYPE_PERSPECTIVE   1

Function Documentation

vec4 OivBackLightProductAmbient ( int  id  ) 

Get product of ambient component between back material and id'th light.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
product of ambient component between back material and id'th light.

Note that this parameter is relevant only if two side lighting is enabled (i.e. OivHasTwoSidedLighting() returns true).

vec4 OivBackLightProductDiffuse ( int  id  ) 

Get product of diffuse component between back material and id'th light.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
product of diffuse component between back material and id'th light.

Note that this parameter is relevant only if two side lighting is enabled (i.e. OivHasTwoSidedLighting() returns true).

vec4 OivBackLightProductSpecular ( int  id  ) 

Get product of specular component between back material and id'th light.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
product of specular component between back material and id'th light.

Note that this parameter is relevant only if two side lighting is enabled (i.e. OivHasTwoSidedLighting() returns true).

vec4 OivBackMaterialAmbient (  ) 

Get back material ambient color.

Returns:
ambient color for back material.

Note that this parameter is relevant only if two side lighting is enabled (i.e. OivHasTwoSidedLighting() returns true).

vec4 OivBackMaterialDiffuse (  ) 

Get back material diffuse color.

Returns:
diffuse color for back material.

Note that this parameter is relevant only if two side lighting is enabled (i.e. OivHasTwoSidedLighting() returns true).

vec4 OivBackMaterialEmissive (  ) 

Get back material emissive color.

Returns:
emissive color for back material.

Note that this parameter is relevant only if two side lighting is enabled (i.e. OivHasTwoSidedLighting() returns true).

float OivBackMaterialShininess (  ) 

Get back material shininess value.

Returns:
shininess value for back material.

Note that this parameter is relevant only if two side lighting is enabled (i.e. OivHasTwoSidedLighting() returns true).

vec4 OivBackMaterialSpecular (  ) 

Get back material specular color.

Returns:
specular color for back material.

Note that this parameter is relevant only if two side lighting is enabled (i.e. OivHasTwoSidedLighting() returns true).

vec4 OivClipPlane ( int  id  ) 

Get the clip plane coordinates.

Parameters:
id specifies which clip plane id to ask, must be between 0 and OivMaxClipPlanes()-1.
Returns:
the clip plane .
bool OivClipPlaneEnabled ( int  id  ) 

Ask if clip plane is enabled.

Parameters:
id specifies which clip plane id to ask, must be between 0 and OivMaxClipPlanes()-1.
Returns:
true if clip plane with a given id is enabled, false otherwise.
vec4 OivFogColor (  ) 

Get the fog color.

Returns:
fog color.
float OivFogDensity (  ) 

Get fog density used in exponential fog equations.

Returns:
fog density.
float OivFogEnd (  ) 

Get the far distance used in the linear fog equation.

Returns:
fog end.
float OivFogScale (  ) 

Get the fog scale derived from start and end parameters : 1.0 / (end - start).

Returns:
fog scale.
float OivFogStart (  ) 

Get the near distance used in the linear fog equation.

Returns:
fog start.
int OivFogType (  ) 

Get the fog type.

Returns:
fog type (FOG_TYPE_NONE, FOG_TYPE_EXP, FOG_TYPE_EXP2 or FOG_TYPE_LINEAR).
vec4 OivFrontLightProductAmbient ( int  id  ) 

Get product of ambient component between back material and id'th light.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
product of ambient component between back material and id'th light.
vec4 OivFrontLightProductDiffuse ( int  id  ) 

Get product of diffuse component between back material and id'th light.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
product of diffuse component between back material and id'th light.
vec4 OivFrontLightProductSpecular ( int  id  ) 

Get product of specular component between back material and id'th light.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
product of specular component between back material and id'th light.
vec4 OivFrontMaterialAmbient (  ) 

Get front material ambient color.

Returns:
ambient color for front material.
vec4 OivFrontMaterialDiffuse (  ) 

Get front material diffuse color.

Returns:
diffuse color for front material.
vec4 OivFrontMaterialEmissive (  ) 

Get front material emissive color.

Returns:
emissive color for front material.
float OivFrontMaterialShininess (  ) 

Get front material shininess value.

Returns:
shininess value for front material.
vec4 OivFrontMaterialSpecular (  ) 

Get front material specular color.

Returns:
specular color for front material.
vec4 OivFrontSceneColor (  ) 

Get sum of emissive component of front material and product between front material ambient and global ambient value.

Returns:
sum of emissive component of front material and product between front material ambient and global ambient value.
vec4 OivGlobalAmbient (  ) 

Gets the global ambient color value.

Returns:
The global ambient color value
bool OivHasColorMaterial (  ) 

Ask if color material is enabled.

Returns:
true if color material is active, false otherwise
bool OivHasLighting (  ) 

Ask if lighting is enabled.

Returns:
true if lighting is enabled, false otherwise.
bool OivHasPerPixelLighting (  ) 

Ask if per-pixel lighting is enabled.

Returns:
true if per-pixel lighting is enabled, false otherwise
bool OivHasTwoSidedLighting (  ) 

Ask if two-sided lighting is enabled.

Returns:
true if two-sided lighting is enabled, false otherwise
vec4 OivLightSourceAmbient ( int  id  ) 

Get the light ambient color.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light ambient color for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

float OivLightSourceConstantAttenuation ( int  id  ) 

Get the light constant attenuation value.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light constant attenuation value for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

vec4 OivLightSourceDiffuse ( int  id  ) 

Get the light diffuse color.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light diffuse color for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

bool OivLightSourceEnabled ( int  id  ) 

Ask if the light is enabled.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
true if light with a given id is enabled, false otherwise.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

float OivLightSourceLinearAttenuation ( int  id  ) 

Get the light linear attenuation value.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light linear attenuation value for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

vec4 OivLightSourcePosition ( int  id  ) 

Get the light position.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light position for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

float OivLightSourceQuadraticAttenuation ( int  id  ) 

Get the light quadratic attenuation value.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light quadratic attenuation value for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

vec4 OivLightSourceSpecular ( int  id  ) 

Get the light specular color.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light specular color for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

float OivLightSourceSpotCosCutoff ( int  id  ) 

Get the light spot cutoff cosine.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light spot cutoff cosine for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

float OivLightSourceSpotCutoff ( int  id  ) 

Get the light spot cutoff.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light spot cutoff for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

vec3 OivLightSourceSpotDirection ( int  id  ) 

Get the light spot direction.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light spot direction for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

float OivLightSourceSpotExponent ( int  id  ) 

Get the light spot exponent.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the light spot exponent for a given light id.

Note that this parameter is relevant only if lighting is enabled (i.e. OivHasLighting() returns true).

int OivLightSourceType ( int  id  ) 

Get the type of the light.

Parameters:
id specifies which light id to ask, must be between 0 and OivMaxLights()-1.
Returns:
the type of the light (OIV_LIGHT_TYPE_NONE, OIV_LIGHT_TYPE_POINT, OIV_LIGHT_TYPE_SPOT or OIV_LIGHT_TYPE_DIRECTIONAL).
int OivMaxClipPlanes (  ) 

Get the maximum number of clipping planes sets by Open Inventor.

int OivMaxLightId (  ) 
int OivMaxLights (  ) 

Get the maximum number of lights sets by Open Inventor.

int OivMaxTextureCoordinates (  ) 

Get the maximum number of texture coordinates sets by Open Inventor.

int OivMaxTextureUnits (  ) 

Get the maximum number of texture units sets by Open Inventor.

mat4 OivModelMatrix (  ) 

Get transformation of the model (M).

Returns:
the model matrix.
mat4 OivModelMatrixInverse (  ) 

Get inverse transformation of the model (M^{-1}).

Returns:
the inverse of the model matrix.
mat4 OivModelViewMatrix (  ) 

Get the combination of model and view transformations (MV), i.e., MV = V * M.

Returns:
the model-view matrix.
mat4 OivModelViewMatrixInverse (  ) 

Get the inverse of the model-view matrix,.

Returns:
the inverse of the model-view matrix.
mat4 OivModelViewProjectionMatrix (  ) 

Get the combination of projection and model-view matrices (MVP), i.e., MVP = P * V * M.

Returns:
the model-view-projection matrix
mat3 OivNormalMatrix (  ) 

Get the normal matrix (N), i.e., N = tr(MV^{-1}).

Returns:
the normal matrix.
vec4 OivObjectPlaneQ ( int  i  ) 

Get the user-defined planes for texture coordinate generation.

Returns:
user-defined plane
vec4 OivObjectPlaneR ( int  i  ) 

Get the user-defined planes for texture coordinate generation.

Returns:
user-defined plane
vec4 OivObjectPlaneS ( int  i  ) 

Get the user-defined planes for texture coordinate generation.

Returns:
user-defined plane
vec4 OivObjectPlaneT ( int  i  ) 

Get the user-defined planes for texture coordinate generation.

Returns:
user-defined plane
mat4 OivProjectionMatrix (  ) 

Get the projection matrix (P).

Returns:
the projection matrix.
mat4 OivProjectionMatrixInverse (  ) 

Get the inverse of the projection matrix (P^{-1}).

Returns:
the inverse projection matrix.
mat4 OivTextureMatrix ( int  unit  ) 

Get texture matrices.

Parameters:
unit specifies which texture unit between 0 and OivMaxTextureUnit()-1.
Returns:
the texture matrix for a given unit.
mat4 OivViewMatrix (  ) 

Get transformation of the view (V).

Returns:
the view matrix.
mat4 OivViewMatrixInverse (  ) 

Get inverse transformation of the view (V^{-1}).

Returns:
the inverse of the view matrix.
vec2 OivViewportSize (  ) 

Get the size of the viewport.

Returns:
width and height of the viewport packed in vec2.
int OivViewProjectionType (  ) 

Get the projection type of the camera (OIV_PROJECTION_TYPE_ORTHO or OIV_PROJECTION_TYPE_PERSPECTIVE).

vec2 OivViewVolumeSize (  ) 

Get the near/far view volume of the camera.


Open Inventor Toolkit reference manual, generated on 8 May 2022
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/