1#ifndef NNGN_GRAPHICS_OPENGL_POST_H
2#define NNGN_GRAPHICS_OPENGL_POST_H
100 std::bit_floor(
s.x) >> 1,
101 std::bit_floor(
s.y) >> 1,
103 this->
flags.
set(Flag::SIZE_UPDATED);
124 this->
flags.
set(Flag::BLOOM_SCALE_UPDATED);
128 this->
blur_scale = 1.0f /
static_cast<float>(d);
129 this->
flags.
set(Flag::BLUR_SCALE_UPDATED);
Post-processing operations.
Definition post.h:16
GLTexArray luminance_res_tex
Definition post.h:81
GLFrameBuffer luminance_fb1
Definition post.h:86
int HDR_mix_loc
Definition post.h:90
bool bloom() const
Definition post.cpp:260
uvec2 half_size
Definition post.h:93
bool init()
Single-step, swap-chain-independent initialization.
Definition post.cpp:19
float bloom_blur_size
Definition post.h:66
VAO blur_vao
Definition post.h:91
int bloom_threshold_loc
Definition post.h:89
float bloom_threshold
Definition post.h:65
uvec2 size
Definition post.h:93
float bloom_scale
Definition post.h:63
void set_HDR_mix(float m)
Definition post.h:34
void set_bloom_blur_size(float n)
Definition post.h:28
VAO hdr_vao
Definition post.h:91
float exposure
Definition post.h:62
GLProgram hdr_prog
Definition post.h:77
int exposure_scale_loc
Definition post.h:90
GLTexArray luminance_last_tex
Definition post.h:81
GLFrameBuffer luminance_res_fb
Definition post.h:86
bool render()
Renders all enabled steps.
Definition post.cpp:204
bool bind_frame_buffer()
Binds the appropriate frame buffer according to the configuration.
Definition post.h:132
GLBuffer vbo
Definition post.h:92
GLFrameBuffer blur_fb1
Definition post.h:87
bool blur_enabled() const
Definition post.h:118
GLFrameBuffer blur_fb0
Definition post.h:87
bool blur() const
Definition post.cpp:296
int bloom_amount_loc
Definition post.h:89
GLTexArray blur_tex0
Definition post.h:82
bool update()
Updates resources as necessary.
Definition post.cpp:127
VAO luminance_vao
Definition post.h:91
float blur_size
Definition post.h:71
void set_bloom_blur_passes(std::size_t n)
Definition post.h:29
@ BLUR_SCALE_UPDATED
Definition post.h:50
@ SIZE_UPDATED
Definition post.h:48
@ AUTOMATIC_EXPOSURE
Definition post.h:47
@ BLOOM_SCALE_UPDATED
Definition post.h:49
float blur_scale
Definition post.h:69
uvec2 rounded_half_size
Definition post.h:93
void set_blur_size(float n)
Definition post.h:32
GLProgram luminance_prog
Definition post.h:74
GLTexArray blur_tex1
Definition post.h:82
bool set_automatic_exposure(bool b)
Definition post.cpp:190
bool enabled() const
Definition post.h:106
void set_bloom_downscale(std::size_t d)
Definition post.h:122
GLTexArray bloom_blur_tex0
Definition post.h:83
GLBuffer ebo
Definition post.h:92
GLTexArray depth_tex
Definition post.h:79
GLProgram blur_prog
Definition post.h:76
int blur_dir_loc
Definition post.h:89
std::size_t bloom_blur_passes
Definition post.h:67
void set_bloom_threshold(float t)
Definition post.h:27
VAO bloom_filter_vao
Definition post.h:91
GLFrameBuffer bloom_blur_fb0
Definition post.h:88
GLTexArray luminance_tex1
Definition post.h:80
bool bloom_enabled() const
Definition post.h:114
void set_exposure(float e)
Definition post.h:25
bool destroy()
Releases all resources.
Definition post.cpp:103
GLFrameBuffer luminance_fb0
Definition post.h:86
GLFrameBuffer color_fb
Definition post.h:85
void set_bloom_amount(float a)
Definition post.h:30
GLFrameBuffer bloom_blur_fb1
Definition post.h:88
GLProgram bloom_prog
Definition post.h:75
float HDR_mix
Definition post.h:73
GLTexArray color_tex
Definition post.h:79
GLTexArray bloom_blur_tex1
Definition post.h:83
void resize(uvec2 size)
Signals that the frame buffer has been resized.
Definition post.h:96
void set_blur_downscale(std::size_t d)
Definition post.h:127
bool HDR() const
Definition post.cpp:335
GLTexArray luminance_tex0
Definition post.h:80
std::size_t blur_passes
Definition post.h:72
bool calc_avg_luminance()
Definition post.cpp:211
bool HDR_enabled() const
Definition post.h:110
Flags< Flag > flags
Definition post.h:61
float bloom_amount
Definition post.h:68
bool resize_frame_buffers()
void set_blur_passes(std::size_t n)
Definition post.h:33
u32 id() const
Definition handle.h:24
local n
Definition dump_lights.lua:5
#define NNGN_LOG_CONTEXT_CF(c)
Definition log.h:11
std::uint8_t u8
Definition def.h:12
#define LOG_RESULT(f,...)
Definition opencl.cpp:264
Wrapper for a small unsigned integral representing flags.
Definition flags.h:18
constexpr Flags & set(AT a)
Definition flags.h:47
static constexpr std::size_t DEFAULT_BLOOM_DOWNSCALE
Definition graphics.h:273
static constexpr float DEFAULT_BLOOM_THRESHOLD
Definition graphics.h:270
static constexpr float DEFAULT_BLOOM_BLUR_SIZE
Definition graphics.h:271
static constexpr float DEFAULT_EXPOSURE
Definition graphics.h:269
static constexpr std::size_t DEFAULT_BLOOM_BLUR_PASSES
Definition graphics.h:275
static constexpr std::size_t DEFAULT_BLUR_DOWNSCALE
Definition graphics.h:274
local e
Definition math.lua:4
std::chrono::seconds s
Definition timing.cpp:6