Blender V5.3
eevee_depth_of_field_lib.bsl.hh File Reference

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)

Macro Definition Documentation

◆ debug_gather_perf

#define debug_gather_perf   false

◆ debug_resolve_perf

#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().

◆ debug_scatter_perf

#define debug_scatter_perf   false

◆ dof_layer_offset

◆ dof_layer_offset_fg

#define dof_layer_offset_fg   (0.5f + 1.0f)

◆ dof_layer_threshold

◆ dof_max_slight_focus_radius

#define dof_max_slight_focus_radius   DOF_MAX_SLIGHT_FOCUS_RADIUS

◆ DOF_SLIGHT_FOCUS_DENSITY

#define DOF_SLIGHT_FOCUS_DENSITY   2

◆ no_background_pass

#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().

◆ no_focus_pass

#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().

◆ no_foreground_pass

#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().

◆ no_gather_filtering

#define no_gather_filtering   false

Definition at line 32 of file eevee_depth_of_field_lib.bsl.hh.

◆ no_gather_mipmaps

#define no_gather_mipmaps   false

◆ no_gather_occlusion

#define no_gather_occlusion   false

◆ no_gather_random

#define no_gather_random   false

◆ no_hole_fill_pass

#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().

◆ no_scatter_occlusion

#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().

◆ no_scatter_pass

#define no_scatter_pass   false

◆ no_slight_focus_pass

#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().

◆ no_smooth_intersection

#define no_smooth_intersection   false

Function Documentation

◆ dof_bilateral_coc_weights()

◆ dof_bilateral_color_weights()

◆ dof_coc_from_depth()

◆ dof_coc_select()

float dof_coc_select ( float4 cocs)

◆ dof_coc_tile_init()

CocTile dof_coc_tile_init ( )

◆ dof_coc_tile_load()

◆ dof_coc_tile_pack()

void dof_coc_tile_pack ( CocTile tile,
float3 & out_fg,
float3 & out_bg )

◆ dof_coc_tile_prediction_get()

◆ dof_coc_tile_store()

void dof_coc_tile_store ( image2D tiles_fg_img,
image2D tiles_bg_img,
int2 texel_out,
CocTile tile_data )

◆ dof_coc_tile_unpack()

CocTile dof_coc_tile_unpack ( float3 fg,
float3 bg )

◆ dof_do_fast_gather()

bool dof_do_fast_gather ( float max_absolute_coc,
float min_absolute_coc,
const bool is_foreground,
const bool is_resolve )

◆ dof_hdr_color_weight()

float dof_hdr_color_weight ( float4 color)

◆ dof_layer_weight() [1/2]

◆ dof_layer_weight() [2/2]

float4 dof_layer_weight ( float4 coc)

◆ dof_sample_weight() [1/2]

◆ dof_sample_weight() [2/2]

float4 dof_sample_weight ( float4 coc)

Definition at line 163 of file eevee_depth_of_field_lib.bsl.hh.

References abs, dof_sample_weight(), M_PI, max, min, and square().

◆ dof_square_ring_sample_offset()

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().

Variable Documentation

◆ dof_tile_large_coc

float dof_tile_large_coc = 1024.0f
staticconstexpr

Definition at line 191 of file eevee_depth_of_field_lib.bsl.hh.

Referenced by dof_coc_tile_init().

◆ quad_offsets

◆ quad_offsets_u

const uint2 quad_offsets_u[4] = {uint2(0, 1), uint2(1, 1), uint2(1, 0), uint2(0, 0)}