X__SHADERtag Struct Reference
[Renderer]


Detailed Description

Structure used to provide plugins with access to Renderer's internal variables and functions.

This structure is used to define a large set of Renderer's internal variables and functions that might be useful to a plugin shaderr. The pointers in this structure are pointers to functions in the Renderer that can be called from an external shader. The do not have to be used but a pointer to this structure is passed to the shader function so this header file must be included. Use the definitions in the file DEFINES.H to provide easy to use references to the functions. See the example shaders on how to use them. The functions provide standard Perlin type random variables that can be used in developing fractal type textures. normalize() will scale a vector to have unit length. Some functions are more useful than others the one that are useful are -: normalize(n); normalize vector "n" to unit length sNoise(x,y,z,r); returns (r) a Perlin random variable [0-1] given an (x,y,z) co-ordinate vNoise(v,x,y,z); returns a normalized Perlin random vector given an (x,y,z) co-ordinate sTurbulence(x,y,z,r); returns (r) a turbulence value given co-ordinate vTurbulence(v,x,y,z); returns a turbulence vector given a co-ordinate

Definition at line 35 of file rstruct.h.


Data Fields

void(* fp_sNoise )(double x, double y, double z, double *result)
 Pointer to renderer function.
void(* fp_sTurbulence )(double x, double y, double z, double *result)
 Pointer to renderer function.
void(* fp_Cycloidal )(double value, double *result)
 Pointer to renderer function.
void(* fp_vNoise )(vector result, double x, double y, double z)
 Pointer to renderer function.
void(* fp_vTurbulence )(vector result, double x, double y, double z)
 Pointer to renderer function.
short(* fp_normalize )(vector n)
 Pointer to renderer function.
vectorfp_Wave_Sources
 Pointer to renderer's list of wave sources - may be useful to some shaders.
void(* fp_UseSingleShaderProgram )(long id)
 Pointer to GLSL controlling function.
int(* fp_LoadAndCompileShader )(char *name)
 Pointer to GLSL utility function.
void(* fp_UnloadCompiledShader )(GLint id)
 Pointer to GLSL utility function.
void(* fp_SetUniformInteger )(int id, char *name, GLint val)
 Pointer to GLSL utility function.
void(* fp_SetUniformVariable )(int id, char *name, GLfloat val)
 Pointer to GLSL utility function.
void(* fp_SetUniformVector )(int id, char *name, GLfloat a, GLfloat b, GLfloat c)
 Pointer to GLSL utility function.
void(* fp_SetUniformVector2 )(int id, char *name, GLfloat a, GLfloat b)
 Pointer to GLSL utility function.
void(* fp_SetUniformMatrix3 )(int id, char *name, GLfloat m[3][3])
 Pointer to GLSL utility function.
void(* fp_SetUniformMatrix4 )(int id, char *name, GLfloat m[4][4])
 Pointer to GLSL utility function.
void(* fp_SetAttributeInteger )(int id, char *name, GLshort val)
 Pointer to GLSL utility function.
void(* fp_SetAttributeVariable )(int id, char *name, GLfloat val)
 Pointer to GLSL utility function.
void(* fp_SetAttributeVector )(int id, char *name, GLfloat a, GLfloat b, GLfloat c)
 Pointer to GLSL utility function.
void(* fp_SetAttributeVectorID )(int id, int loc, GLfloat a, GLfloat b, GLfloat c)
 Pointer to GLSL utility function.
void(* fp_BindAttributeVector )(int id, char *name, int loc)
 Pointer to GLSL utility function.
GLint(* fp_GetAttibuteLocation )(int id, char *name)
 Pointer to GLSL utility function.
void(* fp_DrawShaderPolygons )(long k, int pass, GLuint progID, GLint attribloc, long Nface, void *MainFp, long Nvert, void *MainVp)
 Pointer to function that the GLSL shader must call to actually render the shaded polygons.
long * dummyf [16]
 For future expansion.
long version
 Version of this structure.
vectorfp_axis_o
 Texture cell origin.
vectorfp_axis_u
 Texture cell U axis.
vectorfp_axis_v
 Texture cell V axis.
vectorfp_axis_n
 Texture cell normal or W axis.
vectorfp_axis_unorm
 Texture cell U normalised vector.
vectorfp_axis_vnorm
 texture cell V normalised vector
double * u_length
 Texture cell vector length.
double * v_length
 Texture cell vector length THESE ARE JUST UNIT VECTORS BECAUSE THEY ARE NOT NEEDED IN THE CURENT VERSION.
double * tr
double * itr
 Pointers to 4 x 4 arrays.
long GLshaderID
 Shader ID for OpenGL Renderer.
long fp_matpass
 Which material in list 0 - (nMats-1).
long fp_pass
 GL rendering is done in two passes 1)transparent 2)opaque polygons.
GLuint fp_progID
 GPU program identifier.
GLint fp_attrloc
 Attribute location for "ShaderPosition" variable in shaders codes (this is used to pass the vertex shader coordinate.
long fp_Nface
 Number of polygons in the model.
void * fp_MainFp
 Pointer to list of polygons - will need cast.
long fp_Nvert
 Number of vertices in the model.
void * fp_MainVp
 Pointer to list of vertices - will need cast.
BOOL fp_FullSat
 Use(or not Use) full saturation.
long * dummyv [21]
 For future expansion.

Field Documentation

void(* fp_sNoise)(double x, double y, double z, double *result)

Pointer to renderer function.

Referenced by init_structures().

void(* fp_sTurbulence)(double x, double y, double z, double *result)

Pointer to renderer function.

Referenced by init_structures().

void(* fp_Cycloidal)(double value, double *result)

Pointer to renderer function.

Referenced by init_structures().

void(* fp_vNoise)(vector result, double x, double y, double z)

Pointer to renderer function.

Referenced by init_structures().

void(* fp_vTurbulence)(vector result, double x, double y, double z)

Pointer to renderer function.

Referenced by init_structures().

short(* fp_normalize)(vector n)

Pointer to renderer function.

Referenced by init_structures().

Pointer to renderer's list of wave sources - may be useful to some shaders.

Definition at line 42 of file rstruct.h.

Referenced by init_structures().

void(* fp_UseSingleShaderProgram)(long id)

Pointer to GLSL controlling function.

Referenced by init_structures().

int(* fp_LoadAndCompileShader)(char *name)

Pointer to GLSL utility function.

Referenced by _ExternalTextureStartup(), and init_structures().

void(* fp_UnloadCompiledShader)(GLint id)

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_SetUniformInteger)(int id, char *name, GLint val)

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_SetUniformVariable)(int id, char *name, GLfloat val)

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_SetUniformVector)(int id, char *name, GLfloat a, GLfloat b, GLfloat c)

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_SetUniformVector2)(int id, char *name, GLfloat a, GLfloat b)

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_SetUniformMatrix3)(int id, char *name, GLfloat m[3][3])

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_SetUniformMatrix4)(int id, char *name, GLfloat m[4][4])

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_SetAttributeInteger)(int id, char *name, GLshort val)

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_SetAttributeVariable)(int id, char *name, GLfloat val)

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_SetAttributeVector)(int id, char *name, GLfloat a, GLfloat b, GLfloat c)

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_SetAttributeVectorID)(int id, int loc, GLfloat a, GLfloat b, GLfloat c)

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_BindAttributeVector)(int id, char *name, int loc)

Pointer to GLSL utility function.

Referenced by init_structures().

GLint(* fp_GetAttibuteLocation)(int id, char *name)

Pointer to GLSL utility function.

Referenced by init_structures().

void(* fp_DrawShaderPolygons)(long k, int pass, GLuint progID, GLint attribloc, long Nface, void *MainFp, long Nvert, void *MainVp)

Pointer to function that the GLSL shader must call to actually render the shaded polygons.

long* dummyf[16]

For future expansion.

Definition at line 59 of file rstruct.h.

long version

Version of this structure.

Definition at line 60 of file rstruct.h.

Referenced by init_structures().

Texture cell origin.

Definition at line 61 of file rstruct.h.

Referenced by RenderExternalTexture().

Texture cell U axis.

Definition at line 61 of file rstruct.h.

Referenced by RenderExternalTexture().

Texture cell V axis.

Definition at line 61 of file rstruct.h.

Referenced by RenderExternalTexture().

Texture cell normal or W axis.

Definition at line 61 of file rstruct.h.

Referenced by RenderExternalTexture().

Texture cell U normalised vector.

Definition at line 65 of file rstruct.h.

Referenced by RenderExternalTexture().

texture cell V normalised vector

Definition at line 65 of file rstruct.h.

Referenced by RenderExternalTexture().

double* u_length

Texture cell vector length.

Definition at line 67 of file rstruct.h.

Referenced by RenderExternalTexture().

double * v_length

Texture cell vector length THESE ARE JUST UNIT VECTORS BECAUSE THEY ARE NOT NEEDED IN THE CURENT VERSION.

Definition at line 67 of file rstruct.h.

Referenced by RenderExternalTexture().

double* tr

Definition at line 69 of file rstruct.h.

double * itr

Pointers to 4 x 4 arrays.

Definition at line 69 of file rstruct.h.

long GLshaderID

Shader ID for OpenGL Renderer.

Definition at line 70 of file rstruct.h.

Referenced by FreeExternalTextures().

long fp_matpass

Which material in list 0 - (nMats-1).

Definition at line 71 of file rstruct.h.

long fp_pass

GL rendering is done in two passes 1)transparent 2)opaque polygons.

Definition at line 72 of file rstruct.h.

GLuint fp_progID

GPU program identifier.

Definition at line 73 of file rstruct.h.

GLint fp_attrloc

Attribute location for "ShaderPosition" variable in shaders codes (this is used to pass the vertex shader coordinate.

Definition at line 74 of file rstruct.h.

long fp_Nface

Number of polygons in the model.

Definition at line 75 of file rstruct.h.

void* fp_MainFp

Pointer to list of polygons - will need cast.

Definition at line 76 of file rstruct.h.

long fp_Nvert

Number of vertices in the model.

Definition at line 77 of file rstruct.h.

void* fp_MainVp

Pointer to list of vertices - will need cast.

Definition at line 78 of file rstruct.h.

BOOL fp_FullSat

Use(or not Use) full saturation.

Definition at line 79 of file rstruct.h.

Referenced by RenderExternalTexture().

long* dummyv[21]

For future expansion.

Definition at line 80 of file rstruct.h.


The documentation for this struct was generated from the following file:

Generated on Sun Apr 27 14:20:20 2014 for OpenFX by  doxygen 1.5.6