atomes 1.1.14
atomes: an atomic scale modeling tool box
|
Functions to create GLSL programs
Functions to manage GLSL programs.
More...
Go to the source code of this file.
Macros | |
#define | LIGHT_INFO 3 |
#define | MATERIAL_DATA 6 |
#define | FOG_DATA 5 |
#define | LIGHT_DATA 10 |
Functions | |
GLuint | create_shader (int type, const GLchar *src) |
create an OpenGL GLSL shader | |
GLuint * | alloc_shader_pointer (GLuint *pointer, int shaders) |
allocate GLuint data pointer, ensure that it is clean | |
void | set_light_uniform_location (GLuint *lightning, int id, int j, int k, char *string) |
set lightning uniform location | |
GLuint * | glsl_add_lights (glsl_program *glsl) |
add lightning to an OpenGL shader program | |
void | glsl_bind_points (glsl_program *glsl, object_3d *obj) |
bind a 3D object point to an OpenGL shader program | |
void | glsl_bind_spheres (glsl_program *glsl, object_3d *obj) |
bind a 3D object sphere to an OpenGL shader program | |
void | glsl_bind_lines (glsl_program *glsl, object_3d *obj) |
bind a 3D object line to an OpenGL shader program | |
void | glsl_bind_cylinders (glsl_program *glsl, object_3d *obj) |
bind a 3D object cylinder to an OpenGL shader program | |
void | glsl_bind_caps (glsl_program *glsl, object_3d *obj) |
bind a 3D object cylinder cap to an OpenGL shader program | |
void | glsl_bind_polyhedra (glsl_program *glsl, object_3d *obj) |
bind a 3D object polyhedra to an OpenGL shader program | |
void | update_string_instances (glsl_program *glsl, object_3d *obj) |
Update OpenGL string texture instances. | |
void | glsl_bind_string (glsl_program *glsl, object_3d *obj) |
bind a 3D object text string to an OpenGL shader program | |
object_3d * | duplicate_object_3d (object_3d *old_obj) |
create a copy of an object_3d data structure | |
glsl_program * | init_shader_program (int object, int object_id, const GLchar *vertex, const GLchar *geometry, const GLchar *fragment, GLenum type_of_vertices, int narray, int nunif, gboolean lightning, object_3d *obj) |
create an OpenGL shader program | |
gboolean | in_md_shaders (project *this_proj, int id) |
is this shader MD dependent ? | |
void | re_create_all_md_shaders (glwin *view) |
re-initialize all MD dependent OpenGL shaders | |
void | re_create_md_shaders (int nshaders, int shaders[nshaders], project *this_proj) |
re-initialize some MD dependent OpenGL shaders | |
void | cleaning_shaders (glwin *view, int shader) |
re-initialize an OpenGL shader | |
void | recreate_all_shaders (glwin *view) |
re-initialize all OpenGL shaders | |
void | init_default_shaders (glwin *view) |
re-initialize the default OpenGL shaders | |
void | init_shaders (glwin *view) |
initialize all the OpenGL shaders | |
gboolean | glsl_disable_cull_face (glsl_program *glsl) |
Disable or enable cull face for OpenGL rendering. | |
void | set_lights_data (glsl_program *glsl) |
set lightning data for an OpenGL progam | |
void | shading_glsl_text (glsl_program *glsl) |
Render text in OpenGL. | |
void | render_this_shader (glsl_program *glsl, int ids) |
render an OpenGL shader | |
void | draw_vertices (int id) |
Draw OpenGL shader program. | |
Variables | |
uint16_t | stipple_pattern [NDOTS] ={ 0xAAAA, 0x1111, 0x0000, 0x55FF, 0x24FF, 0x3F3F, 0x33FF, 0x27FF} |
Functions to create GLSL programs
Functions to manage GLSL programs.
Definition in file ogl_shading.c.
#define FOG_DATA 5 |
Definition at line 133 of file ogl_shading.c.
#define LIGHT_DATA 10 |
Definition at line 134 of file ogl_shading.c.
#define LIGHT_INFO 3 |
Definition at line 131 of file ogl_shading.c.
#define MATERIAL_DATA 6 |
Definition at line 132 of file ogl_shading.c.
GLuint * alloc_shader_pointer | ( | GLuint * | pointer, |
int | shaders ) |
allocate GLuint data pointer, ensure that it is clean
pointer | the data pointer to allocate |
shaders | the data size to allocate |
Definition at line 121 of file ogl_shading.c.
void cleaning_shaders | ( | glwin * | view, |
int | shader ) |
re-initialize an OpenGL shader
view | the target glwin |
shader | the shader to initialize |
Definition at line 695 of file ogl_shading.c.
GLuint create_shader | ( | int | type, |
const GLchar * | src ) |
create an OpenGL GLSL shader
type | type of the shader |
src | name of the shader |
Definition at line 85 of file ogl_shading.c.
void draw_vertices | ( | int | id | ) |
Draw OpenGL shader program.
id | the ID of the program to render |
Definition at line 1028 of file ogl_shading.c.
create a copy of an object_3d data structure
old_obj | the data structure to copy |
Definition at line 487 of file ogl_shading.c.
GLuint * glsl_add_lights | ( | glsl_program * | glsl | ) |
add lightning to an OpenGL shader program
glsl | the target glsl |
Definition at line 160 of file ogl_shading.c.
void glsl_bind_caps | ( | glsl_program * | glsl, |
object_3d * | obj ) |
bind a 3D object cylinder cap to an OpenGL shader program
glsl | the target glsl |
obj | the 3D object, cylinder cap to bind |
Definition at line 348 of file ogl_shading.c.
void glsl_bind_cylinders | ( | glsl_program * | glsl, |
object_3d * | obj ) |
bind a 3D object cylinder to an OpenGL shader program
glsl | the target glsl |
obj | the 3D object, cylinder to bind |
Definition at line 302 of file ogl_shading.c.
void glsl_bind_lines | ( | glsl_program * | glsl, |
object_3d * | obj ) |
bind a 3D object line to an OpenGL shader program
glsl | the target glsl |
obj | the 3D object line to bind |
Definition at line 272 of file ogl_shading.c.
void glsl_bind_points | ( | glsl_program * | glsl, |
object_3d * | obj ) |
bind a 3D object point to an OpenGL shader program
glsl | the target glsl |
obj | the 3D object point to bind |
Definition at line 203 of file ogl_shading.c.
void glsl_bind_polyhedra | ( | glsl_program * | glsl, |
object_3d * | obj ) |
bind a 3D object polyhedra to an OpenGL shader program
glsl | the target glsl |
obj | the 3D object polyhedra to bind |
Definition at line 390 of file ogl_shading.c.
void glsl_bind_spheres | ( | glsl_program * | glsl, |
object_3d * | obj ) |
bind a 3D object sphere to an OpenGL shader program
glsl | the target glsl |
obj | the 3D object sphere to bind |
Definition at line 236 of file ogl_shading.c.
void glsl_bind_string | ( | glsl_program * | glsl, |
object_3d * | obj ) |
bind a 3D object text string to an OpenGL shader program
glsl | the target glsl |
obj | the 3D object text string to bind |
Definition at line 448 of file ogl_shading.c.
gboolean glsl_disable_cull_face | ( | glsl_program * | glsl | ) |
Disable or enable cull face for OpenGL rendering.
glsl | the target glsl |
Definition at line 791 of file ogl_shading.c.
gboolean in_md_shaders | ( | project * | this_proj, |
int | id ) |
is this shader MD dependent ?
this_proj | the target project |
id | the shader id |
Definition at line 632 of file ogl_shading.c.
void init_default_shaders | ( | glwin * | view | ) |
re-initialize the default OpenGL shaders
view | the target glwin |
Definition at line 729 of file ogl_shading.c.
glsl_program * init_shader_program | ( | int | object, |
int | object_id, | ||
const GLchar * | vertex, | ||
const GLchar * | geometry, | ||
const GLchar * | fragment, | ||
GLenum | type_of_vertices, | ||
int | narray, | ||
int | nunif, | ||
gboolean | lightning, | ||
object_3d * | obj ) |
create an OpenGL shader program
object | shader id (in enum shaders) |
object_id | shader type in: GLSL_SPHERES, GLSL_POINTS, GLSL_LINES, GLSL_CYLINDERS, GLSL_CAPS, GLSL_POLYEDRA, GLSL_STRING |
vertex | general shader: in the shaders defined in 'ogl_shaders.c' |
geometry | geometry shader, if any: in the shaders defined in 'ogl_shaders.c' |
fragment | color shader, if any: in the shaders defined in 'ogl_shaders.c' |
type_of_vertices | type of vertices in: GL_POINTS, GL_LINES, GL_TRIANGLE GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP |
narray | number of vertices to allocate |
nunif | number of uniform location(s) to allocate |
lightning | use lightning (1/0) |
obj | the object 3D to bind to the shader |
Definition at line 533 of file ogl_shading.c.
void init_shaders | ( | glwin * | view | ) |
initialize all the OpenGL shaders
view | the target glwin |
Definition at line 757 of file ogl_shading.c.
void re_create_all_md_shaders | ( | glwin * | view | ) |
re-initialize all MD dependent OpenGL shaders
view | the target glwin |
Definition at line 651 of file ogl_shading.c.
void re_create_md_shaders | ( | int | nshaders, |
int | shaders[nshaders], | ||
project * | this_proj ) |
re-initialize some MD dependent OpenGL shaders
nshaders | the number of shader(s) to initialize |
shaders | the list of shaders |
this_proj | the target project |
Definition at line 673 of file ogl_shading.c.
void recreate_all_shaders | ( | glwin * | view | ) |
re-initialize all OpenGL shaders
view | the target glwin |
Definition at line 713 of file ogl_shading.c.
void render_this_shader | ( | glsl_program * | glsl, |
int | ids ) |
render an OpenGL shader
glsl | the target glsl |
ids |
Definition at line 895 of file ogl_shading.c.
void set_light_uniform_location | ( | GLuint * | lightning, |
int | id, | ||
int | j, | ||
int | k, | ||
char * | string ) |
set lightning uniform location
lightning | |
id | shader id |
j | light id |
k | uniform id |
string | uniform string |
Definition at line 148 of file ogl_shading.c.
void set_lights_data | ( | glsl_program * | glsl | ) |
set lightning data for an OpenGL progam
glsl | the target glsl |
Definition at line 818 of file ogl_shading.c.
void shading_glsl_text | ( | glsl_program * | glsl | ) |
void update_string_instances | ( | glsl_program * | glsl, |
object_3d * | obj ) |
Update OpenGL string texture instances.
glsl | the target glsl |
obj |
Definition at line 414 of file ogl_shading.c.
uint16_t stipple_pattern[NDOTS] ={ 0xAAAA, 0x1111, 0x0000, 0x55FF, 0x24FF, 0x3F3F, 0x33FF, 0x27FF} |
Definition at line 865 of file ogl_shading.c.