Blender
V3.3
|
#include "DRW_render.h"
#include "BKE_global.h"
#include "GPU_capabilities.h"
#include "GPU_platform.h"
#include "GPU_state.h"
#include "GPU_texture.h"
#include "eevee_private.h"
Go to the source code of this file.
Macros | |
#define | SETUP_BUFFER(tex, fb, fb_color) |
#define | CLEANUP_BUFFER(tex, fb, fb_color) |
Functions | |
void | EEVEE_effects_init (EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, Object *camera, const bool minimal) |
void | EEVEE_effects_cache_init (EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) |
void | EEVEE_effects_draw_init (EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) |
static void | max_downsample_cb (void *vedata, int level) |
static void | simple_downsample_cube_cb (void *vedata, int level) |
void | EEVEE_create_minmax_buffer (EEVEE_Data *vedata, GPUTexture *depth_src, int layer) |
static void | downsample_radiance_cb (void *vedata, int level) |
void | EEVEE_effects_downsample_radiance_buffer (EEVEE_Data *vedata, GPUTexture *texture_src) |
void | EEVEE_downsample_cube_buffer (EEVEE_Data *vedata, GPUTexture *texture_src, int level) |
static void | EEVEE_velocity_resolve (EEVEE_Data *vedata) |
void | EEVEE_draw_effects (EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) |
Variables | |
struct { | |
struct GPUTexture * depth_src | |
struct GPUTexture * color_src | |
int depth_src_layer | |
float texel_size [2] | |
} | e_data = {NULL} |
Gather all screen space effects technique such as Bloom, Motion Blur, DoF, SSAO, SSR, ...
Definition in file eevee_effects.c.
Definition at line 47 of file eevee_effects.c.
Definition at line 30 of file eevee_effects.c.
Definition at line 388 of file eevee_effects.c.
References EEVEE_PassList::color_downsample_ps, DRW_draw_pass(), e_data, EEVEE_TextureList::filtered_radiance, and GPU_texture_get_mipmap_size().
Referenced by EEVEE_effects_downsample_radiance_buffer().
void EEVEE_create_minmax_buffer | ( | EEVEE_Data * | vedata, |
GPUTexture * | depth_src, | ||
int | layer | ||
) |
Definition at line 356 of file eevee_effects.c.
References depth_src, DRW_draw_pass(), DRW_stats_group_end(), DRW_stats_group_start(), e_data, EEVEE_Data::fbl, GPU_DEVICE_INTEL_UHD, GPU_DRIVER_ANY, GPU_flush(), GPU_framebuffer_bind(), GPU_framebuffer_recursive_downsample(), GPU_mip_render_workaround(), GPU_OS_WIN, GPU_type_matches(), EEVEE_FramebufferList::main_fb, max_downsample_cb(), MAX_SCREEN_BUFFERS_LOD_LEVEL, EEVEE_PassList::maxz_copydepth_layer_ps, EEVEE_PassList::maxz_copydepth_ps, EEVEE_FramebufferList::maxzbuffer_fb, and EEVEE_Data::psl.
Referenced by eevee_draw_scene(), EEVEE_occlusion_output_accumulate(), EEVEE_render_draw(), and lightbake_render_scene_reflected().
void EEVEE_downsample_cube_buffer | ( | EEVEE_Data * | vedata, |
struct GPUTexture * | texture_src, | ||
int | level | ||
) |
Simple down-sampling algorithm for cube-map. Reconstruct mip chain up to mip level.
Definition at line 415 of file eevee_effects.c.
References EEVEE_FramebufferList::downsample_fb, DRW_stats_group_end(), DRW_stats_group_start(), e_data, EEVEE_Data::fbl, GPU_framebuffer_recursive_downsample(), GPU_framebuffer_texture_attach(), GPU_framebuffer_texture_detach(), and simple_downsample_cube_cb().
Referenced by EEVEE_lightbake_filter_diffuse(), and EEVEE_lightbake_filter_glossy().
void EEVEE_draw_effects | ( | EEVEE_ViewLayerData * | sldata, |
EEVEE_Data * | vedata | ||
) |
Definition at line 450 of file eevee_effects.c.
References EEVEE_TextureList::color, EEVEE_TextureList::color_double_buffer, DRW_state_is_image_render(), DRW_view_persmat_get(), DRW_viewport_request_redraw(), EEVEE_bloom_draw(), EEVEE_depth_of_field_draw(), EEVEE_lookdev_draw(), EEVEE_motion_blur_draw(), EEVEE_renderpasses_output_accumulate(), EEVEE_temporal_sampling_draw(), EEVEE_velocity_resolve(), EEVEE_FramebufferList::effect_color_fb, EFFECT_DOUBLE_BUFFER, EEVEE_FramebufferList::effect_fb, EFFECT_TAA, EEVEE_StorageList::effects, EEVEE_EffectsInfo::enabled_effects, EEVEE_Data::fbl, EEVEE_EffectsInfo::final_fb, EEVEE_EffectsInfo::final_tx, EEVEE_StorageList::g_data, if(), EEVEE_FramebufferList::main_color_fb, EEVEE_FramebufferList::main_fb, NULL, EEVEE_EffectsInfo::prev_persmat, EEVEE_EffectsInfo::source_buffer, EEVEE_Data::stl, EEVEE_EffectsInfo::swap_double_buffer, SWAP_DOUBLE_BUFFERS, EEVEE_TextureList::taa_history, EEVEE_FramebufferList::taa_history_fb, EEVEE_EffectsInfo::taa_view, EEVEE_EffectsInfo::target_buffer, EEVEE_Data::txl, EEVEE_PrivateData::valid_double_buffer, and EEVEE_PrivateData::valid_taa_history.
Referenced by eevee_draw_scene(), and EEVEE_render_draw().
void EEVEE_effects_cache_init | ( | EEVEE_ViewLayerData * | sldata, |
EEVEE_Data * | vedata | ||
) |
Definition at line 222 of file eevee_effects.c.
References EEVEE_MotionBlurData::camera, EEVEE_PassList::color_copy_ps, EEVEE_PassList::color_downsample_cube_ps, EEVEE_PassList::color_downsample_ps, EEVEE_ViewLayerData::combined, EEVEE_ViewLayerData::common_data, EEVEE_ViewLayerData::common_ubo, DRW_cache_fullscreen_quad_get(), DRW_PASS_CREATE, DRW_shgroup_call, DRW_shgroup_call_instances(), DRW_shgroup_call_procedural_triangles(), DRW_shgroup_create(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_float(), DRW_shgroup_uniform_int(), DRW_shgroup_uniform_int_copy(), DRW_shgroup_uniform_mat4(), DRW_shgroup_uniform_texture_ex(), DRW_shgroup_uniform_texture_ref(), DRW_shgroup_uniform_texture_ref_ex(), DRW_shgroup_uniform_vec2(), DRW_STATE_DEPTH_ALWAYS, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, e_data, EEVEE_shaders_effect_color_copy_sh_get(), EEVEE_shaders_effect_downsample_cube_sh_get(), EEVEE_shaders_effect_downsample_sh_get(), EEVEE_shaders_effect_maxz_copydepth_layer_sh_get(), EEVEE_shaders_effect_maxz_copydepth_sh_get(), EEVEE_shaders_effect_maxz_downlevel_sh_get(), EEVEE_shaders_velocity_resolve_sh_get(), EFFECT_RADIANCE_BUFFER, EFFECT_VELOCITY_BUFFER, EEVEE_StorageList::effects, EEVEE_EffectsInfo::enabled_effects, EEVEE_TextureList::filtered_radiance, GPU_BACKEND_OPENGL, GPU_DEVICE_INTEL, GPU_DRIVER_ANY, GPU_OS_ANY, GPU_SAMPLER_DEFAULT, GPU_SAMPLER_FILTER, GPU_type_matches_ex(), GPUBatch, EEVEE_PassList::maxz_copydepth_layer_ps, EEVEE_PassList::maxz_copydepth_ps, EEVEE_PassList::maxz_downlevel_ps, EEVEE_TextureList::maxzbuffer, MB_CURR, MB_NEXT, MB_PREV, EEVEE_EffectsInfo::motion_blur, NULL, EEVEE_MotionBlurData::persinv, EEVEE_MotionBlurData::persmat, EEVEE_Data::psl, quad, EEVEE_ViewLayerData::renderpass_ubo, EEVEE_CommonUniformBuffer::ssr_firefly_fac, EEVEE_Data::stl, EEVEE_Data::txl, and EEVEE_PassList::velocity_resolve.
Referenced by eevee_cache_init(), eevee_lightbake_cache_create(), and EEVEE_render_cache_init().
void EEVEE_effects_downsample_radiance_buffer | ( | EEVEE_Data * | vedata, |
struct GPUTexture * | texture_src | ||
) |
Simple down-sampling algorithm. Reconstruct mip chain up to mip level.
Definition at line 399 of file eevee_effects.c.
References EEVEE_PassList::color_copy_ps, downsample_radiance_cb(), DRW_draw_pass(), DRW_stats_group_end(), DRW_stats_group_start(), e_data, EEVEE_Data::fbl, GPU_framebuffer_bind(), GPU_framebuffer_recursive_downsample(), MAX_SCREEN_BUFFERS_LOD_LEVEL, EEVEE_Data::psl, and EEVEE_FramebufferList::radiance_filtered_fb.
Referenced by EEVEE_reflection_compute(), and EEVEE_refraction_compute().
void EEVEE_effects_draw_init | ( | EEVEE_ViewLayerData * | UNUSEDsldata, |
EEVEE_Data * | vedata | ||
) |
Setup double buffer so we can access last frame as it was before post processes.
Ping Pong buffer
Definition at line 302 of file eevee_effects.c.
References CLEANUP_BUFFER, EEVEE_TextureList::color_double_buffer, EEVEE_TextureList::color_post, EEVEE_FramebufferList::double_buffer_color_fb, EEVEE_FramebufferList::double_buffer_fb, DRW_viewport_texture_list_get(), EEVEE_FramebufferList::effect_color_fb, EFFECT_DOUBLE_BUFFER, EEVEE_FramebufferList::effect_fb, EFFECT_POST_BUFFER, EEVEE_StorageList::effects, EEVEE_EffectsInfo::enabled_effects, EEVEE_Data::fbl, SETUP_BUFFER, EEVEE_Data::stl, and EEVEE_Data::txl.
Referenced by eevee_cache_finish(), eevee_lightbake_cache_create(), and eevee_render_to_image().
void EEVEE_effects_init | ( | EEVEE_ViewLayerData * | sldata, |
EEVEE_Data * | vedata, | ||
Object * | camera, | ||
const bool | minimal | ||
) |
MinMax Pyramid
Compute hiZ texel alignment.
Color buffer with correct down-sampling alignment. Used for SSReflections & SSRefractions.
Normal buffer for deferred passes.
Motion vector buffer for correct TAA / motion blur.
Setup depth double buffer.
Definition at line 56 of file eevee_effects.c.
References camera, CLEANUP_BUFFER, EEVEE_ViewLayerData::common_data, EEVEE_TextureList::depth_double_buffer, divide_ceil_u(), EEVEE_FramebufferList::double_buffer_depth_fb, EEVEE_FramebufferList::downsample_fb, draw_engine_eevee_type, DRW_TEX_FILTER, DRW_TEX_MIPMAP, DRW_texture_ensure_2d(), DRW_texture_ensure_fullscreen_2d(), DRW_TEXTURE_FREE_SAFE, DRW_texture_pool_query_2d(), DRW_viewport_size_get(), DRW_viewport_texture_list_get(), EEVEE_bloom_init(), EEVEE_depth_of_field_init(), EEVEE_lookdev_init(), EEVEE_motion_blur_init(), EEVEE_occlusion_init(), EEVEE_RENDER_PASS_NORMAL, EEVEE_screen_raytrace_init(), EEVEE_subsurface_init(), EEVEE_temporal_sampling_init(), EEVEE_temporal_sampling_update_matrices(), EEVEE_volumes_init(), EFFECT_DEPTH_DOUBLE_BUFFER, EFFECT_NORMAL_BUFFER, EFFECT_RADIANCE_BUFFER, EFFECT_TAA, EFFECT_TAA_REPROJECT, EFFECT_VELOCITY_BUFFER, EEVEE_StorageList::effects, EEVEE_EffectsInfo::enabled_effects, EEVEE_Data::fbl, EEVEE_TextureList::filtered_radiance, G, EEVEE_StorageList::g_data, GPU_BACKEND_OPENGL, GPU_DEPTH24_STENCIL8, GPU_DEPTH_COMPONENT24, GPU_DEVICE_INTEL, GPU_DRIVER_ANY, GPU_framebuffer_create(), GPU_framebuffer_texture_attach(), GPU_OS_ANY, GPU_R11F_G11F_B10F, GPU_R32F, GPU_RG16, GPU_RGBA16, GPU_type_matches_ex(), EEVEE_EffectsInfo::hiz_size, EEVEE_CommonUniformBuffer::hiz_uv_scale, EEVEE_FramebufferList::main_fb, MAX_SCREEN_BUFFERS_LOD_LEVEL, EEVEE_TextureList::maxzbuffer, EEVEE_FramebufferList::maxzbuffer_fb, MEM_callocN, NULL, EEVEE_FramebufferList::radiance_filtered_fb, EEVEE_PrivateData::render_passes, SETUP_BUFFER, EEVEE_EffectsInfo::ssr_normal_input, EEVEE_CommonUniformBuffer::ssr_pixelsize, EEVEE_Data::stl, EEVEE_TextureList::taa_history, EEVEE_FramebufferList::taa_history_color_fb, EEVEE_FramebufferList::taa_history_fb, EEVEE_EffectsInfo::taa_render_sample, EEVEE_Data::txl, UNPACK2, EEVEE_FramebufferList::velocity_fb, EEVEE_FramebufferList::velocity_resolve_fb, and EEVEE_EffectsInfo::velocity_tx.
Referenced by eevee_engine_init(), eevee_lightbake_cache_create(), and EEVEE_render_modules_init().
|
static |
Definition at line 429 of file eevee_effects.c.
References DefaultTextureList::depth, DRW_draw_pass(), DRW_viewport_texture_list_get(), e_data, EFFECT_VELOCITY_BUFFER, EEVEE_StorageList::effects, EEVEE_EffectsInfo::enabled_effects, EEVEE_Data::fbl, GPU_framebuffer_bind(), EEVEE_Data::psl, EEVEE_Data::stl, EEVEE_FramebufferList::velocity_fb, EEVEE_PassList::velocity_object, EEVEE_PassList::velocity_resolve, and EEVEE_FramebufferList::velocity_resolve_fb.
Referenced by EEVEE_draw_effects().
Definition at line 337 of file eevee_effects.c.
References DRW_draw_pass(), e_data, GPU_texture_get_mipmap_size(), EEVEE_PassList::maxz_downlevel_ps, and EEVEE_TextureList::maxzbuffer.
Referenced by EEVEE_create_minmax_buffer().
Definition at line 348 of file eevee_effects.c.
References EEVEE_PassList::color_downsample_cube_ps, DRW_draw_pass(), e_data, float(), and GPU_texture_width().
Referenced by EEVEE_downsample_cube_buffer().
struct GPUTexture* color_src |
Definition at line 23 of file eevee_effects.c.
struct GPUTexture* depth_src |
Definition at line 22 of file eevee_effects.c.
Referenced by EEVEE_create_minmax_buffer(), and EEVEE_subsurface_add_pass().
int depth_src_layer |
Definition at line 25 of file eevee_effects.c.
struct { ... } e_data |
float texel_size[2] |
Definition at line 27 of file eevee_effects.c.
Referenced by studiolight_irradiance_preview(), studiolight_matcap_preview(), and studiolight_radiance_preview().