$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
scene_uniforms.h
Go to the documentation of this file.
1 #ifndef SCENE_UNIFORMS_H
2 #define SCENE_UNIFORMS_H
3 
13 #include "gl_common.h"
14 #include "sphere_types.h" /* SH_TEXTURE_COUNT */
15 
21 typedef struct {
23  GLint prefilter_map;
24  GLint brdf_lut;
25  GLint debug_mode;
26  GLint cam_pos;
27  GLint projection;
28  GLint view;
33  GLint gi_mode;
35  GLint u_aa_mode;
36  GLint
37  sh_textures[SH_TEXTURE_COUNT];
39 
44 typedef struct {
45  GLint projection;
46  GLint view;
47  GLint u_stippled;
50  GLint u_color;
52 
58 enum { MAT4_FLOAT_COUNT = 16 };
59 
60 typedef struct {
61  float projection[MAT4_FLOAT_COUNT];
62  float view[MAT4_FLOAT_COUNT];
63  float previous_view_proj[MAT4_FLOAT_COUNT];
65  float cam_pos[3];
66  int32_t debug_mode;
67  float screen_size[2];
68  float _pad0[2];
69  float probe_grid_min[3];
70  int32_t gi_mode;
71  float probe_grid_max[3];
73  int32_t probe_grid_dim[3];
74  int32_t aa_mode;
75  float grid_to_idx_scale[3];
76  float _pad1;
78 
80 
87 typedef struct {
88  GLint
89  sh_textures[SH_TEXTURE_COUNT];
91 
92 #endif /* SCENE_UNIFORMS_H */
Common OpenGL definitions, RAII helpers, and utilities.
#define GL_ASSERT_UBO_ALIGNMENT(type)
Compile-time assertion that a UBO struct meets AVX alignment. Place after the typedef to catch miscon...
Definition: gl_common.h:156
#define GL_UBO_ALIGNED
Attribute to apply on UBO typedef to enforce AVX alignment. Usage: } GL_UBO_ALIGNED MyUBOType;.
Definition: gl_common.h:149
@ SH_TEXTURE_COUNT
Definition: light_probes.h:13
@ MAT4_FLOAT_COUNT
Definition: scene_uniforms.h:58
Pure-data type for per-instance sphere attributes.
GPU-side uniform buffer for billboard rendering (std140 layout).
Definition: scene_uniforms.h:60
int32_t gi_mode
Definition: scene_uniforms.h:70
int32_t aa_mode
Definition: scene_uniforms.h:74
float _pad1
Definition: scene_uniforms.h:76
int32_t debug_mode
Definition: scene_uniforms.h:66
int32_t specular_aa_enabled
Definition: scene_uniforms.h:72
Cached uniform locations for billboard rendering.
Definition: scene_uniforms.h:87
Cached uniform locations for debug line rendering.
Definition: scene_uniforms.h:44
GLint view
Definition: scene_uniforms.h:46
GLint u_billboard_mode
Definition: scene_uniforms.h:48
GLint u_stippled
Definition: scene_uniforms.h:47
GLint u_color
Definition: scene_uniforms.h:50
GLint u_use_instance_col
Definition: scene_uniforms.h:49
GLint projection
Definition: scene_uniforms.h:45
Cached uniform locations for PBR instanced rendering.
Definition: scene_uniforms.h:21
GLint gi_mode
Definition: scene_uniforms.h:33
GLint debug_mode
Definition: scene_uniforms.h:25
GLint probe_grid_dim
Definition: scene_uniforms.h:32
GLint probe_grid_max
Definition: scene_uniforms.h:31
GLint u_specular_aa_enabled
Definition: scene_uniforms.h:34
GLint u_aa_mode
Definition: scene_uniforms.h:35
GLint prefilter_map
Definition: scene_uniforms.h:23
GLint previous_view_proj
Definition: scene_uniforms.h:29
GLint view
Definition: scene_uniforms.h:28
GLint irradiance_map
Definition: scene_uniforms.h:22
GLint probe_grid_min
Definition: scene_uniforms.h:30
GLint cam_pos
Definition: scene_uniforms.h:26
GLint brdf_lut
Definition: scene_uniforms.h:24
GLint projection
Definition: scene_uniforms.h:27