1 #ifndef POSTPROCESS_INTERNAL_H
2 #define POSTPROCESS_INTERNAL_H
12 #include "effects/fx_auto_exposure.h"
13 #include "effects/fx_bloom.h"
14 #include "effects/fx_dof.h"
15 #include "effects/fx_lut3d.h"
16 #include "effects/fx_lut_viz.h"
17 #include "effects/fx_motion_blur.h"
26 #include <cglm/types.h>
30 #define DEFAULT_BLOOM_INTENSITY 0.0F
31 #define DEFAULT_BLOOM_THRESHOLD 1.0F
32 #define DEFAULT_BLOOM_SOFT_THRESHOLD 0.5F
33 #define DEFAULT_BLOOM_RADIUS 1.0F
36 #define DEFAULT_DOF_FOCAL_DISTANCE 20.0F
37 #define DEFAULT_DOF_FOCAL_RANGE 5.0F
38 #define DEFAULT_DOF_BOKEH_SCALE 10.0F
39 #define DEFAULT_DOF_ANAMORPHIC_RATIO \
Public API for the post-processing pipeline.
void pp_destroy_screen_quad(PostProcess *post_processing)
Definition: postprocess_cleanup.c:28
void pp_update_current_shader(PostProcess *post_processing, Shader *new_shader, bool is_optimized)
Definition: postprocess_shader.c:41
int pp_create_framebuffer(PostProcess *post_processing)
Definition: postprocess_init.c:12
void pp_destroy_cached_shaders(PostProcess *post_processing)
Definition: postprocess_cleanup.c:54
void pp_destroy_readback_buffers(PostProcess *post_processing)
Definition: postprocess_cleanup.c:34
bool pp_is_shader_in_cache(PostProcess *post_processing, Shader *shader)
Definition: postprocess_shader.c:6
void pp_setup_sampler_uniforms(PostProcess *post_processing)
Definition: postprocess_shader.c:19
@ POSTPROCESS_TEX_UNIT_STENCIL
Definition: postprocess_internal.h:124
@ POSTPROCESS_TEX_UNIT_DOF_BLUR
Definition: postprocess_internal.h:123
@ POSTPROCESS_TEX_UNIT_DEPTH
Definition: postprocess_internal.h:119
@ POSTPROCESS_TEX_UNIT_NEIGHBOR_MAX
Definition: postprocess_internal.h:122
@ POSTPROCESS_TEX_UNIT_VELOCITY
Definition: postprocess_internal.h:121
@ POSTPROCESS_TEX_UNIT_BLOOM
Definition: postprocess_internal.h:118
@ POSTPROCESS_TEX_UNIT_LUT3D
Definition: postprocess_internal.h:125
@ POSTPROCESS_TEX_UNIT_EXPOSURE
Definition: postprocess_internal.h:120
@ POSTPROCESS_TEX_UNIT_SCENE
Definition: postprocess_internal.h:117
void pp_destroy_framebuffer(PostProcess *post_processing)
Definition: postprocess_cleanup.c:11
Async GPU readback state for exposure and histogram.
GPU resource handles for the post-processing pipeline.
Parameter structs and defaults for uber-shader post-processing effects.
Shader management state for the optimized uber-shader pipeline.
GPU-side Uniform Buffer Object layout for the post-processing uber-shader.
High-level OpenGL shader management with metadata and uniform caching.
Controls for color banding/quantization.
Definition: pp_params.h:158
Focal-length distortion simulation.
Definition: pp_params.h:106
Unreal-style color grading parameters.
Definition: pp_params.h:61
Manual exposure tuning.
Definition: pp_params.h:98
Parameters for Fast Approximate Anti-Aliasing.
Definition: pp_params.h:135
Depth-based atmospheric fog parameters.
Definition: pp_params.h:170
Manages GPU timing using double-buffered queries to avoid stalls.
Definition: gpu_profiler.h:86
Fine-grained controls for film noise.
Definition: pp_params.h:84
Async GPU readback state for exposure and histogram.
Definition: pp_exposure_readback.h:18
GPU handles for the post-processing pipeline (FBOs, textures, UBO).
Definition: pp_gpu_resources.h:15
Shader management state for the optimized uber-shader pipeline.
Definition: pp_shader_state.h:28
Snapshot of every configurable parameter in the pipeline.
Definition: postprocess_internal.h:98
DoFParams dof
Definition: postprocess_internal.h:108
BloomParams bloom
Definition: postprocess_internal.h:107
TonemapParams tonemapper
Definition: postprocess_internal.h:106
WhiteBalanceParams white_balance
Definition: postprocess_internal.h:104
BandingParams banding
Definition: postprocess_internal.h:110
ExposureParams exposure
Definition: postprocess_internal.h:102
unsigned int active_effects
Definition: postprocess_internal.h:99
VignetteParams vignette
Definition: postprocess_internal.h:100
ColorGradingParams color_grading
Definition: postprocess_internal.h:105
ChromAbberationParams chrom_abbr
Definition: postprocess_internal.h:103
FXAAParams fxaa
Definition: postprocess_internal.h:109
FogParams fog
Definition: postprocess_internal.h:111
GrainParams grain
Definition: postprocess_internal.h:101
LUT3DParams lut3d
Definition: postprocess_internal.h:112
Main pipeline state for post-processing.
Definition: postprocess_internal.h:46
int height
Definition: postprocess_internal.h:62
FogParams fog
Definition: postprocess_internal.h:80
PPShaderState shaders
Definition: postprocess_internal.h:59
PPGPUResources gpu
Definition: postprocess_internal.h:48
int banding_preset_idx
Definition: postprocess_internal.h:88
unsigned int active_effects
Definition: postprocess_internal.h:64
AutoExposureFX auto_exposure_fx
Definition: postprocess_internal.h:53
ExposureParams exposure
Definition: postprocess_internal.h:69
DoFFX dof_fx
Definition: postprocess_internal.h:52
int width
Definition: postprocess_internal.h:61
bool ubo_dirty
Definition: postprocess_internal.h:85
AutoExposureParams auto_exposure
Definition: postprocess_internal.h:76
TonemapParams tonemapper
Definition: postprocess_internal.h:73
LUTVizFX lut_viz_fx
Definition: postprocess_internal.h:56
ChromAbberationParams chrom_abbr
Definition: postprocess_internal.h:70
LUT3DFX lut3d_fx
Definition: postprocess_internal.h:55
LUT3DParams lut3d
Definition: postprocess_internal.h:81
WhiteBalanceParams white_balance
Definition: postprocess_internal.h:71
DoFParams dof
Definition: postprocess_internal.h:75
FXAAParams fxaa
Definition: postprocess_internal.h:78
GrainParams grain
Definition: postprocess_internal.h:68
MotionBlurParams motion_blur
Definition: postprocess_internal.h:77
GPUProfiler * gpu_profiler
Definition: postprocess_internal.h:87
BloomFX bloom_fx
Definition: postprocess_internal.h:51
BloomParams bloom
Definition: postprocess_internal.h:74
VignetteParams vignette
Definition: postprocess_internal.h:67
PPExposureReadback readback
Definition: postprocess_internal.h:91
BandingParams banding
Definition: postprocess_internal.h:79
MotionBlurFX motion_blur_fx
Definition: postprocess_internal.h:54
float delta_time
Definition: postprocess_internal.h:84
float time
Definition: postprocess_internal.h:83
ColorGradingParams color_grading
Definition: postprocess_internal.h:72
Wrapper for an OpenGL program with uniform caching and automatic cleanup.
Definition: shader.h:71
ACES-like filmic tonemapping curve parameters.
Definition: pp_params.h:123
Controls for the screen-edge darkening effect.
Definition: pp_params.h:74
Temperature and tint correction.
Definition: pp_params.h:114