|
Blender V5.3
|
#include "draw_view.bsl.hh"#include "eevee_depth_of_field_shared.hh"#include "gpu_shader_math_base.bsl.hh"Go to the source code of this file.
Classes | |
| struct | CocTile |
| struct | CocTilePrediction |
Functions | |
Weighting and downsampling utils. | |
| float | dof_hdr_color_weight (float4 color) |
| float | dof_coc_select (float4 cocs) |
| float4 | dof_bilateral_coc_weights (float4 cocs) |
| float4 | dof_bilateral_color_weights (float4 colors[4]) |
| float | dof_coc_from_depth (const draw::View &views, DepthOfFieldData dof_data, float2 uv, float depth) |
Gather & Scatter Weighting | |
| float | dof_layer_weight (float coc, const bool is_foreground, const bool is_resolve) |
| float4 | dof_layer_weight (float4 coc) |
| float | dof_sample_weight (float coc) |
| float4 | dof_sample_weight (float4 coc) |
Gathering | |
| int2 | dof_square_ring_sample_offset (int ring_distance, int sample_id) |
Constants. | |
Depth of Field utils. | |
| #define | DOF_SLIGHT_FOCUS_DENSITY 2 |
| #define | debug_gather_perf false |
| #define | debug_scatter_perf false |
| #define | debug_resolve_perf false |
| #define | no_smooth_intersection false |
| #define | no_gather_occlusion false |
| #define | no_gather_mipmaps false |
| #define | no_gather_random false |
| #define | no_gather_filtering false |
| #define | no_scatter_occlusion false |
| #define | no_scatter_pass false |
| #define | no_foreground_pass false |
| #define | no_background_pass false |
| #define | no_slight_focus_pass false |
| #define | no_focus_pass false |
| #define | no_hole_fill_pass false |
| #define | dof_layer_threshold (4.0f) |
| #define | dof_layer_offset_fg (0.5f + 1.0f) |
| #define | dof_layer_offset (0.5f + 0.5f) |
| #define | dof_max_slight_focus_radius DOF_MAX_SLIGHT_FOCUS_RADIUS |
| const uint2 | quad_offsets_u [4] = {uint2(0, 1), uint2(1, 1), uint2(1, 0), uint2(0, 0)} |
| const float2 | quad_offsets [4] |
Circle of Confusion tiles | |
| static constexpr float | dof_tile_large_coc = 1024.0f |
| CocTile | dof_coc_tile_init () |
| CocTile | dof_coc_tile_unpack (float3 fg, float3 bg) |
| void | dof_coc_tile_pack (CocTile tile, float3 &out_fg, float3 &out_bg) |
| CocTile | dof_coc_tile_load (image2D tiles_fg_img, image2D tiles_bg_img, int2 texel) |
| void | dof_coc_tile_store (image2D tiles_fg_img, image2D tiles_bg_img, int2 texel_out, CocTile tile_data) |
| bool | dof_do_fast_gather (float max_absolute_coc, float min_absolute_coc, const bool is_foreground, const bool is_resolve) |
| CocTilePrediction | dof_coc_tile_prediction_get (CocTile tile, const bool is_resolve) |
| #define debug_gather_perf false |
Definition at line 24 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::Accumulator::dof_gather_accumulator().
| #define debug_resolve_perf false |
Definition at line 26 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::resolve::comp_main().
| #define debug_scatter_perf false |
Definition at line 25 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::Accumulator::dof_gather_accumulator(), and eevee::dof::scatter::frag_main().
| #define dof_layer_offset (0.5f + 0.5f) |
Definition at line 46 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by dof_coc_tile_prediction_get(), eevee::dof::Accumulator::dof_gather_accumulate_sample_pair(), dof_layer_weight(), and dof_layer_weight().
| #define dof_layer_offset_fg (0.5f + 1.0f) |
Definition at line 44 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by dof_coc_tile_prediction_get(), and dof_layer_weight().
| #define dof_layer_threshold (4.0f) |
Definition at line 42 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by dof_coc_tile_prediction_get(), dof_do_fast_gather(), eevee::dof::Accumulator::dof_gather_accumulate_center_sample(), eevee::dof::Accumulator::dof_gather_accumulate_sample_pair(), dof_layer_weight(), dof_layer_weight(), and eevee::dof::Accumulator::dof_slight_focus_gather().
| #define dof_max_slight_focus_radius DOF_MAX_SLIGHT_FOCUS_RADIUS |
Definition at line 48 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::bokeh_lut::comp_main(), eevee::dof::Accumulator::dof_slight_focus_gather(), and eevee::dof::resolve::Resources::slight_focus_coc_tile_get().
| #define DOF_SLIGHT_FOCUS_DENSITY 2 |
Definition at line 20 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::Accumulator::dof_gather_accumulate_center_sample().
| #define no_background_pass false |
Definition at line 36 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::resolve::comp_main().
| #define no_focus_pass false |
Definition at line 38 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::resolve::comp_main().
| #define no_foreground_pass false |
Definition at line 35 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::resolve::comp_main().
| #define no_gather_filtering false |
Definition at line 32 of file eevee_depth_of_field_lib.bsl.hh.
| #define no_gather_mipmaps false |
Definition at line 30 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::Accumulator::dof_gather_init().
| #define no_gather_occlusion false |
Definition at line 29 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::Accumulator::dof_gather_accumulate_sample_ring().
| #define no_gather_random false |
Definition at line 31 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::Accumulator::dof_gather_accumulator(), and eevee::dof::Accumulator::dof_slight_focus_gather().
| #define no_hole_fill_pass false |
Definition at line 39 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::resolve::comp_main().
| #define no_scatter_occlusion false |
Definition at line 33 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::scatter::frag_main().
| #define no_scatter_pass false |
Definition at line 34 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::setup::reduce::comp_main().
| #define no_slight_focus_pass false |
Definition at line 37 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::resolve::comp_main().
| #define no_smooth_intersection false |
Definition at line 28 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::Accumulator::dof_intersection_weight().
Definition at line 86 of file eevee_depth_of_field_lib.bsl.hh.
References dof_bilateral_coc_weights(), dof_coc_select(), saturate, and scale().
Referenced by eevee::dof::setup::downsample::comp_main(), eevee::dof::setup::reduce::comp_main(), eevee::dof::setup::setup::comp_main(), and dof_bilateral_coc_weights().
Definition at line 97 of file eevee_depth_of_field_lib.bsl.hh.
References dof_bilateral_color_weights(), and dof_hdr_color_weight().
Referenced by eevee::dof::setup::reduce::comp_main(), eevee::dof::setup::setup::comp_main(), and dof_bilateral_color_weights().
| float dof_coc_from_depth | ( | const draw::View & | views, |
| DepthOfFieldData | dof_data, | ||
| float2 | uv, | ||
| float | depth ) |
Definition at line 107 of file eevee_depth_of_field_lib.bsl.hh.
References ViewMatrices::depth_screen_to_view(), dof_coc_from_depth(), length(), ViewMatrices::point_screen_to_view(), and resource_table.
Referenced by eevee::dof::resolve::comp_main(), eevee::dof::setup::setup::comp_main(), dof_coc_from_depth(), eevee::dof::Accumulator::dof_slight_focus_gather(), and eevee::dof::resolve::Resources::slight_focus_coc_tile_get().
Definition at line 69 of file eevee_depth_of_field_lib.bsl.hh.
References abs, dof_coc_select(), float4::w, float4::x, float4::y, and float4::z.
Referenced by dof_bilateral_coc_weights(), and dof_coc_select().
| CocTile dof_coc_tile_init | ( | ) |
Definition at line 194 of file eevee_depth_of_field_lib.bsl.hh.
References dof_coc_tile_init(), dof_tile_large_coc, and tile.
Referenced by eevee::dof::tile_dilate::comp_main(), and dof_coc_tile_init().
Definition at line 228 of file eevee_depth_of_field_lib.bsl.hh.
References clamp(), dof_coc_tile_load(), dof_coc_tile_unpack(), force_inline, imageLoad(), and imageSize().
Referenced by eevee::dof::gather::comp_main(), eevee::dof::hole_fill::comp_main(), eevee::dof::resolve::comp_main(), eevee::dof::tile_dilate::comp_main(), and dof_coc_tile_load().
Definition at line 218 of file eevee_depth_of_field_lib.bsl.hh.
References dof_coc_tile_pack(), tile, float3::x, float3::y, and float3::z.
Referenced by dof_coc_tile_pack(), and dof_coc_tile_store().
| CocTilePrediction dof_coc_tile_prediction_get | ( | CocTile | tile, |
| const bool | is_resolve ) |
Using the tile CoC infos, predict which convolutions are required and the ones that can be skipped.
Definition at line 277 of file eevee_depth_of_field_lib.bsl.hh.
References CocTilePrediction::do_background, CocTilePrediction::do_focus, CocTilePrediction::do_foreground, CocTilePrediction::do_hole_fill, CocTilePrediction::do_slight_focus, dof_coc_tile_prediction_get(), dof_do_fast_gather(), dof_layer_offset, dof_layer_offset_fg, dof_layer_threshold, and tile.
Referenced by eevee::dof::gather::comp_main(), eevee::dof::hole_fill::comp_main(), eevee::dof::resolve::comp_main(), and dof_coc_tile_prediction_get().
| void dof_coc_tile_store | ( | image2D | tiles_fg_img, |
| image2D | tiles_bg_img, | ||
| int2 | texel_out, | ||
| CocTile | tile_data ) |
Definition at line 235 of file eevee_depth_of_field_lib.bsl.hh.
References dof_coc_tile_pack(), dof_coc_tile_store(), force_inline, and imageStore().
Referenced by eevee::dof::tile_dilate::comp_main(), eevee::dof::tile_flatten::comp_main(), and dof_coc_tile_store().
Definition at line 206 of file eevee_depth_of_field_lib.bsl.hh.
References dof_coc_tile_unpack(), tile, float3::x, float3::y, and float3::z.
Referenced by dof_coc_tile_load(), and dof_coc_tile_unpack().
| bool dof_do_fast_gather | ( | float | max_absolute_coc, |
| float | min_absolute_coc, | ||
| const bool | is_foreground, | ||
| const bool | is_resolve ) |
Definition at line 247 of file eevee_depth_of_field_lib.bsl.hh.
References dof_do_fast_gather(), dof_layer_threshold, and dof_layer_weight().
Referenced by eevee::dof::gather::comp_main(), eevee::dof::hole_fill::comp_main(), dof_coc_tile_prediction_get(), and dof_do_fast_gather().
Definition at line 60 of file eevee_depth_of_field_lib.bsl.hh.
References dof_hdr_color_weight().
Referenced by dof_bilateral_color_weights(), and dof_hdr_color_weight().
Definition at line 130 of file eevee_depth_of_field_lib.bsl.hh.
References abs, dof_layer_offset, dof_layer_offset_fg, dof_layer_threshold, dof_layer_weight(), float, and saturate.
Referenced by eevee::dof::setup::reduce::comp_main(), dof_do_fast_gather(), eevee::dof::Accumulator::dof_gather_accumulate_center_sample(), eevee::dof::Accumulator::dof_gather_accumulate_sample_pair(), dof_layer_weight(), and dof_layer_weight().
Definition at line 144 of file eevee_depth_of_field_lib.bsl.hh.
References dof_layer_offset, dof_layer_threshold, dof_layer_weight(), and saturate.
Definition at line 152 of file eevee_depth_of_field_lib.bsl.hh.
References abs, dof_sample_weight(), M_PI, max, min, and square().
Referenced by eevee::dof::setup::reduce::comp_main(), eevee::dof::Accumulator::dof_gather_accumulate_center_sample(), eevee::dof::Accumulator::dof_gather_accumulate_sample_pair(), dof_sample_weight(), and dof_sample_weight().
Definition at line 163 of file eevee_depth_of_field_lib.bsl.hh.
References abs, dof_sample_weight(), M_PI, max, min, and square().
| int2 dof_square_ring_sample_offset | ( | int | ring_distance, |
| int | sample_id ) |
Generate samples in a square pattern with the ring radius. X is the center tile.
Dist1 Dist2 6 5 4 3 2 3 2 1 7 1 . X 0 . X 0 . . . . . . . . . .
Samples are expected to be mirrored to complete the pattern.
Definition at line 319 of file eevee_depth_of_field_lib.bsl.hh.
References dof_square_ring_sample_offset(), int2::x, and int2::y.
Referenced by eevee::dof::tile_dilate::comp_main(), and dof_square_ring_sample_offset().
|
staticconstexpr |
Definition at line 191 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by dof_coc_tile_init().
| const float2 quad_offsets[4] |
Definition at line 51 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::setup::downsample::comp_main(), eevee::dof::setup::setup::comp_main(), eevee::dof::setup::reduce::Resources::scatter_neighborhood_rejection(), eevee::dof::resolve::Resources::slight_focus_coc_tile_get(), and eevee::dof::scatter::vert_main().
Definition at line 50 of file eevee_depth_of_field_lib.bsl.hh.
Referenced by eevee::dof::setup::reduce::comp_main(), and eevee::dof::setup::reduce::Resources::load4_coc_cache().