$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
postprocess_internal.h File Reference

PostProcess struct definition and internal helpers. More...

#include "effects/fx_auto_exposure.h"
#include "effects/fx_bloom.h"
#include "effects/fx_dof.h"
#include "effects/fx_lut3d.h"
#include "effects/fx_lut_viz.h"
#include "effects/fx_motion_blur.h"
#include "gpu_profiler.h"
#include "postprocess.h"
#include "pp_exposure_readback.h"
#include "pp_gpu_resources.h"
#include "pp_params.h"
#include "pp_shader_state.h"
#include "pp_ubo.h"
#include "shader.h"
#include <cglm/types.h>
#include <stdbool.h>
Include dependency graph for postprocess_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PostProcess
 Main pipeline state for post-processing. More...
 
struct  PostProcessPreset
 Snapshot of every configurable parameter in the pipeline. More...
 

Macros

#define DEFAULT_BLOOM_INTENSITY   0.0F
 
#define DEFAULT_BLOOM_THRESHOLD   1.0F
 
#define DEFAULT_BLOOM_SOFT_THRESHOLD   0.5F
 
#define DEFAULT_BLOOM_RADIUS   1.0F
 
#define DEFAULT_DOF_FOCAL_DISTANCE   20.0F
 
#define DEFAULT_DOF_FOCAL_RANGE   5.0F
 
#define DEFAULT_DOF_BOKEH_SCALE   10.0F
 
#define DEFAULT_DOF_ANAMORPHIC_RATIO    1.0F
 

Enumerations

enum  {
  POSTPROCESS_TEX_UNIT_SCENE = 0 , POSTPROCESS_TEX_UNIT_BLOOM = 1 , POSTPROCESS_TEX_UNIT_DEPTH = 2 , POSTPROCESS_TEX_UNIT_EXPOSURE = 3 ,
  POSTPROCESS_TEX_UNIT_VELOCITY = 4 , POSTPROCESS_TEX_UNIT_NEIGHBOR_MAX = 5 , POSTPROCESS_TEX_UNIT_DOF_BLUR = 6 , POSTPROCESS_TEX_UNIT_STENCIL = 7 ,
  POSTPROCESS_TEX_UNIT_LUT3D = 8
}
 

Functions

void pp_destroy_framebuffer (PostProcess *post_processing)
 
void pp_destroy_screen_quad (PostProcess *post_processing)
 
void pp_destroy_readback_buffers (PostProcess *post_processing)
 
void pp_destroy_cached_shaders (PostProcess *post_processing)
 
bool pp_is_shader_in_cache (PostProcess *post_processing, Shader *shader)
 
int pp_create_framebuffer (PostProcess *post_processing)
 
void pp_setup_sampler_uniforms (PostProcess *post_processing)
 
void pp_update_current_shader (PostProcess *post_processing, Shader *new_shader, bool is_optimized)
 

Detailed Description

PostProcess struct definition and internal helpers.

Include this header when you need access to PostProcess struct members. For the public lifecycle/render API only, include postprocess.h instead.

Macro Definition Documentation

◆ DEFAULT_BLOOM_INTENSITY

#define DEFAULT_BLOOM_INTENSITY   0.0F

◆ DEFAULT_BLOOM_RADIUS

#define DEFAULT_BLOOM_RADIUS   1.0F

◆ DEFAULT_BLOOM_SOFT_THRESHOLD

#define DEFAULT_BLOOM_SOFT_THRESHOLD   0.5F

◆ DEFAULT_BLOOM_THRESHOLD

#define DEFAULT_BLOOM_THRESHOLD   1.0F

◆ DEFAULT_DOF_ANAMORPHIC_RATIO

#define DEFAULT_DOF_ANAMORPHIC_RATIO    1.0F

1.0 = Spherical, 2.0 = Anamorphic

◆ DEFAULT_DOF_BOKEH_SCALE

#define DEFAULT_DOF_BOKEH_SCALE   10.0F

◆ DEFAULT_DOF_FOCAL_DISTANCE

#define DEFAULT_DOF_FOCAL_DISTANCE   20.0F

◆ DEFAULT_DOF_FOCAL_RANGE

#define DEFAULT_DOF_FOCAL_RANGE   5.0F

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
POSTPROCESS_TEX_UNIT_SCENE 
POSTPROCESS_TEX_UNIT_BLOOM 
POSTPROCESS_TEX_UNIT_DEPTH 
POSTPROCESS_TEX_UNIT_EXPOSURE 
POSTPROCESS_TEX_UNIT_VELOCITY 
POSTPROCESS_TEX_UNIT_NEIGHBOR_MAX 
POSTPROCESS_TEX_UNIT_DOF_BLUR 
POSTPROCESS_TEX_UNIT_STENCIL 
POSTPROCESS_TEX_UNIT_LUT3D 

Function Documentation

◆ pp_create_framebuffer()

int pp_create_framebuffer ( PostProcess *  post_processing)

Create the main scene FBO with color, velocity, depth/stencil.

Here is the call graph for this function:

◆ pp_destroy_cached_shaders()

void pp_destroy_cached_shaders ( PostProcess *  post_processing)

Destroy all cached shader variants.

◆ pp_destroy_framebuffer()

void pp_destroy_framebuffer ( PostProcess *  post_processing)

Destroy the main scene FBO and its attachments.

Here is the call graph for this function:

◆ pp_destroy_readback_buffers()

void pp_destroy_readback_buffers ( PostProcess *  post_processing)

Destroy PBO readback buffers and sync objects.

◆ pp_destroy_screen_quad()

void pp_destroy_screen_quad ( PostProcess *  post_processing)

Destroy the fullscreen quad VAO/VBO.

◆ pp_is_shader_in_cache()

bool pp_is_shader_in_cache ( PostProcess *  post_processing,
Shader *  shader 
)

Check whether a shader is in the variant cache.

◆ pp_setup_sampler_uniforms()

void pp_setup_sampler_uniforms ( PostProcess *  post_processing)

Bind sampler uniforms to texture units on the current shader.

Here is the call graph for this function:

◆ pp_update_current_shader()

void pp_update_current_shader ( PostProcess *  post_processing,
Shader *  new_shader,
bool  is_optimized 
)

Update the active shader, destroying the old one if not cached.

Here is the call graph for this function: