46 const SceneEEVEE &sce_eevee = inst_.scene->eevee;
47 const Object *camera_object_eval = inst_.camera_eval_object;
48 const ::Camera *camera = (camera_object_eval && camera_object_eval->
type ==
OB_CAMERA) ?
49 reinterpret_cast<const ::
Camera *
>(camera_object_eval->
data) :
54 if (enabled_ ==
false) {
56 data_.scatter_color_threshold = -1.0f;
60 int sce_flag = sce_eevee.
flag;
66 data_.bokeh_blades = float(camera->dof.aperture_blades);
71 const Camera &camera = inst_.camera;
72 const Object *camera_object_eval = inst_.camera_eval_object;
73 const ::Camera *camera_data = (camera_object_eval && camera_object_eval->
type ==
OB_CAMERA) ?
74 reinterpret_cast<const ::
Camera *
>(camera_object_eval->
data) :
80 "Debug Mode: Depth Of Field Buffers\n"
81 " - Purple: Gap Fill\n"
82 " - Blue: Background\n"
83 " - Red: Slight Out Of Focus\n"
84 " - Yellow: In Focus\n"
85 " - Green: Foreground\n");
88 if (enabled_ ==
false) {
89 jitter_radius_ = 0.0f;
94 float2 anisotropic_scale = {
clamp_f(1.0f / camera_data->dof.aperture_ratio, 1e-5f, 1.0f),
95 clamp_f(camera_data->dof.aperture_ratio, 1e-5f, 1.0f)};
96 data_.bokeh_anisotropic_scale = anisotropic_scale;
97 data_.bokeh_rotation = camera_data->dof.aperture_rotation;
99 data_.bokeh_anisotropic_scale_inv = 1.0f / data_.bokeh_anisotropic_scale;
101 float fstop =
max_ff(camera_data->dof.aperture_fstop, 1e-5f);
103 float aperture = 1.0f / (2.0f * fstop);
105 aperture *= camera_data->lens * 1e-3f;
118 if (camera_data->dof.aperture_ratio < 1.0) {
121 aperture /=
max_ff(camera_data->dof.aperture_ratio, 1e-5f);
124 float jitter_radius, fx_radius;
127 if (do_jitter_ && (inst_.sampling.dof_ring_count_get() > 0) && !camera.
is_panoramic() &&
128 !inst_.is_viewport())
133 float minimal_overblur = 1.0f /
sqrtf(inst_.sampling.dof_sample_count_get());
135 fx_radius = (minimal_overblur + user_overblur_) * aperture;
137 jitter_radius =
max_ff(0.0f, aperture - fx_radius);
140 jitter_radius = 0.0f;
141 fx_radius = aperture;
145 if (fx_max_coc_ <= 0.5f) {
149 jitter_radius_ = jitter_radius;
150 fx_radius_ = fx_radius;
152 if (fx_radius_ == 0.0f) {
157 int2 max_render_res = inst_.film.render_extent_get();
161 data_.gather_uv_fac = 1.0f /
float2(reduce_size);
170 reduced_color_tx_.ensure_mip_views();
171 reduced_coc_tx_.ensure_mip_views();
175 data_.scatter_max_rect = (reduced_color_tx_.pixel_count() / 4) / 2;
176 scatter_fg_list_buf_.resize(data_.scatter_max_rect);
177 scatter_bg_list_buf_.resize(data_.scatter_max_rect);
179 bokeh_lut_pass_sync();
181 stabilize_pass_sync();
182 downsample_pass_sync();
184 tiles_flatten_pass_sync();
185 tiles_dilate_pass_sync();
189 hole_fill_pass_sync();
195 if (jitter_radius_ == 0.0f) {
200 inst_.sampling.dof_disk_sample_get(&radius, &theta);
202 if (data_.bokeh_blades >= 3.0f) {
206 radius *= jitter_radius_;
207 theta += data_.bokeh_rotation;
211 sample *= data_.bokeh_anisotropic_scale;
218 const bool is_ortho = (winmat[2][3] != -1.0f);
220 sample *= focus_distance_;
234void DepthOfField::bokeh_lut_pass_sync()
239 use_bokeh_lut_ =
false;
242 use_bokeh_lut_ =
true;
245 bokeh_lut_ps_.
init();
247 bokeh_lut_ps_.
bind_ubo(
"dof_buf", data_);
248 bokeh_lut_ps_.
bind_image(
"out_gather_lut_img", &bokeh_gather_lut_tx_);
249 bokeh_lut_ps_.
bind_image(
"out_scatter_lut_img", &bokeh_scatter_lut_tx_);
250 bokeh_lut_ps_.
bind_image(
"out_resolve_lut_img", &bokeh_resolve_lut_tx_);
254void DepthOfField::setup_pass_sync()
262 setup_ps_.
bind_ubo(
"dof_buf", data_);
263 setup_ps_.
bind_image(
"out_color_img", &setup_color_tx_);
264 setup_ps_.
bind_image(
"out_coc_img", &setup_coc_tx_);
265 setup_ps_.
dispatch(&dispatch_setup_size_);
269void DepthOfField::stabilize_pass_sync()
271 RenderBuffers &render_buffers = inst_.render_buffers;
272 VelocityModule &velocity = inst_.velocity;
274 stabilize_ps_.init();
275 stabilize_ps_.shader_set(inst_.shaders.static_shader_get(
DOF_STABILIZE));
276 stabilize_ps_.bind_ubo(
"camera_prev", &(*velocity.camera_steps[
STEP_PREVIOUS]));
277 stabilize_ps_.bind_ubo(
"camera_curr", &(*velocity.camera_steps[
STEP_CURRENT]));
279 stabilize_ps_.bind_ubo(
"camera_next", &(*velocity.camera_steps[
STEP_PREVIOUS]));
280 stabilize_ps_.bind_texture(
"coc_tx", &setup_coc_tx_,
no_filter);
281 stabilize_ps_.bind_texture(
"color_tx", &setup_color_tx_,
no_filter);
282 stabilize_ps_.bind_texture(
"velocity_tx", &render_buffers.vector_tx,
no_filter);
283 stabilize_ps_.bind_texture(
"in_history_tx", &stabilize_input_,
with_filter);
284 stabilize_ps_.bind_texture(
"depth_tx", &render_buffers.depth_tx,
no_filter);
285 stabilize_ps_.bind_ubo(
"dof_buf", data_);
286 stabilize_ps_.push_constant(
"u_use_history", &stabilize_valid_history_, 1);
287 stabilize_ps_.bind_image(
"out_coc_img", reduced_coc_tx_.mip_view(0));
288 stabilize_ps_.bind_image(
"out_color_img", reduced_color_tx_.mip_view(0));
289 stabilize_ps_.bind_image(
"out_history_img", &stabilize_output_tx_);
290 stabilize_ps_.dispatch(&dispatch_stabilize_size_);
294void DepthOfField::downsample_pass_sync()
296 downsample_ps_.init();
297 downsample_ps_.shader_set(inst_.shaders.static_shader_get(
DOF_DOWNSAMPLE));
298 downsample_ps_.bind_texture(
"color_tx", reduced_color_tx_.mip_view(0),
no_filter);
299 downsample_ps_.bind_texture(
"coc_tx", reduced_coc_tx_.mip_view(0),
no_filter);
300 downsample_ps_.bind_image(
"out_color_img", &downsample_tx_);
301 downsample_ps_.dispatch(&dispatch_downsample_size_);
305void DepthOfField::reduce_pass_sync()
308 reduce_ps_.shader_set(inst_.shaders.static_shader_get(
DOF_REDUCE));
309 reduce_ps_.bind_ubo(
"dof_buf", data_);
310 reduce_ps_.bind_texture(
"downsample_tx", &downsample_tx_,
no_filter);
311 reduce_ps_.bind_ssbo(
"scatter_fg_list_buf", scatter_fg_list_buf_);
312 reduce_ps_.bind_ssbo(
"scatter_bg_list_buf", scatter_bg_list_buf_);
313 reduce_ps_.bind_ssbo(
"scatter_fg_indirect_buf", scatter_fg_indirect_buf_);
314 reduce_ps_.bind_ssbo(
"scatter_bg_indirect_buf", scatter_bg_indirect_buf_);
315 reduce_ps_.bind_image(
"inout_color_lod0_img", reduced_color_tx_.mip_view(0));
316 reduce_ps_.bind_image(
"out_color_lod1_img", reduced_color_tx_.mip_view(1));
317 reduce_ps_.bind_image(
"out_color_lod2_img", reduced_color_tx_.mip_view(2));
318 reduce_ps_.bind_image(
"out_color_lod3_img", reduced_color_tx_.mip_view(3));
319 reduce_ps_.bind_image(
"in_coc_lod0_img", reduced_coc_tx_.mip_view(0));
320 reduce_ps_.bind_image(
"out_coc_lod1_img", reduced_coc_tx_.mip_view(1));
321 reduce_ps_.bind_image(
"out_coc_lod2_img", reduced_coc_tx_.mip_view(2));
322 reduce_ps_.bind_image(
"out_coc_lod3_img", reduced_coc_tx_.mip_view(3));
323 reduce_ps_.dispatch(&dispatch_reduce_size_);
328void DepthOfField::tiles_flatten_pass_sync()
330 tiles_flatten_ps_.init();
331 tiles_flatten_ps_.shader_set(inst_.shaders.static_shader_get(
DOF_TILES_FLATTEN));
335 tiles_flatten_ps_.bind_texture(
"coc_tx", &setup_coc_tx_,
no_filter);
336 tiles_flatten_ps_.bind_image(
"out_tiles_fg_img", &tiles_fg_tx_.current());
337 tiles_flatten_ps_.bind_image(
"out_tiles_bg_img", &tiles_bg_tx_.current());
338 tiles_flatten_ps_.dispatch(&dispatch_tiles_flatten_size_);
342void DepthOfField::tiles_dilate_pass_sync()
344 for (
int pass = 0; pass < 2; pass++) {
345 PassSimple &drw_pass = (pass == 0) ? tiles_dilate_minmax_ps_ : tiles_dilate_minabs_ps_;
348 drw_pass.shader_set(inst_.shaders.static_shader_get(sh_type));
349 drw_pass.bind_image(
"in_tiles_fg_img", &tiles_fg_tx_.previous());
350 drw_pass.bind_image(
"in_tiles_bg_img", &tiles_bg_tx_.previous());
351 drw_pass.bind_image(
"out_tiles_fg_img", &tiles_fg_tx_.current());
352 drw_pass.bind_image(
"out_tiles_bg_img", &tiles_bg_tx_.current());
353 drw_pass.push_constant(
"ring_count", &tiles_dilate_ring_count_, 1);
354 drw_pass.push_constant(
"ring_width_multiplier", &tiles_dilate_ring_width_mul_, 1);
355 drw_pass.dispatch(&dispatch_tiles_dilate_size_);
360void DepthOfField::gather_pass_sync()
366 for (
int pass = 0; pass < 2; pass++) {
367 PassSimple &drw_pass = (pass == 0) ? gather_fg_ps_ : gather_bg_ps_;
368 SwapChain<TextureFromPool, 2> &color_chain = (pass == 0) ? color_fg_tx_ : color_bg_tx_;
369 SwapChain<TextureFromPool, 2> &weight_chain = (pass == 0) ? weight_fg_tx_ : weight_bg_tx_;
375 drw_pass.bind_resources(inst_.sampling);
376 drw_pass.shader_set(inst_.shaders.static_shader_get(sh_type));
377 drw_pass.bind_ubo(
"dof_buf", data_);
378 drw_pass.bind_texture(
"color_bilinear_tx", reduced_color_tx_, gather_bilinear);
379 drw_pass.bind_texture(
"color_tx", reduced_color_tx_, gather_nearest);
380 drw_pass.bind_texture(
"coc_tx", reduced_coc_tx_, gather_nearest);
381 drw_pass.bind_image(
"in_tiles_fg_img", &tiles_fg_tx_.current());
382 drw_pass.bind_image(
"in_tiles_bg_img", &tiles_bg_tx_.current());
383 drw_pass.bind_image(
"out_color_img", &color_chain.current());
384 drw_pass.bind_image(
"out_weight_img", &weight_chain.current());
385 drw_pass.bind_image(
"out_occlusion_img", &occlusion_tx_);
386 drw_pass.bind_texture(
"bokeh_lut_tx", &bokeh_gather_lut_tx_);
387 drw_pass.dispatch(&dispatch_gather_size_);
392void DepthOfField::filter_pass_sync()
394 for (
int pass = 0; pass < 2; pass++) {
395 PassSimple &drw_pass = (pass == 0) ? filter_fg_ps_ : filter_bg_ps_;
396 SwapChain<TextureFromPool, 2> &color_chain = (pass == 0) ? color_fg_tx_ : color_bg_tx_;
397 SwapChain<TextureFromPool, 2> &weight_chain = (pass == 0) ? weight_fg_tx_ : weight_bg_tx_;
399 drw_pass.shader_set(inst_.shaders.static_shader_get(
DOF_FILTER));
400 drw_pass.bind_texture(
"color_tx", &color_chain.previous());
401 drw_pass.bind_texture(
"weight_tx", &weight_chain.previous());
402 drw_pass.bind_image(
"out_color_img", &color_chain.current());
403 drw_pass.bind_image(
"out_weight_img", &weight_chain.current());
404 drw_pass.dispatch(&dispatch_filter_size_);
409void DepthOfField::scatter_pass_sync()
411 for (
int pass = 0; pass < 2; pass++) {
412 PassSimple &drw_pass = (pass == 0) ? scatter_fg_ps_ : scatter_bg_ps_;
415 drw_pass.shader_set(inst_.shaders.static_shader_get(
DOF_SCATTER));
416 drw_pass.bind_ubo(
"dof_buf", data_);
417 drw_pass.push_constant(
"use_bokeh_lut", use_bokeh_lut_);
418 drw_pass.bind_texture(
"bokeh_lut_tx", &bokeh_scatter_lut_tx_);
419 drw_pass.bind_texture(
"occlusion_tx", &occlusion_tx_);
421 drw_pass.bind_ssbo(
"scatter_list_buf", scatter_fg_list_buf_);
427 drw_pass.bind_ssbo(
"scatter_list_buf", scatter_bg_list_buf_);
433void DepthOfField::hole_fill_pass_sync()
439 hole_fill_ps_.init();
440 hole_fill_ps_.bind_resources(inst_.sampling);
442 hole_fill_ps_.bind_ubo(
"dof_buf", data_);
443 hole_fill_ps_.bind_texture(
"color_bilinear_tx", reduced_color_tx_, gather_bilinear);
444 hole_fill_ps_.bind_texture(
"color_tx", reduced_color_tx_, gather_nearest);
445 hole_fill_ps_.bind_texture(
"coc_tx", reduced_coc_tx_, gather_nearest);
446 hole_fill_ps_.bind_image(
"in_tiles_fg_img", &tiles_fg_tx_.current());
447 hole_fill_ps_.bind_image(
"in_tiles_bg_img", &tiles_bg_tx_.current());
448 hole_fill_ps_.bind_image(
"out_color_img", &hole_fill_color_tx_);
449 hole_fill_ps_.bind_image(
"out_weight_img", &hole_fill_weight_tx_);
450 hole_fill_ps_.dispatch(&dispatch_gather_size_);
454void DepthOfField::resolve_pass_sync()
457 RenderBuffers &render_buffers = inst_.render_buffers;
461 resolve_ps_.specialize_constant(sh,
"do_debug_color", inst_.debug_mode ==
DEBUG_DOF_PLANES);
462 resolve_ps_.shader_set(sh);
463 resolve_ps_.bind_ubo(
"dof_buf", data_);
464 resolve_ps_.bind_texture(
"depth_tx", &render_buffers.depth_tx,
no_filter);
465 resolve_ps_.bind_texture(
"color_tx", &input_color_tx_,
no_filter);
466 resolve_ps_.bind_texture(
"stable_color_tx", &resolve_stable_color_tx_,
no_filter);
467 resolve_ps_.bind_texture(
"color_bg_tx", &color_bg_tx_.current(),
with_filter);
468 resolve_ps_.bind_texture(
"color_fg_tx", &color_fg_tx_.current(),
with_filter);
469 resolve_ps_.bind_image(
"in_tiles_fg_img", &tiles_fg_tx_.current());
470 resolve_ps_.bind_image(
"in_tiles_bg_img", &tiles_bg_tx_.current());
471 resolve_ps_.bind_texture(
"weight_bg_tx", &weight_bg_tx_.current());
472 resolve_ps_.bind_texture(
"weight_fg_tx", &weight_fg_tx_.current());
473 resolve_ps_.bind_texture(
"color_hole_fill_tx", &hole_fill_color_tx_);
474 resolve_ps_.bind_texture(
"weight_hole_fill_tx", &hole_fill_weight_tx_);
475 resolve_ps_.bind_texture(
"bokeh_lut_tx", &bokeh_resolve_lut_tx_);
476 resolve_ps_.bind_image(
"out_color_img", &output_color_tx_);
477 resolve_ps_.bind_resources(inst_.sampling);
479 resolve_ps_.dispatch(&dispatch_resolve_size_);
489void DepthOfField::update_sample_table()
491 float2 subpixel_offset = inst_.film.pixel_jitter_get();
493 subpixel_offset *= 0.5;
496 const std::array<int2, 4> plus_offsets = {
int2(-1, 0),
int2(0, -1),
int2(1, 0),
int2(0, 1)};
498 const float radius = 1.5f;
500 for (
int2 offset : plus_offsets) {
508 GPUTexture **input_tx,
509 GPUTexture **output_tx,
512 if (fx_radius_ == 0.0f) {
516 input_color_tx_ = *input_tx;
517 output_color_tx_ = *output_tx;
521 const CameraData &cam_data = inst_.camera.data_get();
522 data_.camera_type = cam_data.
type;
524 float3 jitter =
float3(fx_radius_, 0.0f, -focus_distance_);
529 if (inst_.camera.is_orthographic()) {
530 data_.coc_mul = (center[0] - jitter[0]) * 0.5f * extent_[0];
531 data_.coc_bias = focus_distance_ * data_.coc_mul;
534 data_.coc_bias = -(center[0] - jitter[0]) * 0.5f * extent_[0];
535 data_.coc_mul = focus_distance_ * data_.coc_bias;
543 max_bg_coc = data_.coc_bias;
548 data_.scatter_coc_threshold = 4.0f;
550 update_sample_table();
565 dispatch_tiles_dilate_size_ =
int3(
592 if (use_bokeh_lut_) {
597 setup_color_tx_.acquire(half_res,
GPU_RGBA16F, usage_readwrite);
598 setup_coc_tx_.acquire(half_res,
GPU_R16F);
603 stabilize_output_tx_.acquire(half_res,
GPU_RGBA16F);
607 if (stabilize_valid_history_ ==
false) {
621 stabilize_output_tx_.release();
622 setup_color_tx_.release();
636 setup_coc_tx_.release();
643 for (
int pass = 0; pass < 2; pass++) {
645 int dilation_radius = 0;
646 while (dilation_radius < dilation_end_radius) {
647 int remainder = dilation_end_radius - dilation_radius;
649 int max_multiplier = dilation_radius + 1;
652 int multiplier =
min_ii(max_multiplier,
floorf(remainder /
float(ring_count)));
654 dilation_radius += ring_count * multiplier;
656 tiles_dilate_ring_count_ = ring_count;
657 tiles_dilate_ring_width_mul_ = multiplier;
662 drw.
submit((pass == 0) ? tiles_dilate_minmax_ps_ : tiles_dilate_minabs_ps_,
view);
666 tiles_fg_tx_.previous().release();
667 tiles_bg_tx_.previous().release();
672 downsample_tx_.acquire(quarter_res,
GPU_RGBA16F, usage_readwrite);
676 scatter_fg_indirect_buf_.clear_to_zero();
677 scatter_bg_indirect_buf_.clear_to_zero();
682 downsample_tx_.release();
687 for (
int is_background = 0; is_background < 2; is_background++) {
692 Framebuffer &scatter_fb = is_background ? scatter_bg_fb_ : scatter_fg_fb_;
693 PassSimple &gather_ps = is_background ? gather_bg_ps_ : gather_fg_ps_;
694 PassSimple &filter_ps = is_background ? filter_bg_ps_ : filter_fg_ps_;
695 PassSimple &scatter_ps = is_background ? scatter_bg_ps_ : scatter_fg_ps_;
699 occlusion_tx_.acquire(half_res,
GPU_RG16F);
725 occlusion_tx_.release();
732 bokeh_gather_lut_tx_.release();
733 bokeh_scatter_lut_tx_.release();
735 hole_fill_color_tx_.acquire(half_res,
GPU_RGBA16F, usage_readwrite);
736 hole_fill_weight_tx_.acquire(half_res,
GPU_R16F, usage_readwrite);
751 color_bg_tx_.current().release();
752 color_fg_tx_.current().release();
753 weight_bg_tx_.current().release();
754 weight_fg_tx_.current().release();
755 tiles_fg_tx_.current().release();
756 tiles_bg_tx_.current().release();
757 hole_fill_color_tx_.release();
758 hole_fill_weight_tx_.release();
759 bokeh_resolve_lut_tx_.release();
767 std::swap(*input_tx, *output_tx);
Camera data-block and utility functions.
float BKE_camera_object_dof_distance(const struct Object *ob)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE float clamp_f(float value, float min, float max)
MINLINE float min_ff(float a, float b)
void mul_project_m4_v3(const float mat[4][4], float vec[3])
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void add_v2_v2(float r[2], const float a[2])
void GPU_debug_group_end()
void GPU_debug_group_begin(const char *name)
#define GPU_ATTACHMENT_TEXTURE(_texture)
#define GPU_ATTACHMENT_NONE
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
void GPU_memory_barrier(eGPUBarrier barrier)
@ GPU_BARRIER_SHADER_STORAGE
@ GPU_BARRIER_TEXTURE_FETCH
@ GPU_BARRIER_SHADER_IMAGE_ACCESS
@ GPU_BARRIER_FRAMEBUFFER
int GPU_texture_height(const GPUTexture *texture)
int GPU_texture_width(const GPUTexture *texture)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_SHADER_WRITE
@ GPU_TEXTURE_USAGE_ATTACHMENT
@ GPU_SAMPLER_FILTERING_MIPMAP
@ GPU_SAMPLER_FILTERING_LINEAR
void ensure(GPUAttachment depth=GPU_ATTACHMENT_NONE, GPUAttachment color1=GPU_ATTACHMENT_NONE, GPUAttachment color2=GPU_ATTACHMENT_NONE, GPUAttachment color3=GPU_ATTACHMENT_NONE, GPUAttachment color4=GPU_ATTACHMENT_NONE, GPUAttachment color5=GPU_ATTACHMENT_NONE, GPUAttachment color6=GPU_ATTACHMENT_NONE, GPUAttachment color7=GPU_ATTACHMENT_NONE, GPUAttachment color8=GPU_ATTACHMENT_NONE)
void submit(PassSimple &pass, View &view)
static void swap(TextureFromPool &a, Texture &b)
void clear(float4 values)
bool ensure_2d(eGPUTextureFormat format, int2 extent, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1)
void bind_texture(const char *name, GPUTexture *texture, GPUSamplerState state=sampler_auto)
void bind_image(const char *name, GPUTexture *image)
void dispatch(int group_len)
void barrier(eGPUBarrier type)
void bind_ubo(const char *name, GPUUniformBuf *buffer)
void shader_set(GPUShader *shader)
bool is_panoramic() const
bool is_orthographic() const
bool is_perspective() const
void render(View &view, GPUTexture **input_tx, GPUTexture **output_tx, DepthOfFieldBuffer &dof_buffer)
void jitter_apply(float4x4 &winmat, float4x4 &viewmat)
RenderBuffers render_buffers
GPUShader * static_shader_get(eShaderType shader_type)
@ DRW_STATE_BLEND_ADD_FULL
#define DOF_DEFAULT_GROUP_SIZE
#define DOF_REDUCE_GROUP_SIZE
#define DOF_TILES_DILATE_GROUP_SIZE
#define DOF_FILTER_GROUP_SIZE
#define DOF_STABILIZE_GROUP_SIZE
#define DOF_BOKEH_LUT_SIZE
#define DOF_GATHER_GROUP_SIZE
#define DOF_RESOLVE_GROUP_SIZE
#define DOF_MAX_SLIGHT_FOCUS_RADIUS
#define DOF_DILATE_RING_COUNT
#define DOF_GATHER_RING_COUNT
detail::Pass< command::DrawCommandBuf > PassSimple
constexpr GPUSamplerState no_filter
@ DOF_GATHER_BACKGROUND_LUT
@ DOF_TILES_DILATE_MINABS
@ DOF_TILES_DILATE_MINMAX
@ DOF_GATHER_FOREGROUND_LUT
static float film_filter_weight(float filter_radius, float sample_distance_sqr)
constexpr GPUSamplerState with_filter
static float circle_to_polygon_angle(float sides_count, float theta)
static float coc_radius_from_camera_depth(DepthOfFieldData dof, float depth)
static float circle_to_polygon_radius(float sides_count, float theta)
T length_squared(const VecBase< T, Size > &a)
VecBase< T, Size > divide_ceil(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
VecBase< T, Size > ceil_to_multiple(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
VecBase< int32_t, 3 > int3
VecBase< float, 3 > float3
const c_style_mat & ptr() const
Texture stabilize_history_tx_
float2 bokeh_anisotropic_scale