$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
postprocess.h
Go to the documentation of this file.
1 
10 #ifndef POSTPROCESS_H
11 #define POSTPROCESS_H
12 
13 #include "effects/fx_auto_exposure.h"
14 #include "effects/fx_bloom.h"
15 #include "effects/fx_dof.h"
16 #include "effects/fx_lut3d.h"
17 #include "effects/fx_lut_viz.h"
18 #include "effects/fx_motion_blur.h"
19 #include "gl_common.h"
20 #include "gpu_profiler.h"
21 #include "shader.h"
22 #include <cglm/cglm.h>
23 #include <cglm/types.h>
24 
25 /* --- DEFAULT VALUES --- */
26 #define POSTPROCESS_HISTOGRAM_BUCKETS 256
27 
28 #define DEFAULT_VIGNETTE_INTENSITY 0.8F
29 #define DEFAULT_VIGNETTE_SMOOTHNESS 0.5F
30 #define DEFAULT_VIGNETTE_ROUNDNESS 1.0F
31 #define DEFAULT_GRAIN_INTENSITY 0.02F
32 #define DEFAULT_GRAIN_SHADOWS_MAX 0.09F
33 #define DEFAULT_GRAIN_HIGHLIGHTS_MIN 0.5F
34 #define DEFAULT_GRAIN_TEXEL_SIZE 1.0F
35 #define DEFAULT_EXPOSURE 1.00F
36 #define DEFAULT_CHROM_ABBR_STRENGTH 0.005F
37 #define DEFAULT_BLOOM_INTENSITY 0.0F
38 #define DEFAULT_BLOOM_THRESHOLD 1.0F
39 #define DEFAULT_BLOOM_SOFT_THRESHOLD 0.5F
40 #define DEFAULT_BLOOM_RADIUS 1.0F
41 
42 /* FXAA Defaults */
43 #define DEFAULT_FXAA_SUBPIX 0.75F
44 #define DEFAULT_FXAA_EDGE_THRESHOLD 0.125F
45 #define DEFAULT_FXAA_EDGE_THRESHOLD_MIN 0.063F
46 
47 /* DoF defaults */
48 #define DEFAULT_DOF_FOCAL_DISTANCE 20.0F
49 #define DEFAULT_DOF_FOCAL_RANGE 5.0F
50 #define DEFAULT_DOF_BOKEH_SCALE 10.0F
51 #define DEFAULT_DOF_ANAMORPHIC_RATIO \
52  1.0F
54 /* Banding defaults */
55 #define DEFAULT_BANDING_LEVELS 256.0F
57 /* Fog Defaults */
58 #define DEFAULT_FOG_DENSITY 0.0F
59 #define DEFAULT_FOG_START 10.0F
60 #define DEFAULT_FOG_HEIGHT_FALLOFF 0.1F
61 #define DEFAULT_FOG_COLOR_R 0.5F
62 #define DEFAULT_FOG_COLOR_G 0.6F
63 #define DEFAULT_FOG_COLOR_B 0.7F
64 
65 /* White Balance Defaults */
66 #define DEFAULT_WB_TEMP 6500.0F
67 #define DEFAULT_WB_TINT 0.0F
68 
69 /* Filmic Defaults (Safe Neutrals) */
70 #define DEFAULT_FILMIC_SLOPE 1.0F
71 #define DEFAULT_FILMIC_TOE 0.0F
72 #define DEFAULT_FILMIC_SHOULDER 0.0F
73 #define DEFAULT_FILMIC_BLACK_CLIP 0.0F
74 #define DEFAULT_FILMIC_WHITE_CLIP 0.0F
75 
80 typedef enum {
81  POSTFX_VIGNETTE = (1U << 0U),
82  POSTFX_GRAIN = (1U << 1U),
83  POSTFX_EXPOSURE = (1U << 2U),
84  POSTFX_CHROM_ABBR = (1U << 3U),
85  POSTFX_BLOOM = (1U << 4U),
87  (1U << 5U),
88  POSTFX_DOF = (1U << 6U),
89  POSTFX_DOF_DEBUG = (1U << 7U),
91  (1U << 8U),
93  (1U << 9U),
94  POSTFX_MOTION_BLUR = (1U << 10U),
96  (1U << 11U),
97  POSTFX_FXAA = (1U << 12U),
98  POSTFX_FXAA_DEBUG = (1U << 13U),
99  POSTFX_BANDING = (1U << 14U),
101  (1U << 15U),
102  POSTFX_STENCIL_DEBUG = (1U << 16U),
103  POSTFX_BLOOM_DEBUG = (1U << 17U),
104  POSTFX_FOG = (1U << 18U),
105  POSTFX_FOG_DEBUG = (1U << 19U),
106  POSTFX_LUT3D = (1U << 20U),
107  POSTFX_LUT_VIZ = (1U << 21U),
109 
111 #define DEFAULT_ACTIVE_EFFECTS \
112  ((unsigned int)POSTFX_EXPOSURE | (unsigned int)POSTFX_COLOR_GRADING | \
113  (unsigned int)POSTFX_FXAA)
114 
119 typedef struct {
120  float saturation;
121  float contrast;
122  float gamma;
123  float gain;
124  float offset;
125  float lift;
127 
132 typedef struct {
133  float intensity;
134  float smoothness;
135  float roundness;
137 
142 typedef struct {
143  float intensity;
147  float shadows_max;
149  float texel_size;
150 } GrainParams;
151 
156 typedef struct {
157  float exposure;
159 
164 typedef struct {
165  float strength;
167 
172 typedef struct {
173  float temperature;
174  float tint;
176 
181 typedef struct {
182  float slope;
183  float toe;
184  float shoulder;
185  float black_clip;
186  float white_clip;
187 } TonemapParams;
188 
193 typedef struct {
194  float subpix;
198 } FXAAParams;
199 
204 typedef enum {
211 
216 typedef struct {
217  int32_t mode;
218  float levels;
222 } BandingParams;
223 
228 typedef struct {
229  float density;
230  float start;
232  float color[3];
233 } FogParams;
234 
239 typedef struct {
240  unsigned int flags;
243 
244 enum { SHADER_CACHE_SIZE = 64 };
245 
251 typedef struct {
252  uint32_t active_effects;
253  float time;
254  float screen_texel_size[2];
256  /* Vignette */
260  float _pad1;
261 
262  /* Grain */
270  float _pad2;
271 
272  /* Exposure */
274  float _pad3[3];
275 
276  /* Chrom Abbr */
278  float _pad4[3];
279 
280  /* White Balance */
282  float wb_tint;
283  float _pad5[2];
284 
285  /* Color Grading */
292  float _pad6[2];
293 
294  /* Tonemapper */
296  float tonemap_toe;
300  float _pad7[3];
301 
302  /* Bloom */
307 
308  /* DoF */
313 
314  /* Motion Blur */
317  int32_t mb_samples;
318  float _pad9;
319 
320  /* FXAA */
324  float _pad10;
325 
326  /* Banding (32 bytes) */
327  int32_t banding_mode;
331  float banding_channel_levels[3];
332  float _pad11;
333 
334  /* Fog (32 bytes) */
335  float fog_density;
336  float fog_start;
338  float _pad12;
339  vec3 fog_color;
340  float _pad13;
341 
342  /* 3D LUT (16 bytes) */
344  float _pad14[3];
346 
348 
353 typedef struct PostProcess {
354  /* FBO principal et textures */
355  GLuint scene_fbo;
357  GLuint velocity_tex;
361  /* Module Resources */
362  BloomFX bloom_fx;
363  DoFFX dof_fx;
364  AutoExposureFX auto_exposure_fx;
365  MotionBlurFX motion_blur_fx;
366  LUT3DFX lut3d_fx;
367  LUTVizFX lut_viz_fx;
369  /* Render Utilities */
373  GLuint settings_ubo;
375  /* Core Shaders */
380  int width;
381  int height;
383  unsigned int active_effects;
385  /* Logic Parameters */
393  BloomParams bloom;
394  DoFParams dof;
395  AutoExposureParams auto_exposure;
396  MotionBlurParams motion_blur;
400  LUT3DParams lut3d;
401 
402  float time;
403  float delta_time;
406 
409  bool ubo_dirty;
411  unsigned int
416 
420  /* --- Exposure Readback --- */
421  GLuint
423  GLuint histogram_pbo[2];
425  GLsync exposure_sync[2];
427  GLsync histogram_sync[2];
433  /* --- Histogram Cache (Avoid UI flickering) --- */
438 
439  uint64_t frame_count;
440 } PostProcess;
441 
442 /* --- Lifecycle --- */
443 
452 int postprocess_init(PostProcess* post_processing,
453  GPUProfiler* external_profiler, int width, int height);
454 
459 void postprocess_cleanup(PostProcess* post_processing);
460 
466 void postprocess_compile_optimized(PostProcess* post_processing,
467  unsigned int static_flags);
468 
473 void postprocess_use_dynamic(PostProcess* post_processing);
474 
476 void postprocess_set_dummy_textures(PostProcess* post_processing,
477  GLuint dummy_black);
478 
485 void postprocess_resize(PostProcess* post_processing, int width, int height);
486 
487 /* --- Effect Control --- */
488 
490 void postprocess_enable(PostProcess* post_processing, PostProcessEffect effect);
492 void postprocess_disable(PostProcess* post_processing,
493  PostProcessEffect effect);
495 void postprocess_toggle(PostProcess* post_processing, PostProcessEffect effect);
497 int postprocess_is_enabled(PostProcess* post_processing,
498  PostProcessEffect effect);
499 
500 /* --- Parameter Tuning --- */
501 
502 void postprocess_set_white_balance(PostProcess* post_processing,
503  float temperature, float tint);
504 void postprocess_set_color_grading(PostProcess* post_processing,
505  float saturation, float contrast,
506  float gamma, float gain, float offset,
507  float lift);
508 void postprocess_set_tonemapper(PostProcess* post_processing, float slope,
509  float toe, float shoulder, float black_clip,
510  float white_clip);
511 void postprocess_set_grading_ue_default(PostProcess* post_processing);
512 void postprocess_set_vignette(PostProcess* post_processing, float intensity,
513  float smoothness, float roundness);
514 void postprocess_set_grain(PostProcess* post_processing, float intensity);
515 void postprocess_set_exposure(PostProcess* post_processing, float exposure);
516 void postprocess_set_chrom_abbr(PostProcess* post_processing, float strength);
517 void postprocess_set_bloom(PostProcess* post_processing, float intensity,
518  float threshold, float soft_threshold);
519 void postprocess_set_dof(PostProcess* post_processing, float focal_distance,
520  float focal_range, float bokeh_scale);
521 void postprocess_set_dof_anamorphic(PostProcess* post_processing,
522  float anamorphic_ratio);
523 float postprocess_get_exposure(PostProcess* post_processing);
524 void postprocess_set_auto_exposure(PostProcess* post_processing,
525  float min_luminance, float max_luminance,
526  float speed_up, float speed_down,
527  float key_value);
528 void postprocess_set_fxaa(PostProcess* post_processing, float subpix,
529  float edge_threshold, float edge_threshold_min);
530 void postprocess_set_banding(PostProcess* post_processing, BandingMode mode,
531  float levels);
532 void postprocess_set_banding_dither(PostProcess* post_processing,
533  float strength);
534 void postprocess_set_banding_perceptual(PostProcess* post_processing,
535  float gamma);
536 void postprocess_set_banding_channels(PostProcess* post_processing, float red,
537  float green, float blue);
538 void postprocess_set_fog(PostProcess* post_processing, float density,
539  float start, float height_falloff, float fog_r,
540  float fog_g, float fog_b);
541 void postprocess_set_lut3d(PostProcess* post_processing, float intensity,
542  GLuint texture);
543 int postprocess_load_lut3d(PostProcess* post_processing, const char* path);
550 void postprocess_update_matrices(PostProcess* post_processing, mat4 view_proj);
551 
556 typedef struct {
557  unsigned int active_effects;
565  BloomParams bloom;
566  DoFParams dof;
570  LUT3DParams lut3d;
572 
579 void postprocess_apply_preset(PostProcess* post_processing,
580  const PostProcessPreset* preset);
581 
582 /* --- Render Pass Management --- */
583 
588 void postprocess_begin(PostProcess* post_processing);
589 
594 void postprocess_end(PostProcess* post_processing);
595 
601 void postprocess_update_time(PostProcess* post_processing, float delta_time);
602 
603 GLuint postprocess_get_exposure_pbo(PostProcess* post_processing, int index);
604 GLuint postprocess_get_histogram_pbo(PostProcess* post_processing, int index);
605 GLsync postprocess_get_exposure_sync(PostProcess* post_processing, int index);
606 GLsync postprocess_get_histogram_sync(PostProcess* post_processing, int index);
607 void postprocess_set_exposure_sync(PostProcess* post_processing, int index,
608  GLsync sync);
609 void postprocess_set_histogram_sync(PostProcess* post_processing, int index,
610  GLsync sync);
611 
616 void postprocess_update_readbacks(PostProcess* post_processing,
617  uint64_t frame_count);
618 
622 void postprocess_set_exposure_target(PostProcess* post_processing,
623  float threshold);
624 
630  uint64_t frame_count, int* buckets,
631  int size, float* min_lum,
632  float* max_lum);
633 
634 #endif /* POSTPROCESS_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:153
#define GL_UBO_ALIGNED
Attribute to apply on UBO typedef to enforce AVX alignment. Usage: } GL_UBO_ALIGNED MyUBOType;.
Definition: gl_common.h:146
PostProcessEffect
Bitmask flags for enabling/disabling individual effects.
Definition: postprocess.h:80
@ POSTFX_BANDING
Definition: postprocess.h:99
@ POSTFX_BLOOM_DEBUG
Definition: postprocess.h:103
@ POSTFX_AUTO_EXPOSURE
Definition: postprocess.h:90
@ POSTFX_MOTION_BLUR
Definition: postprocess.h:94
@ POSTFX_DOF_DEBUG
Definition: postprocess.h:89
@ POSTFX_COLOR_GRADING
Definition: postprocess.h:86
@ POSTFX_EXPOSURE_DEBUG
Definition: postprocess.h:92
@ POSTFX_GRAIN
Definition: postprocess.h:82
@ POSTFX_MOTION_BLUR_DEBUG
Definition: postprocess.h:95
@ POSTFX_LUT_VIZ
Definition: postprocess.h:107
@ POSTFX_VECTOR_FIELD_DEBUG
Definition: postprocess.h:100
@ POSTFX_FXAA
Definition: postprocess.h:97
@ POSTFX_DOF
Definition: postprocess.h:88
@ POSTFX_STENCIL_DEBUG
Definition: postprocess.h:102
@ POSTFX_BLOOM
Definition: postprocess.h:85
@ POSTFX_FXAA_DEBUG
Definition: postprocess.h:98
@ POSTFX_LUT3D
Definition: postprocess.h:106
@ POSTFX_FOG_DEBUG
Definition: postprocess.h:105
@ POSTFX_EXPOSURE
Definition: postprocess.h:83
@ POSTFX_FOG
Definition: postprocess.h:104
@ POSTFX_VIGNETTE
Definition: postprocess.h:81
@ POSTFX_CHROM_ABBR
Definition: postprocess.h:84
GLuint postprocess_get_histogram_pbo(PostProcess *post_processing, int index)
Definition: postprocess.c:1040
void postprocess_set_color_grading(PostProcess *post_processing, float saturation, float contrast, float gamma, float gain, float offset, float lift)
Definition: postprocess.c:511
BandingMode
Styles of color quantization.
Definition: postprocess.h:204
@ BANDING_MODE_DITHERED
Definition: postprocess.h:206
@ BANDING_MODE_LINEAR
Definition: postprocess.h:205
@ BANDING_MODE_PERCEPTUAL
Definition: postprocess.h:207
@ BANDING_MODE_LUMINANCE
Definition: postprocess.h:209
@ BANDING_MODE_CHANNEL
Definition: postprocess.h:208
int postprocess_init(PostProcess *post_processing, GPUProfiler *external_profiler, int width, int height)
Initializes the post-processing pipeline.
Definition: postprocess.c:42
void postprocess_set_white_balance(PostProcess *post_processing, float temperature, float tint)
Definition: postprocess.c:503
void postprocess_set_banding_perceptual(PostProcess *post_processing, float gamma)
Definition: postprocess.c:610
void postprocess_use_dynamic(PostProcess *post_processing)
Switches back to the dynamic/generic Uber-shader.
Definition: postprocess.c:1513
void postprocess_set_grain(PostProcess *post_processing, float intensity)
Definition: postprocess.c:485
void postprocess_set_banding_dither(PostProcess *post_processing, float strength)
Definition: postprocess.c:603
void postprocess_set_dummy_textures(PostProcess *post_processing, GLuint dummy_black)
Internal helper to set fallback textures.
Definition: postprocess.c:258
void postprocess_set_banding_channels(PostProcess *post_processing, float red, float green, float blue)
Definition: postprocess.c:617
void postprocess_set_banding(PostProcess *post_processing, BandingMode mode, float levels)
Definition: postprocess.c:595
void postprocess_update_readbacks(PostProcess *post_processing, uint64_t frame_count)
Updates all async GPU readbacks (Exposure, Histogram). Handles PBO mapping and Sync management intern...
Definition: postprocess.c:1070
void postprocess_set_chrom_abbr(PostProcess *post_processing, float strength)
Definition: postprocess.c:497
void postprocess_set_lut3d(PostProcess *post_processing, float intensity, GLuint texture)
Definition: postprocess.c:1527
int postprocess_compute_luminance_histogram(PostProcess *post_processing, uint64_t frame_count, int *buckets, int size, float *min_lum, float *max_lum)
Computes the luminance histogram from the GPU readback.
Definition: postprocess.c:1148
GLsync postprocess_get_histogram_sync(PostProcess *post_processing, int index)
Definition: postprocess.c:1050
void postprocess_apply_preset(PostProcess *post_processing, const PostProcessPreset *preset)
Applies all settings from a preset atomically.
Definition: postprocess.c:658
void postprocess_set_auto_exposure(PostProcess *post_processing, float min_luminance, float max_luminance, float speed_up, float speed_down, float key_value)
Definition: postprocess.c:573
void postprocess_set_exposure_sync(PostProcess *post_processing, int index, GLsync sync)
Definition: postprocess.c:1055
void postprocess_set_exposure(PostProcess *post_processing, float exposure)
Definition: postprocess.c:491
#define POSTPROCESS_HISTOGRAM_BUCKETS
Definition: postprocess.h:26
void postprocess_set_tonemapper(PostProcess *post_processing, float slope, float toe, float shoulder, float black_clip, float white_clip)
Definition: postprocess.c:525
void postprocess_update_matrices(PostProcess *post_processing, mat4 view_proj)
Updates view-projection matrices for effects requiring depth-reconstruction.
Definition: postprocess.c:1225
void postprocess_enable(PostProcess *post_processing, PostProcessEffect effect)
Enables a specific effect.
Definition: postprocess.c:452
void postprocess_set_bloom(PostProcess *post_processing, float intensity, float threshold, float soft_threshold)
Definition: postprocess.c:537
void postprocess_begin(PostProcess *post_processing)
Binds the HDR FBO and prepares for scene rendering. Should be called BEFORE the main render loop.
Definition: postprocess.c:680
void postprocess_toggle(PostProcess *post_processing, PostProcessEffect effect)
Toggles the current state of an effect.
Definition: postprocess.c:464
void postprocess_cleanup(PostProcess *post_processing)
Releases all GPU and CPU resources.
Definition: postprocess.c:319
void postprocess_set_fog(PostProcess *post_processing, float density, float start, float height_falloff, float fog_r, float fog_g, float fog_b)
Definition: postprocess.c:626
GLuint postprocess_get_exposure_pbo(PostProcess *post_processing, int index)
Definition: postprocess.c:1035
void postprocess_set_grading_ue_default(PostProcess *post_processing)
Definition: postprocess.c:639
void postprocess_disable(PostProcess *post_processing, PostProcessEffect effect)
Disables a specific effect.
Definition: postprocess.c:458
void postprocess_set_histogram_sync(PostProcess *post_processing, int index, GLsync sync)
Definition: postprocess.c:1061
void postprocess_end(PostProcess *post_processing)
Processes the HDR scene and renders the final LDR result to screen. Should be called AFTER the main r...
Definition: postprocess.c:690
GLsync postprocess_get_exposure_sync(PostProcess *post_processing, int index)
Definition: postprocess.c:1045
void postprocess_set_dof(PostProcess *post_processing, float focal_distance, float focal_range, float bokeh_scale)
Definition: postprocess.c:546
int postprocess_load_lut3d(PostProcess *post_processing, const char *path)
Definition: postprocess.c:1535
float postprocess_get_exposure(PostProcess *post_processing)
Definition: postprocess.c:563
void postprocess_set_dof_anamorphic(PostProcess *post_processing, float anamorphic_ratio)
Definition: postprocess.c:556
@ SHADER_CACHE_SIZE
Definition: postprocess.h:244
void postprocess_set_vignette(PostProcess *post_processing, float intensity, float smoothness, float roundness)
Definition: postprocess.c:476
void postprocess_update_time(PostProcess *post_processing, float delta_time)
Increments internal clocks.
Definition: postprocess.c:1028
void postprocess_resize(PostProcess *post_processing, int width, int height)
Recreates all internal buffers for a new resolution.
Definition: postprocess.c:358
void postprocess_set_fxaa(PostProcess *post_processing, float subpix, float edge_threshold, float edge_threshold_min)
Definition: postprocess.c:586
void postprocess_set_exposure_target(PostProcess *post_processing, float threshold)
Updates the target exposure threshold for AE.
Definition: postprocess.c:1100
void postprocess_compile_optimized(PostProcess *post_processing, unsigned int static_flags)
Compiles a specialized Uber-shader for maximum performance.
Definition: postprocess.c:1436
int postprocess_is_enabled(PostProcess *post_processing, PostProcessEffect effect)
Returns true if an effect is currently active.
Definition: postprocess.c:470
High-level OpenGL shader management with metadata and uniform caching.
Controls for color banding/quantization.
Definition: postprocess.h:216
float dither_strength
Definition: postprocess.h:219
float perceptual_gamma
Definition: postprocess.h:220
vec3 channel_levels
Definition: postprocess.h:221
int32_t mode
Definition: postprocess.h:217
float levels
Definition: postprocess.h:218
Focal-length distortion simulation.
Definition: postprocess.h:164
float strength
Definition: postprocess.h:165
Unreal-style color grading parameters.
Definition: postprocess.h:119
float saturation
Definition: postprocess.h:120
float lift
Definition: postprocess.h:125
float gamma
Definition: postprocess.h:122
float gain
Definition: postprocess.h:123
float contrast
Definition: postprocess.h:121
float offset
Definition: postprocess.h:124
Manual exposure tuning.
Definition: postprocess.h:156
float exposure
Definition: postprocess.h:157
Parameters for Fast Approximate Anti-Aliasing.
Definition: postprocess.h:193
float edge_threshold_min
Definition: postprocess.h:196
float edge_threshold
Definition: postprocess.h:195
float subpix
Definition: postprocess.h:194
Depth-based atmospheric fog parameters.
Definition: postprocess.h:228
float density
Definition: postprocess.h:229
float height_falloff
Definition: postprocess.h:231
float start
Definition: postprocess.h:230
Manages GPU timing using double-buffered queries to avoid stalls.
Definition: gpu_profiler.h:86
Fine-grained controls for film noise.
Definition: postprocess.h:142
float intensity_highlights
Definition: postprocess.h:146
float shadows_max
Definition: postprocess.h:147
float intensity_midtones
Definition: postprocess.h:145
float highlights_min
Definition: postprocess.h:148
float intensity
Definition: postprocess.h:143
float intensity_shadows
Definition: postprocess.h:144
float texel_size
Definition: postprocess.h:149
Snapshot of every configurable parameter in the pipeline.
Definition: postprocess.h:556
DoFParams dof
Definition: postprocess.h:566
BloomParams bloom
Definition: postprocess.h:565
TonemapParams tonemapper
Definition: postprocess.h:564
WhiteBalanceParams white_balance
Definition: postprocess.h:562
BandingParams banding
Definition: postprocess.h:568
ExposureParams exposure
Definition: postprocess.h:560
unsigned int active_effects
Definition: postprocess.h:557
VignetteParams vignette
Definition: postprocess.h:558
ColorGradingParams color_grading
Definition: postprocess.h:563
ChromAbberationParams chrom_abbr
Definition: postprocess.h:561
FXAAParams fxaa
Definition: postprocess.h:567
FogParams fog
Definition: postprocess.h:569
GrainParams grain
Definition: postprocess.h:559
LUT3DParams lut3d
Definition: postprocess.h:570
Shared Uniform Buffer structure for shaders.
Definition: postprocess.h:251
float tonemap_slope
Definition: postprocess.h:295
float fog_height_falloff
Definition: postprocess.h:337
float fxaa_quality_edge_threshold_min
Definition: postprocess.h:323
float _pad13
Definition: postprocess.h:340
float grain_texel_size
Definition: postprocess.h:269
float grain_intensity
Definition: postprocess.h:263
float vignette_intensity
Definition: postprocess.h:257
float dof_focal_distance
Definition: postprocess.h:309
float exposure_manual
Definition: postprocess.h:273
float banding_perceptual_gamma
Definition: postprocess.h:330
float fxaa_quality_subpix
Definition: postprocess.h:321
float bloom_radius
Definition: postprocess.h:306
float dof_anamorphic_ratio
Definition: postprocess.h:312
float grading_lift
Definition: postprocess.h:291
float tonemap_toe
Definition: postprocess.h:296
float grain_highlights_min
Definition: postprocess.h:268
float banding_levels
Definition: postprocess.h:328
float bloom_soft_threshold
Definition: postprocess.h:305
uint32_t active_effects
Definition: postprocess.h:252
float tonemap_white_clip
Definition: postprocess.h:299
float fxaa_quality_edge_threshold
Definition: postprocess.h:322
float grading_gamma
Definition: postprocess.h:288
float lut3d_intensity
Definition: postprocess.h:343
float dof_focal_range
Definition: postprocess.h:310
float _pad9
Definition: postprocess.h:318
float _pad1
Definition: postprocess.h:260
float grain_shadows_max
Definition: postprocess.h:267
float fog_start
Definition: postprocess.h:336
int32_t banding_mode
Definition: postprocess.h:327
float _pad12
Definition: postprocess.h:338
float grading_contrast
Definition: postprocess.h:287
float tonemap_black_clip
Definition: postprocess.h:298
float grain_intensity_shadows
Definition: postprocess.h:264
float banding_dither_strength
Definition: postprocess.h:329
float tonemap_shoulder
Definition: postprocess.h:297
float vignette_smoothness
Definition: postprocess.h:258
float wb_tint
Definition: postprocess.h:282
float grading_saturation
Definition: postprocess.h:286
float _pad10
Definition: postprocess.h:324
float wb_temperature
Definition: postprocess.h:281
float mb_max_velocity
Definition: postprocess.h:316
float grading_offset
Definition: postprocess.h:290
float fog_density
Definition: postprocess.h:335
float bloom_intensity
Definition: postprocess.h:303
vec3 fog_color
Definition: postprocess.h:339
int32_t mb_samples
Definition: postprocess.h:317
float _pad2
Definition: postprocess.h:270
float _pad11
Definition: postprocess.h:332
float bloom_threshold
Definition: postprocess.h:304
float grain_intensity_highlights
Definition: postprocess.h:266
float mb_intensity
Definition: postprocess.h:315
float grading_gain
Definition: postprocess.h:289
float time
Definition: postprocess.h:253
float vignette_roundness
Definition: postprocess.h:259
float grain_intensity_midtones
Definition: postprocess.h:265
float chrom_abbr_strength
Definition: postprocess.h:277
float dof_bokeh_scale
Definition: postprocess.h:311
Main pipeline state for post-processing.
Definition: postprocess.h:353
int height
Definition: postprocess.h:381
GLuint scene_stencil_view
Definition: postprocess.h:359
FogParams fog
Definition: postprocess.h:399
GLsync exposure_sync[2]
Definition: postprocess.h:425
int last_histogram_updated
Definition: postprocess.h:437
GLuint histogram_pbo[2]
Definition: postprocess.h:423
GLsync histogram_sync[2]
Definition: postprocess.h:427
int banding_preset_idx
Definition: postprocess.h:418
unsigned int active_effects
Definition: postprocess.h:383
Shader * neighbor_max_shader
Definition: postprocess.h:378
AutoExposureFX auto_exposure_fx
Definition: postprocess.h:364
ExposureParams exposure
Definition: postprocess.h:388
GLuint scene_fbo
Definition: postprocess.h:355
Shader * tile_max_shader
Definition: postprocess.h:377
DoFFX dof_fx
Definition: postprocess.h:363
float auto_threshold
Definition: postprocess.h:431
int width
Definition: postprocess.h:380
bool ubo_dirty
Definition: postprocess.h:409
Shader * postprocess_shader
Definition: postprocess.h:376
GLuint dummy_black_tex
Definition: postprocess.h:404
GLuint velocity_tex
Definition: postprocess.h:357
GLuint dummy_uint_tex
Definition: postprocess.h:405
AutoExposureParams auto_exposure
Definition: postprocess.h:395
int last_buckets[256]
Definition: postprocess.h:434
TonemapParams tonemapper
Definition: postprocess.h:392
LUTVizFX lut_viz_fx
Definition: postprocess.h:367
ChromAbberationParams chrom_abbr
Definition: postprocess.h:389
LUT3DFX lut3d_fx
Definition: postprocess.h:366
float current_exposure
Definition: postprocess.h:430
uint64_t frame_count
Definition: postprocess.h:439
GLuint screen_quad_vbo
Definition: postprocess.h:371
LUT3DParams lut3d
Definition: postprocess.h:400
WhiteBalanceParams white_balance
Definition: postprocess.h:390
DoFParams dof
Definition: postprocess.h:394
int shader_cache_count
Definition: postprocess.h:415
FXAAParams fxaa
Definition: postprocess.h:397
GLuint settings_ubo
Definition: postprocess.h:373
GrainParams grain
Definition: postprocess.h:387
MotionBlurParams motion_blur
Definition: postprocess.h:396
unsigned int compiled_flags
Definition: postprocess.h:412
GLuint exposure_pbo[2]
Definition: postprocess.h:422
GPUProfiler * gpu_profiler
Definition: postprocess.h:417
BloomFX bloom_fx
Definition: postprocess.h:362
BloomParams bloom
Definition: postprocess.h:393
GLuint scene_color_tex
Definition: postprocess.h:356
ShaderCacheEntry shader_cache[SHADER_CACHE_SIZE]
Definition: postprocess.h:414
float last_min_lum
Definition: postprocess.h:435
VignetteParams vignette
Definition: postprocess.h:386
GLuint screen_quad_vao
Definition: postprocess.h:370
GLuint scene_depth_tex
Definition: postprocess.h:358
bool is_optimized
Definition: postprocess.h:407
BandingParams banding
Definition: postprocess.h:398
MotionBlurFX motion_blur_fx
Definition: postprocess.h:365
float delta_time
Definition: postprocess.h:403
float time
Definition: postprocess.h:402
ColorGradingParams color_grading
Definition: postprocess.h:391
float last_max_lum
Definition: postprocess.h:436
Cache entry for optimized shaders.
Definition: postprocess.h:239
Shader * shader
Definition: postprocess.h:241
unsigned int flags
Definition: postprocess.h:240
Wrapper for an OpenGL program with uniform caching and automatic cleanup.
Definition: shader.h:71
ACES-like filmic tonemapping curve parameters.
Definition: postprocess.h:181
float white_clip
Definition: postprocess.h:186
float black_clip
Definition: postprocess.h:185
float toe
Definition: postprocess.h:183
float slope
Definition: postprocess.h:182
float shoulder
Definition: postprocess.h:184
Controls for the screen-edge darkening effect.
Definition: postprocess.h:132
float smoothness
Definition: postprocess.h:134
float roundness
Definition: postprocess.h:135
float intensity
Definition: postprocess.h:133
Temperature and tint correction.
Definition: postprocess.h:172
float tint
Definition: postprocess.h:174
float temperature
Definition: postprocess.h:173