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. | |
vector * | fp_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. | |
vector * | fp_axis_o |
Texture cell origin. | |
vector * | fp_axis_u |
Texture cell U axis. | |
vector * | fp_axis_v |
Texture cell V axis. | |
vector * | fp_axis_n |
Texture cell normal or W axis. | |
vector * | fp_axis_unorm |
Texture cell U normalised vector. | |
vector * | fp_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. |
void(* fp_sTurbulence)(double x, double y, double z, double *result) |
void(* fp_Cycloidal)(double value, double *result) |
void(* fp_vTurbulence)(vector result, double x, double y, double z) |
short(* fp_normalize)(vector n) |
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) |
int(* fp_LoadAndCompileShader)(char *name) |
void(* fp_UnloadCompiledShader)(GLint id) |
void(* fp_SetUniformInteger)(int id, char *name, GLint val) |
void(* fp_SetUniformVariable)(int id, char *name, GLfloat val) |
void(* fp_SetUniformVector)(int id, char *name, GLfloat a, GLfloat b, GLfloat c) |
void(* fp_SetUniformVector2)(int id, char *name, GLfloat a, GLfloat b) |
void(* fp_SetUniformMatrix3)(int id, char *name, GLfloat m[3][3]) |
void(* fp_SetUniformMatrix4)(int id, char *name, GLfloat m[4][4]) |
void(* fp_SetAttributeInteger)(int id, char *name, GLshort val) |
void(* fp_SetAttributeVariable)(int id, char *name, GLfloat val) |
void(* fp_SetAttributeVector)(int id, char *name, GLfloat a, GLfloat b, GLfloat c) |
void(* fp_SetAttributeVectorID)(int id, int loc, GLfloat a, GLfloat b, GLfloat c) |
void(* fp_BindAttributeVector)(int id, char *name, int loc) |
GLint(* fp_GetAttibuteLocation)(int id, char *name) |
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 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().
long GLshaderID |
Shader ID for OpenGL Renderer.
Definition at line 70 of file rstruct.h.
Referenced by FreeExternalTextures().
long fp_matpass |
long fp_pass |
GLint fp_attrloc |
void* fp_MainFp |
void* fp_MainVp |
BOOL fp_FullSat |
Use(or not Use) full saturation.
Definition at line 79 of file rstruct.h.
Referenced by RenderExternalTexture().