Blender V4.3
eevee_depth_of_field_info.hh File Reference

Go to the source code of this file.

Functions

Scatter
flat(Type::VEC4, "color_and_coc1") .flat(Type no_perspective(Type::VEC2, "rect_uv1") .no_perspective(Type draw_view sampler (0, ImageType::FLOAT_2D, "occlusion_tx") .sampler(1
 
flat(Type::VEC4, "color_and_coc1") .flat(Type no_perspective(Type::VEC2, "rect_uv1") .no_perspective(Type draw_view bokeh_lut_tx uniform_buf (6, "DepthOfFieldData", "dof_buf") .storage_buf(0
 

Variations

#define EEVEE_DOF_FINAL_VARIATION(name, ...)    GPU_SHADER_CREATE_INFO(name).additional_info(__VA_ARGS__).do_static_compilation(true);
 
#define EEVEE_DOF_LUT_VARIATIONS(prefix, ...)
 
#define EEVEE_DOF_GROUND_VARIATIONS(name, ...)
 
 color_tx
 
 bokeh_lut_tx
 
 false
 
 true
 
 define ("DOF_BOKEH_TEXTURE", "false") .define("bokeh_lut_tx"
 
 define ("DOF_BOKEH_TEXTURE", "true") .sampler(5
 
 GPU_SHADER_CREATE_INFO (eevee_depth_of_field_background).define("DOF_FOREGROUND_PASS"
 
 GPU_SHADER_CREATE_INFO (eevee_depth_of_field_foreground).define("DOF_FOREGROUND_PASS"
 

Setup

DOF_BOKEH_LUT_SIZE DepthOfFieldData
 
DOF_BOKEH_LUT_SIZE dof_buf GPU_R16F
 
DOF_STABILIZE_GROUP_SIZE dof_buf color_tx in_history_tx sampler(4, ImageType::DEPTH_2D, "depth_tx") .push_constant(Type DOF_DEFAULT_GROUP_SIZE color_tx GPU_RGBA16F
 
DOF_REDUCE_GROUP_SIZE dof_buf ScatterRect
 
DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] DrawCommand
 
 do_static_compilation (true) .local_group_size(DOF_BOKEH_LUT_SIZE
 
DOF_BOKEH_LUT_SIZE additional_info ("eevee_shared", "draw_view") .uniform_buf(6
 
DOF_BOKEH_LUT_SIZE dof_buf image (0, GPU_RG16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_gather_lut_img") .image(1
 
DOF_BOKEH_LUT_SIZE dof_buf out_scatter_lut_img image (2, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_resolve_lut_img") .compute_source("eevee_depth_of_field_bokeh_lut_comp.glsl")
 
DOF_DEFAULT_GROUP_SIZE dof_buf sampler (0, ImageType::FLOAT_2D, "color_tx") .sampler(1
 
DOF_DEFAULT_GROUP_SIZE dof_buf depth_tx image (0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_color_img") .image(1
 
DOF_DEFAULT_GROUP_SIZE dof_buf depth_tx out_coc_img compute_source ("eevee_depth_of_field_setup_comp.glsl")
 
DOF_STABILIZE_GROUP_SIZE additional_info ("eevee_shared", "draw_view", "eevee_velocity_camera") .uniform_buf(6
 
DOF_STABILIZE_GROUP_SIZE dof_buf sampler (0, ImageType::FLOAT_2D, "coc_tx") .sampler(1
 
DOF_STABILIZE_GROUP_SIZE dof_buf color_tx sampler (2, ImageType::FLOAT_2D, "velocity_tx") .sampler(3
 
DOF_STABILIZE_GROUP_SIZE dof_buf color_tx in_history_tx sampler(4, ImageType::DEPTH_2D, "depth_tx") .push_constant(Type DOF_DEFAULT_GROUP_SIZE color_tx sampler (1, ImageType::FLOAT_2D, "coc_tx") .image(0
 
DOF_STABILIZE_GROUP_SIZE dof_buf color_tx in_history_tx sampler(4, ImageType::DEPTH_2D, "depth_tx") .push_constant(Type DOF_DEFAULT_GROUP_SIZE color_tx out_color_img compute_source ("eevee_depth_of_field_downsample_comp.glsl")
 
DOF_REDUCE_GROUP_SIZE dof_buf sampler (0, ImageType::FLOAT_2D, "downsample_tx") .storage_buf(0
 
DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] storage_buf (1, Qualifier::WRITE, "ScatterRect", "scatter_bg_list_buf[]") .storage_buf(2
 
DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] scatter_fg_indirect_buf storage_buf (3, Qualifier::READ_WRITE, "DrawCommand", "scatter_bg_indirect_buf") .image(0
 
DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] scatter_fg_indirect_buf inout_color_lod0_img image (1, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_color_lod1_img") .image(2
 
DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] scatter_fg_indirect_buf inout_color_lod0_img out_color_lod2_img image (3, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_color_lod3_img") .image(4
 
DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] scatter_fg_indirect_buf inout_color_lod0_img out_color_lod2_img in_coc_lod0_img image (5, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_coc_lod1_img") .image(6
 
DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] scatter_fg_indirect_buf inout_color_lod0_img out_color_lod2_img in_coc_lod0_img out_coc_lod2_img image (7, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_coc_lod3_img") .compute_source("eevee_depth_of_field_reduce_comp.glsl")
 

Circle-Of-Confusion Tiles

DOF_TILES_FLATTEN_GROUP_SIZE coc_tx GPU_R11F_G11F_B10F
 
 in_tiles_bg_img
 
DOF_TILES_FLATTEN_GROUP_SIZE coc_tx image (2, GPU_R11F_G11F_B10F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_tiles_fg_img") .image(3
 
DOF_TILES_FLATTEN_GROUP_SIZE coc_tx out_tiles_bg_img compute_source ("eevee_depth_of_field_tiles_flatten_comp.glsl")
 
 additional_info ("eevee_shared", "draw_view", "eevee_depth_of_field_tiles_common") .local_group_size(DOF_TILES_DILATE_GROUP_SIZE
 
DOF_TILES_DILATE_GROUP_SIZE out_tiles_bg_img push_constant(Type::INT, "ring_count") .push_constant(Type false additional_info ("eevee_depth_of_field_tiles_dilate")
 
 image (0, GPU_R11F_G11F_B10F, Qualifier::READ, ImageType::FLOAT_2D, "in_tiles_fg_img") .image(1
 

Gather

dof_buf color_tx coc_tx out_weight_img
 
 eevee_depth_of_field_no_lut
 
 additional_info ("eevee_shared", "draw_view", "eevee_depth_of_field_tiles_common", "eevee_sampling_data") .uniform_buf(6
 
dof_buf local_group_size (DOF_GATHER_GROUP_SIZE, DOF_GATHER_GROUP_SIZE) .sampler(0
 
dof_buf color_tx sampler (1, ImageType::FLOAT_2D, "color_bilinear_tx") .sampler(2
 
dof_buf color_tx coc_tx image (2, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_color_img") .image(3
 
 image (4, GPU_RG16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_occlusion_img") .compute_source("eevee_depth_of_field_gather_comp.glsl") .additional_info("eevee_depth_of_field_gather_common")
 
DOF_FILTER_GROUP_SIZE additional_info ("eevee_shared") .sampler(0
 
DOF_FILTER_GROUP_SIZE color_tx sampler (1, ImageType::FLOAT_2D, "weight_tx") .image(0
 
DOF_FILTER_GROUP_SIZE color_tx out_color_img image (1, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "out_weight_img") .compute_source("eevee_depth_of_field_filter_comp.glsl")
 

Resolve

DOF_RESOLVE_GROUP_SIZE draw_view
 
DOF_RESOLVE_GROUP_SIZE eevee_depth_of_field_tiles_common
 
 define ("DOF_RESOLVE_PASS", "true") .local_group_size(DOF_RESOLVE_GROUP_SIZE
 
DOF_RESOLVE_GROUP_SIZE specialization_constant (Type::BOOL, "do_debug_color", false) .additional_info("eevee_shared"
 
DOF_RESOLVE_GROUP_SIZE eevee_sampling_data depth_tx sampler (1, ImageType::FLOAT_2D, "color_tx") .sampler(2
 
DOF_RESOLVE_GROUP_SIZE eevee_sampling_data depth_tx color_bg_tx sampler (3, ImageType::FLOAT_2D, "color_fg_tx") .sampler(4
 
DOF_RESOLVE_GROUP_SIZE eevee_sampling_data depth_tx color_bg_tx color_hole_fill_tx sampler (7, ImageType::FLOAT_2D, "weight_bg_tx") .sampler(8
 
DOF_RESOLVE_GROUP_SIZE eevee_sampling_data depth_tx color_bg_tx color_hole_fill_tx weight_fg_tx sampler (9, ImageType::FLOAT_2D, "weight_hole_fill_tx") .sampler(10
 

Macro Definition Documentation

◆ EEVEE_DOF_FINAL_VARIATION

#define EEVEE_DOF_FINAL_VARIATION ( name,
... )    GPU_SHADER_CREATE_INFO(name).additional_info(__VA_ARGS__).do_static_compilation(true);

Definition at line 137 of file eevee_depth_of_field_info.hh.

◆ EEVEE_DOF_GROUND_VARIATIONS

#define EEVEE_DOF_GROUND_VARIATIONS ( name,
... )
Value:
EEVEE_DOF_LUT_VARIATIONS(name##_background, "eevee_depth_of_field_background", __VA_ARGS__) \
EEVEE_DOF_LUT_VARIATIONS(name##_foreground, "eevee_depth_of_field_foreground", __VA_ARGS__)
#define EEVEE_DOF_LUT_VARIATIONS(prefix,...)

Definition at line 144 of file eevee_depth_of_field_info.hh.

◆ EEVEE_DOF_LUT_VARIATIONS

#define EEVEE_DOF_LUT_VARIATIONS ( prefix,
... )
Value:
EEVEE_DOF_FINAL_VARIATION(prefix##_lut, "eevee_depth_of_field_lut", __VA_ARGS__) \
EEVEE_DOF_FINAL_VARIATION(prefix##_no_lut, "eevee_depth_of_field_no_lut", __VA_ARGS__)
#define EEVEE_DOF_FINAL_VARIATION(name,...)

Definition at line 140 of file eevee_depth_of_field_info.hh.

Function Documentation

◆ additional_info() [1/6]

true additional_info ( "eevee_depth_of_field_tiles_dilate" )

◆ additional_info() [2/6]

additional_info ( "eevee_shared" )

◆ additional_info() [3/6]

additional_info ( "eevee_shared" ,
"draw_view"  )

◆ additional_info() [4/6]

additional_info ( "eevee_shared" ,
"draw_view" ,
"eevee_depth_of_field_tiles_common"  )

◆ additional_info() [5/6]

additional_info ( "eevee_shared" ,
"draw_view" ,
"eevee_depth_of_field_tiles_common" ,
"eevee_sampling_data"  )

◆ additional_info() [6/6]

DOF_STABILIZE_GROUP_SIZE additional_info ( "eevee_shared" ,
"draw_view" ,
"eevee_velocity_camera"  )

◆ compute_source() [1/3]

DOF_STABILIZE_GROUP_SIZE dof_buf color_tx in_history_tx sampler(4, ImageType::DEPTH_2D, "depth_tx") .push_constant(Type DOF_DEFAULT_GROUP_SIZE color_tx out_color_img compute_source ( "eevee_depth_of_field_downsample_comp.glsl" )

◆ compute_source() [2/3]

DOF_DEFAULT_GROUP_SIZE dof_buf depth_tx out_coc_img compute_source ( "eevee_depth_of_field_setup_comp.glsl" )

◆ compute_source() [3/3]

DOF_TILES_FLATTEN_GROUP_SIZE coc_tx out_tiles_bg_img compute_source ( "eevee_depth_of_field_tiles_flatten_comp.glsl" )

◆ define() [1/3]

define ( "DOF_BOKEH_TEXTURE" ,
"false"  )

WORKAROUND(@fclem): This is to keep the code as is for now. The bokeh_lut_tx is referenced even if not used after optimization. But we don't want to include it in the create infos.

◆ define() [2/3]

define ( "DOF_BOKEH_TEXTURE" ,
"true"  )

◆ define() [3/3]

define ( "DOF_RESOLVE_PASS" ,
"true"  )

◆ do_static_compilation()

do_static_compilation ( true )

Colors, weights, and Circle of confusion radii for the 4 pixels to scatter. Scaling factor for the bokeh distance. Sprite pixel position with origin at sprite center. In pixels.

◆ GPU_SHADER_CREATE_INFO() [1/2]

GPU_SHADER_CREATE_INFO ( eevee_depth_of_field_background )

◆ GPU_SHADER_CREATE_INFO() [2/2]

GPU_SHADER_CREATE_INFO ( eevee_depth_of_field_foreground )

◆ image() [1/12]

image ( 0 ,
GPU_R11F_G11F_B10F ,
Qualifier::READ ,
ImageType::FLOAT_2D ,
"in_tiles_fg_img"  )

◆ image() [2/12]

DOF_BOKEH_LUT_SIZE dof_buf image ( 0 ,
GPU_RG16F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_gather_lut_img"  )

◆ image() [3/12]

DOF_DEFAULT_GROUP_SIZE dof_buf depth_tx image ( 0 ,
GPU_RGBA16F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_color_img"  )

◆ image() [4/12]

DOF_FILTER_GROUP_SIZE color_tx out_color_img image ( 1 ,
GPU_R16F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_weight_img"  )

◆ image() [5/12]

DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] scatter_fg_indirect_buf inout_color_lod0_img image ( 1 ,
GPU_RGBA16F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_color_lod1_img"  )

◆ image() [6/12]

DOF_TILES_DILATE_GROUP_SIZE image ( 2 ,
GPU_R11F_G11F_B10F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_tiles_fg_img"  )

◆ image() [7/12]

DOF_BOKEH_LUT_SIZE dof_buf out_scatter_lut_img image ( 2 ,
GPU_R16F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_resolve_lut_img"  )

◆ image() [8/12]

DOF_RESOLVE_GROUP_SIZE eevee_sampling_data depth_tx color_bg_tx color_hole_fill_tx weight_fg_tx stable_color_tx image ( 2 ,
GPU_RGBA16F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_color_img"  )

◆ image() [9/12]

DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] scatter_fg_indirect_buf inout_color_lod0_img out_color_lod2_img image ( 3 ,
GPU_RGBA16F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_color_lod3_img"  )

◆ image() [10/12]

image ( 4 ,
GPU_RG16F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_occlusion_img"  )

◆ image() [11/12]

DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] scatter_fg_indirect_buf inout_color_lod0_img out_color_lod2_img in_coc_lod0_img image ( 5 ,
GPU_R16F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_coc_lod1_img"  )

◆ image() [12/12]

DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] scatter_fg_indirect_buf inout_color_lod0_img out_color_lod2_img in_coc_lod0_img out_coc_lod2_img image ( 7 ,
GPU_R16F ,
Qualifier::WRITE ,
ImageType::FLOAT_2D ,
"out_coc_lod3_img"  )

◆ local_group_size()

dof_buf local_group_size ( DOF_GATHER_GROUP_SIZE ,
DOF_GATHER_GROUP_SIZE  )

◆ sampler() [1/12]

DOF_STABILIZE_GROUP_SIZE dof_buf sampler ( 0 ,
ImageType::FLOAT_2D ,
"coc_tx"  )

◆ sampler() [2/12]

DOF_DEFAULT_GROUP_SIZE dof_buf sampler ( 0 ,
ImageType::FLOAT_2D ,
"color_tx"  )

◆ sampler() [3/12]

DOF_REDUCE_GROUP_SIZE dof_buf sampler ( 0 ,
ImageType::FLOAT_2D ,
"downsample_tx"  )

◆ sampler() [4/12]

flat(Type::VEC4, "color_and_coc1") .flat(Type no_perspective(Type::VEC2, "rect_uv1") .no_perspective(Type draw_view sampler ( 0 ,
ImageType::FLOAT_2D ,
"occlusion_tx"  )

◆ sampler() [5/12]

DOF_STABILIZE_GROUP_SIZE dof_buf color_tx in_history_tx sampler(4, ImageType::DEPTH_2D, "depth_tx") .push_constant(Type DOF_DEFAULT_GROUP_SIZE color_tx sampler ( 1 ,
ImageType::FLOAT_2D ,
"coc_tx"  )

◆ sampler() [6/12]

dof_buf color_tx sampler ( 1 ,
ImageType::FLOAT_2D ,
"color_bilinear_tx"  )

◆ sampler() [7/12]

DOF_RESOLVE_GROUP_SIZE eevee_sampling_data depth_tx sampler ( 1 ,
ImageType::FLOAT_2D ,
"color_tx"  )

◆ sampler() [8/12]

DOF_FILTER_GROUP_SIZE color_tx sampler ( 1 ,
ImageType::FLOAT_2D ,
"weight_tx"  )

◆ sampler() [9/12]

DOF_STABILIZE_GROUP_SIZE dof_buf color_tx sampler ( 2 ,
ImageType::FLOAT_2D ,
"velocity_tx"  )

◆ sampler() [10/12]

DOF_RESOLVE_GROUP_SIZE eevee_sampling_data depth_tx color_bg_tx sampler ( 3 ,
ImageType::FLOAT_2D ,
"color_fg_tx"  )

◆ sampler() [11/12]

DOF_RESOLVE_GROUP_SIZE eevee_sampling_data depth_tx color_bg_tx color_hole_fill_tx sampler ( 7 ,
ImageType::FLOAT_2D ,
"weight_bg_tx"  )

◆ sampler() [12/12]

DOF_RESOLVE_GROUP_SIZE eevee_sampling_data depth_tx color_bg_tx color_hole_fill_tx weight_fg_tx sampler ( 9 ,
ImageType::FLOAT_2D ,
"weight_hole_fill_tx"  )

◆ specialization_constant()

DOF_RESOLVE_GROUP_SIZE specialization_constant ( Type::BOOL ,
"do_debug_color" ,
false  )

◆ storage_buf() [1/2]

DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] storage_buf ( 1 ,
Qualifier::WRITE ,
"ScatterRect" ,
"scatter_bg_list_buf" [] )

◆ storage_buf() [2/2]

DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] scatter_fg_indirect_buf storage_buf ( 3 ,
Qualifier::READ_WRITE ,
"DrawCommand" ,
"scatter_bg_indirect_buf"  )

◆ uniform_buf()

DOF_RESOLVE_GROUP_SIZE eevee_sampling_data uniform_buf ( 6 ,
"DepthOfFieldData" ,
"dof_buf"  )

Variable Documentation

◆ bokeh_lut_tx

bokeh_lut_tx

Definition at line 132 of file eevee_depth_of_field_info.hh.

◆ color_tx

◆ DepthOfFieldData

DOF_REDUCE_GROUP_SIZE DepthOfFieldData

Definition at line 16 of file eevee_depth_of_field_info.hh.

◆ draw_view

Definition at line 235 of file eevee_depth_of_field_info.hh.

◆ DrawCommand

DOF_REDUCE_GROUP_SIZE dof_buf scatter_fg_list_buf[] DrawCommand

◆ eevee_depth_of_field_no_lut

eevee_depth_of_field_no_lut

Definition at line 177 of file eevee_depth_of_field_info.hh.

◆ eevee_depth_of_field_tiles_common

DOF_RESOLVE_GROUP_SIZE eevee_depth_of_field_tiles_common

Definition at line 236 of file eevee_depth_of_field_info.hh.

◆ false

◆ GPU_R11F_G11F_B10F

◆ GPU_R16F

dof_buf color_tx coc_tx GPU_R16F

Definition at line 18 of file eevee_depth_of_field_info.hh.

◆ GPU_RGBA16F

Definition at line 55 of file eevee_depth_of_field_info.hh.

◆ in_tiles_bg_img

in_tiles_bg_img

Definition at line 114 of file eevee_depth_of_field_info.hh.

◆ out_weight_img

dof_buf color_tx coc_tx out_weight_img

Definition at line 165 of file eevee_depth_of_field_info.hh.

◆ ScatterRect

flat(Type::VEC4, "color_and_coc1") .flat(Type no_perspective(Type::VEC2, "rect_uv1") .no_perspective(Type draw_view bokeh_lut_tx ScatterRect

Definition at line 64 of file eevee_depth_of_field_info.hh.

◆ true