Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_depth_of_field.c
| Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | if ((effects->enabled_effects & EFFECT_DOF) != 0) { | ||||
| /** Depth of Field algorithm | /** Depth of Field algorithm | ||||
| * | * | ||||
| * Overview : | * Overview : | ||||
| * - Downsample the color buffer into 2 buffers weighted with | * - Downsample the color buffer into 2 buffers weighted with | ||||
| * CoC values. Also output CoC into a texture. | * CoC values. Also output CoC into a texture. | ||||
| * - Shoot quads for every pixel and expand it depending on the CoC. | * - Shoot quads for every pixel and expand it depending on the CoC. | ||||
| * Do one pass for near Dof and one pass for far Dof. | * Do one pass for near Dof and one pass for far Dof. | ||||
| * - Finally composite the 2 blurred buffers with the original render. | * - Finally composite the 2 blurred buffers with the original render. | ||||
| **/ | */ | ||||
| DRWShadingGroup *grp; | DRWShadingGroup *grp; | ||||
| struct GPUBatch *quad = DRW_cache_fullscreen_quad_get(); | struct GPUBatch *quad = DRW_cache_fullscreen_quad_get(); | ||||
| const bool use_alpha = !DRW_state_draw_background(); | const bool use_alpha = !DRW_state_draw_background(); | ||||
| psl->dof_down = DRW_pass_create("DoF Downsample", DRW_STATE_WRITE_COLOR); | psl->dof_down = DRW_pass_create("DoF Downsample", DRW_STATE_WRITE_COLOR); | ||||
| grp = DRW_shgroup_create(e_data.dof_downsample_sh[use_alpha], psl->dof_down); | grp = DRW_shgroup_create(e_data.dof_downsample_sh[use_alpha], psl->dof_down); | ||||
| DRW_shgroup_uniform_texture_ref(grp, "colorBuffer", &effects->source_buffer); | DRW_shgroup_uniform_texture_ref(grp, "colorBuffer", &effects->source_buffer); | ||||
| ▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines | |||||