|
atomes 1.2.1
atomes: an atomic scale modeling tool box
|
Functions to create GLSL programs
Functions to manage GLSL programs.
More...
Include dependency graph for ogl_shading.c: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 | glsl_bind_background (glsl_program *glsl, object_3d *obj) |
| bind background data 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} |
| int | this_tilt |
| int | this_pattern |
| int | this_factor |
Functions to create GLSL programs
Functions to manage GLSL programs.
Definition in file ogl_shading.c.
| #define FOG_DATA 5 |
Definition at line 134 of file ogl_shading.c.
| #define LIGHT_DATA 10 |
Definition at line 135 of file ogl_shading.c.
| #define LIGHT_INFO 3 |
Definition at line 132 of file ogl_shading.c.
| #define MATERIAL_DATA 6 |
Definition at line 133 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 122 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 721 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 86 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 1071 of file ogl_shading.c.
create a copy of an object_3d data structure
| old_obj | the data structure to copy |
Definition at line 510 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 161 of file ogl_shading.c.
| void glsl_bind_background | ( | glsl_program * | glsl, |
| object_3d * | obj ) |
bind background data to an OpenGL shader program
| glsl | the target glsl |
| obj | the 3D object to bind |
Definition at line 415 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 349 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 303 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 273 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 204 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 391 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 237 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 471 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 817 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 658 of file ogl_shading.c.
| void init_default_shaders | ( | glwin * | view | ) |
re-initialize the default OpenGL shaders
| view | the target glwin |
Definition at line 755 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, GLSL_BACK |
| 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 556 of file ogl_shading.c.
| void init_shaders | ( | glwin * | view | ) |
initialize all the OpenGL shaders
| view | the target glwin |
Definition at line 783 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 677 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 699 of file ogl_shading.c.
| void recreate_all_shaders | ( | glwin * | view | ) |
re-initialize all OpenGL shaders
| view | the target glwin |
Definition at line 739 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 924 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 149 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 844 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 437 of file ogl_shading.c.
| uint16_t stipple_pattern[NDOTS] ={ 0xAAAA, 0x1111, 0x0000, 0x55FF, 0x24FF, 0x3F3F, 0x33FF, 0x27FF} |
Definition at line 891 of file ogl_shading.c.
| int this_factor |
Definition at line 894 of file ogl_shading.c.
| int this_pattern |
Definition at line 893 of file ogl_shading.c.
| int this_tilt |
Definition at line 892 of file ogl_shading.c.