atomes 1.2.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
ogl_shading.h
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2025 by CNRS and University of Strasbourg */
15
23/*
24* This header file: 'ogl_shading.h'
25*
26* Contains:
27
28 - Variable declarations related to GLSL programs
29 - Data structure declarations related to GLSL programs
30
31*/
32
33#ifndef OGL_SHADING_H_
34#define OGL_SHADING_H_
35
48
49#define POLY_BUFF_SIZE 10 // p(x,y,z), n(x,y,z), color (r,g,b,a)
50#define LINE_BUFF_SIZE 7 // p(x,y,z), color (r,g,b,a)
51#define CYLI_BUFF_SIZE 13 // p(x,y,z), length, rad, quat(w,x,y,z), color (r,g,b,a)
52#define CAPS_BUFF_SIZE 12 // p(x,y,z), rad, quat(w,x,y,z), color (r,g,b,a)
53#define ATOM_BUFF_SIZE 8 // p(x,y,z), rad, color (r,g,b,a)
54#define CHAR_BUFF_SIZE 4 // p(x,y), t(x,y)
55
56// Points
57extern const GLchar * point_vertex;
58extern const GLchar * point_color;
59
60// Basic lines
61extern const GLchar * line_vertex;
62extern const GLchar * line_color;
63extern const GLchar * line_stipple;
64extern const GLchar * line_stipple_color;
65extern const GLchar * angle_vertex;
66extern const GLchar * angle_stipple;
67extern const GLchar * angle_color;
68
69extern const GLchar * angstrom_vertex;
70extern const GLchar * degree_vertex;
71
72// Triangles: Multiple lights + Materials + Transparency shaders
73extern const GLchar * full_vertex;
74extern const GLchar * full_color;
75
76// Sphere
77extern const GLchar * sphere_vertex;
78
79// Cylinder and caps
80extern const GLchar * cylinder_vertex;
81extern const GLchar * cone_vertex;
82extern const GLchar * cap_vertex;
83
84extern const GLchar * axis_sphere_vertex;
85extern const GLchar * axis_cylinder_geom;
86extern const GLchar * axis_line_vertex;
87
88// Cylinder in geometry shader
89extern const GLchar * gs_cylinder_vertex;
90extern const GLchar * gs_cylinder_geom;
91
92extern const GLchar * polyedron_vertex;
93extern const GLchar * polyedron_geom;
94extern const GLchar * polyedron_color;
95
96extern const GLchar * axis_cylinder_geom;
97
98extern const GLchar * pick_color;
99
100extern const GLchar * string_vertex;
101extern const GLchar * string_color;
102extern const GLchar * string_color_2d;
103
104extern const GLchar * background_vertex;
105extern const GLchar * background_linear;
106extern const GLchar * background_circular;
107
109typedef struct object_3d object_3d;
127
131{
132 int id;
133 int object;
137 GLenum vert_type;
138 int draw_type;
139 gboolean draw_instanced;
140 GLuint vao;
141 GLuint * vbo;
142 GLuint * array_pointer;
143 GLuint * uniform_loc;
144 GLuint * light_uniform;
148};
149
150#endif
const GLchar * full_color
const GLchar * gs_cylinder_vertex
const GLchar * string_color_2d
const GLchar * string_vertex
const GLchar * line_stipple_color
const GLchar * axis_cylinder_geom
Definition ogl_shading.h:96
const GLchar * axis_sphere_vertex
const GLchar * angle_stipple
const GLchar * angle_vertex
const GLchar * background_circular
const GLchar * polyedron_vertex
const GLchar * gs_cylinder_geom
const GLchar * pick_color
const GLchar * polyedron_geom
const GLchar * polyedron_color
const GLchar * background_vertex
const GLchar * cylinder_vertex
const GLchar * string_color
const GLchar * full_vertex
const GLchar * line_color
const GLchar * line_stipple
const GLchar * cap_vertex
const GLchar * background_linear
const GLchar * angle_color
const GLchar * line_vertex
Definition ogl_shaders.c:80
const GLchar * sphere_vertex
const GLchar * point_vertex
Definition ogl_shaders.c:43
const GLchar * axis_line_vertex
Definition ogl_shaders.c:93
const GLchar * cone_vertex
const GLchar * degree_vertex
const GLchar * point_color
Definition ogl_shaders.c:59
const GLchar * angstrom_vertex
glsl_styles
Definition ogl_shading.h:37
@ GLSL_LIGHT
Definition ogl_shading.h:45
@ GLSL_CAPS
Definition ogl_shading.h:42
@ GLSL_POINTS
Definition ogl_shading.h:38
@ GLSL_STRING
Definition ogl_shading.h:44
@ GLSL_LINES
Definition ogl_shading.h:40
@ GLSL_POLYEDRA
Definition ogl_shading.h:43
@ GLSL_SPHERES
Definition ogl_shading.h:39
@ GLSL_BACK
Definition ogl_shading.h:46
@ GLSL_CYLINDERS
Definition ogl_shading.h:41
GLuint vertex_shader
GLuint geometry_shader
GLuint * light_uniform
GLenum vert_type
GLuint * array_pointer
GLuint * vbo
object_3d * obj
GLuint fragment_shader
GLuint * uniform_loc
gboolean draw_instanced
ColRGBA * col
GLuint texture
int ind_buffer_size
int num_instances
int * indices
float * vertices
float shift[4]
int num_vertices
int inst_buffer_size
float * instances
int vert_buffer_size
int num_indices