Blender
V3.3
|
#include "DRW_render.h"
#include "ED_screen.h"
#include "BLI_rand.h"
#include "DEG_depsgraph_query.h"
#include "GPU_texture.h"
#include "eevee_private.h"
Go to the source code of this file.
Macros | |
#define | FILTER_CDF_TABLE_SIZE 512 |
Variables | |
struct { | |
bool inited | |
float inverted_cdf [FILTER_CDF_TABLE_SIZE] | |
} | e_data = {false} |
Temporal super sampling technique
Definition in file eevee_temporal_sampling.c.
#define FILTER_CDF_TABLE_SIZE 512 |
Definition at line 21 of file eevee_temporal_sampling.c.
Definition at line 43 of file eevee_temporal_sampling.c.
References FILTER_CDF_TABLE_SIZE, float(), and x.
Referenced by eevee_create_cdf_table_temporal_sampling().
Definition at line 92 of file eevee_temporal_sampling.c.
References compute_cdf(), e_data, filter_blackman_harris(), FILTER_CDF_TABLE_SIZE, invert_cdf(), MEM_freeN, and MEM_mallocN.
Referenced by EEVEE_temporal_sampling_init().
void EEVEE_temporal_sampling_cache_init | ( | EEVEE_ViewLayerData * | sldata, |
EEVEE_Data * | vedata | ||
) |
Definition at line 330 of file eevee_temporal_sampling.c.
References EEVEE_ViewLayerData::combined, EEVEE_ViewLayerData::common_ubo, DefaultTextureList::depth, DRW_cache_fullscreen_quad_get(), DRW_PASS_CREATE, DRW_shgroup_call, DRW_shgroup_create(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_float(), DRW_shgroup_uniform_mat4(), DRW_shgroup_uniform_texture_ref(), DRW_STATE_WRITE_COLOR, DRW_viewport_texture_list_get(), EEVEE_shaders_taa_resolve_sh_get(), EFFECT_TAA, EFFECT_TAA_REPROJECT, EEVEE_StorageList::effects, EEVEE_EffectsInfo::enabled_effects, NULL, EEVEE_EffectsInfo::prev_drw_persmat, EEVEE_Data::psl, EEVEE_ViewLayerData::renderpass_ubo, sh, EEVEE_EffectsInfo::source_buffer, EEVEE_Data::stl, EEVEE_EffectsInfo::taa_alpha, EEVEE_TextureList::taa_history, EEVEE_PassList::taa_resolve, and EEVEE_Data::txl.
Referenced by eevee_cache_init(), and EEVEE_render_cache_init().
void EEVEE_temporal_sampling_create_view | ( | EEVEE_Data * | vedata | ) |
Definition at line 206 of file eevee_temporal_sampling.c.
References DRW_view_clip_planes_set(), DRW_view_create_sub(), DRW_view_default_get(), DRW_view_viewmat_get(), DRW_view_winmat_get(), EEVEE_StorageList::effects, NULL, EEVEE_Data::stl, and EEVEE_EffectsInfo::taa_view.
Referenced by eevee_render_to_image(), and EEVEE_temporal_sampling_init().
void EEVEE_temporal_sampling_draw | ( | EEVEE_Data * | vedata | ) |
Definition at line 360 of file eevee_temporal_sampling.c.
References EEVEE_FramebufferList::double_buffer_depth_fb, DRW_draw_pass(), DRW_state_is_image_render(), DRW_state_is_playback(), DRW_view_persmat_get(), DRW_viewport_request_redraw(), EEVEE_FramebufferList::effect_color_fb, EFFECT_TAA, EFFECT_TAA_REPROJECT, EEVEE_StorageList::effects, EEVEE_EffectsInfo::enabled_effects, EEVEE_Data::fbl, float(), EEVEE_StorageList::g_data, GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_framebuffer_bind(), GPU_framebuffer_blit(), EEVEE_FramebufferList::main_color_fb, EEVEE_FramebufferList::main_fb, NULL, EEVEE_EffectsInfo::prev_drw_persmat, EEVEE_Data::psl, EEVEE_Data::stl, SWAP_BUFFERS_TAA, EEVEE_EffectsInfo::taa_alpha, EEVEE_EffectsInfo::taa_current_sample, EEVEE_FramebufferList::taa_history_color_fb, EEVEE_EffectsInfo::taa_render_sample, EEVEE_PassList::taa_resolve, EEVEE_EffectsInfo::taa_total_sample, EEVEE_EffectsInfo::target_buffer, EEVEE_Data::txl, and EEVEE_PrivateData::valid_taa_history.
Referenced by EEVEE_draw_effects().
int EEVEE_temporal_sampling_init | ( | EEVEE_ViewLayerData * | UNUSEDsldata, |
EEVEE_Data * | vedata | ||
) |
Reset for each "redraw". When rendering using ogl render, we accumulate the redraw inside the drawing loop in eevee_draw_scene().
Definition at line 233 of file eevee_temporal_sampling.c.
References EEVEE_EffectsInfo::bypass_drawing, compare_m4m4(), CTX_wm_manager(), DEG_get_evaluated_scene(), DRWContextState::depsgraph, DRW_context_state_get(), DRW_state_draw_support(), DRW_state_is_image_render(), DRW_state_is_navigating(), DRW_state_is_opengl_render(), DRW_state_is_scene_render(), DRW_view_persmat_get(), e_data, ED_screen_animation_no_scrub(), Scene::eevee, eevee_create_cdf_table_temporal_sampling(), EEVEE_renderpasses_only_first_sample_pass_active(), EEVEE_temporal_sampling_create_view(), EEVEE_temporal_sampling_sample_count_get(), EFFECT_DEPTH_DOUBLE_BUFFER, EFFECT_DOUBLE_BUFFER, EFFECT_POST_BUFFER, EFFECT_TAA, EFFECT_TAA_REPROJECT, EFFECT_VELOCITY_BUFFER, EEVEE_StorageList::effects, DRWContextState::evil_C, SceneEEVEE::flag, EEVEE_StorageList::g_data, NULL, EEVEE_EffectsInfo::prev_drw_persmat, EEVEE_EffectsInfo::prev_drw_support, EEVEE_EffectsInfo::prev_is_navigating, EEVEE_PrivateData::queued_shaders_count_prev, SCE_EEVEE_TAA_REPROJECTION, EEVEE_Data::stl, EEVEE_EffectsInfo::taa_current_sample, EEVEE_EffectsInfo::taa_render_sample, EEVEE_EffectsInfo::taa_reproject_sample, SceneEEVEE::taa_samples, EEVEE_EffectsInfo::taa_total_sample, EEVEE_PrivateData::valid_double_buffer, and EEVEE_PrivateData::view_updated.
void EEVEE_temporal_sampling_matrices_calc | ( | EEVEE_EffectsInfo * | effects, |
const double | ht_point[2] | ||
) |
Definition at line 123 of file eevee_temporal_sampling.c.
References add_v2_v2(), BLI_assert, center, DRW_context_state_get(), DRW_view_persmat_get(), DRW_view_update_sub(), DRW_view_viewmat_get(), DRW_view_winmat_get(), DRW_viewport_size_get(), EEVEE_depth_of_field_jitter_get(), EEVEE_temporal_sampling_offset_calc(), RenderData::gauss, mul_project_m4_v3(), NULL, Scene::r, scene, DRWContextState::scene, sub_v2_v2v2(), EEVEE_EffectsInfo::taa_current_sample, EEVEE_EffectsInfo::taa_view, and window_translate_m4().
Referenced by EEVEE_render_draw(), and EEVEE_temporal_sampling_update_matrices().
void EEVEE_temporal_sampling_offset_calc | ( | const double | ht_point[2], |
const float | filter_size, | ||
float | r_offset[2] | ||
) |
Definition at line 115 of file eevee_temporal_sampling.c.
References e_data, and eval_table().
Referenced by eevee_lookdev_apply_taa(), and EEVEE_temporal_sampling_matrices_calc().
void EEVEE_temporal_sampling_reset | ( | EEVEE_Data * | vedata | ) |
Definition at line 200 of file eevee_temporal_sampling.c.
References EEVEE_StorageList::effects, EEVEE_Data::stl, EEVEE_EffectsInfo::taa_current_sample, and EEVEE_EffectsInfo::taa_render_sample.
Referenced by eevee_cache_finish(), eevee_draw_scene(), EEVEE_lookdev_init(), EEVEE_render_draw(), eevee_render_to_image(), and EEVEE_screen_raytrace_init().
int EEVEE_temporal_sampling_sample_count_get | ( | const Scene * | scene, |
const EEVEE_StorageList * | stl | ||
) |
Definition at line 218 of file eevee_temporal_sampling.c.
References divide_ceil_u(), DRW_state_is_image_render(), Scene::eevee, EEVEE_depth_of_field_sample_count_get(), EEVEE_StorageList::effects, EEVEE_StorageList::g_data, max_ii(), NULL, EEVEE_PrivateData::render_timesteps, scene, TAA_MAX_SAMPLE, SceneEEVEE::taa_render_samples, and SceneEEVEE::taa_samples.
Referenced by EEVEE_depth_of_field_init(), eevee_render_to_image(), and EEVEE_temporal_sampling_init().
void EEVEE_temporal_sampling_update_matrices | ( | EEVEE_Data * | vedata | ) |
Update the matrices based on the current sample.
DRW_MAT_PERS
and DRW_MAT_VIEW
needs to read the original matrices. Definition at line 184 of file eevee_temporal_sampling.c.
References BLI_halton_2d(), DRW_view_set_active(), EEVEE_temporal_sampling_matrices_calc(), EEVEE_StorageList::effects, EEVEE_EffectsInfo::taa_current_sample, and EEVEE_EffectsInfo::taa_view.
Referenced by eevee_draw_scene(), and EEVEE_effects_init().
Definition at line 80 of file eevee_temporal_sampling.c.
References CLAMP, FILTER_CDF_TABLE_SIZE, min_ii(), t, and x.
Referenced by EEVEE_temporal_sampling_offset_calc().
Definition at line 34 of file eevee_temporal_sampling.c.
References cosf, M_PI, width, and x.
Referenced by eevee_create_cdf_table_temporal_sampling().
|
static |
Definition at line 29 of file eevee_temporal_sampling.c.
|
static |
Definition at line 59 of file eevee_temporal_sampling.c.
References FILTER_CDF_TABLE_SIZE, float(), t, and x.
Referenced by eevee_create_cdf_table_temporal_sampling().
struct { ... } e_data |
bool inited |
Definition at line 25 of file eevee_temporal_sampling.c.
float inverted_cdf[FILTER_CDF_TABLE_SIZE] |
Definition at line 26 of file eevee_temporal_sampling.c.
Referenced by blender::eevee::Sampling::cdf_invert().