Blender
V3.3
|
#include "BLI_string_utils.h"
#include "BLI_sys_types.h"
#include "BKE_object.h"
#include "DEG_depsgraph_query.h"
#include "eevee_private.h"
Go to the source code of this file.
Macros | |
#define | SH_CASTER_ALLOC_CHUNK 32 |
Functions | |
void | eevee_contact_shadow_setup (const Light *la, EEVEE_Shadow *evsh) |
void | EEVEE_shadows_init (EEVEE_ViewLayerData *sldata) |
void | EEVEE_shadows_cache_init (EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) |
void | EEVEE_shadows_caster_register (EEVEE_ViewLayerData *sldata, Object *ob) |
static bool | sphere_bbox_intersect (const BoundSphere *bs, const EEVEE_BoundBox *bb) |
void | EEVEE_shadows_update (EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) |
void | EEVEE_shadows_draw (EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRWView *view) |
Render Passes | |
void | EEVEE_shadow_output_init (EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, uint UNUSED(tot_samples)) |
void | EEVEE_shadow_output_accumulate (EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) |
#define SH_CASTER_ALLOC_CHUNK 32 |
Definition at line 17 of file eevee_shadows.c.
void eevee_contact_shadow_setup | ( | const Light * | la, |
EEVEE_Shadow * | evsh | ||
) |
Definition at line 19 of file eevee_shadows.c.
References EEVEE_Shadow::contact_bias, Light::contact_bias, EEVEE_Shadow::contact_dist, Light::contact_dist, EEVEE_Shadow::contact_thickness, Light::contact_thickness, LA_SHAD_CONTACT, and Light::mode.
Referenced by EEVEE_shadows_cascade_add(), and EEVEE_shadows_cube_add().
void EEVEE_shadow_output_accumulate | ( | EEVEE_ViewLayerData * | UNUSEDsldata, |
EEVEE_Data * | vedata | ||
) |
Definition at line 374 of file eevee_shadows.c.
References clear(), DRW_draw_pass(), EEVEE_StorageList::effects, EEVEE_Data::fbl, GPU_framebuffer_bind(), EEVEE_FramebufferList::main_fb, NULL, EEVEE_Data::psl, EEVEE_FramebufferList::shadow_accum_fb, EEVEE_PassList::shadow_accum_pass, EEVEE_Data::stl, and EEVEE_EffectsInfo::taa_current_sample.
void EEVEE_shadow_output_init | ( | EEVEE_ViewLayerData * | sldata, |
EEVEE_Data * | vedata, | ||
uint | UNUSEDtot_samples | ||
) |
Definition at line 338 of file eevee_shadows.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_texture(), DRW_shgroup_uniform_texture_ref(), DRW_STATE_BLEND_ADD_FULL, DRW_STATE_DEPTH_ALWAYS, DRW_STATE_WRITE_COLOR, DRW_texture_ensure_fullscreen_2d(), DRW_viewport_texture_list_get(), EEVEE_materials_get_util_tex(), EEVEE_shaders_shadow_accum_sh_get(), EEVEE_Data::fbl, GPU_R32F, EEVEE_ViewLayerData::grid_ubo, EEVEE_ViewLayerData::light_ubo, NULL, EEVEE_ViewLayerData::planar_ubo, EEVEE_ViewLayerData::probe_ubo, EEVEE_Data::psl, EEVEE_ViewLayerData::renderpass_ubo, EEVEE_TextureList::shadow_accum, EEVEE_FramebufferList::shadow_accum_fb, EEVEE_PassList::shadow_accum_pass, EEVEE_ViewLayerData::shadow_cascade_pool, EEVEE_ViewLayerData::shadow_cube_pool, EEVEE_ViewLayerData::shadow_ubo, and EEVEE_Data::txl.
void EEVEE_shadows_cache_init | ( | EEVEE_ViewLayerData * | sldata, |
EEVEE_Data * | vedata | ||
) |
Definition at line 81 of file eevee_shadows.c.
References BLI_bitmap_set_all(), EEVEE_LightsInfo::cascade_len, EEVEE_LightsInfo::cube_len, DRW_PASS_CREATE, DRW_shgroup_create(), DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_SHADOW_OFFSET, DRW_STATE_WRITE_DEPTH, EEVEE_shaders_shadow_sh_get(), EEVEE_ShadowCasterBuffer, EEVEE_StorageList::g_data, INIT_MINMAX, EEVEE_ViewLayerData::lights, EEVEE_LightsInfo::max, EEVEE_LightsInfo::min, EEVEE_LightsInfo::num_cascade_layer, EEVEE_LightsInfo::num_cube_layer, EEVEE_Data::psl, EEVEE_LightsInfo::shadow_len, EEVEE_PassList::shadow_pass, EEVEE_PrivateData::shadow_shgrp, EEVEE_LightsInfo::shcaster_aabb, EEVEE_LightsInfo::shcaster_backbuffer, EEVEE_LightsInfo::shcaster_frontbuffer, state, and EEVEE_Data::stl.
Referenced by EEVEE_lights_cache_init().
void EEVEE_shadows_caster_register | ( | EEVEE_ViewLayerData * | sldata, |
struct Object * | ob | ||
) |
Make that object update shadow casting lights inside its influence bounding box.
Definition at line 111 of file eevee_shadows.c.
References add_v3_v3v3(), Object::base_flag, BASE_FROM_DUPLI, BKE_object_boundbox_get(), BLI_BITMAP_ENABLE, BLI_BITMAP_RESIZE, BLI_BITMAP_SET, EEVEE_BoundBox::center, copy_v3_v3(), count, EEVEE_object_data_ensure(), EEVEE_ShadowCasterBuffer, fabsf, EEVEE_BoundBox::halfdim, id, INIT_MINMAX, EEVEE_ViewLayerData::lights, EEVEE_LightsInfo::max, max, MEM_reallocN, min, EEVEE_LightsInfo::min, minmax_v3v3_v3(), mul_m4_v3(), mul_v3_fl(), EEVEE_ObjectEngineData::need_update, Object::obmat, EEVEE_ObjectEngineData::shadow_caster_id, EEVEE_LightsInfo::shcaster_aabb, EEVEE_LightsInfo::shcaster_backbuffer, EEVEE_LightsInfo::shcaster_frontbuffer, sub_v3_v3v3(), update(), and BoundBox::vec.
Referenced by EEVEE_cache_populate(), and EEVEE_render_cache().
void EEVEE_shadows_draw | ( | EEVEE_ViewLayerData * | sldata, |
EEVEE_Data * | vedata, | ||
struct DRWView * | view | ||
) |
This refresh lights shadow buffers.
Definition at line 285 of file eevee_shadows.c.
References BLI_BITMAP_ENABLE, BLI_BITMAP_NEW_ALLOCA, BLI_BITMAP_TEST, EEVEE_LightsInfo::cascade_len, EEVEE_ViewLayerData::common_data, EEVEE_ViewLayerData::common_ubo, EEVEE_LightsInfo::cube_len, DRW_culling_sphere_test(), DRW_stats_group_end(), DRW_stats_group_start(), DRW_view_set_active(), EEVEE_RAY_SHADOW, EEVEE_shadows_draw_cascades(), EEVEE_shadows_draw_cubemap(), GPU_uniformbuf_update(), EEVEE_ViewLayerData::lights, MAX_SHADOW_CUBE, EEVEE_CommonUniformBuffer::ray_type, EEVEE_LightsInfo::sh_cube_update, EEVEE_LightsInfo::shadow_bounds, EEVEE_LightsInfo::shadow_data, EEVEE_ViewLayerData::shadow_ubo, and view.
Referenced by eevee_draw_scene(), EEVEE_render_draw(), lightbake_render_scene_face(), and lightbake_render_scene_reflected().
void EEVEE_shadows_init | ( | EEVEE_ViewLayerData * | sldata | ) |
Definition at line 26 of file eevee_shadows.c.
References BLI_assert, BLI_BITMAP_NEW, CLAMP, DEG_get_evaluated_scene(), DRW_context_state_get(), DRW_TEXTURE_FREE_SAFE, Scene::eevee, EEVEE_ShadowCasterBuffer, SceneEEVEE::flag, GPU_uniformbuf_create_ex(), EEVEE_ViewLayerData::light_ubo, EEVEE_ViewLayerData::lights, MAX_LIGHT, MAX_SHADOW, MAX_SHADOW_CASCADE, MAX_SHADOW_CUBE, MEM_callocN, MEM_mallocN, NULL, SCE_EEVEE_SHADOW_HIGH_BITDEPTH, SCE_EEVEE_SHADOW_SOFT, SH_CASTER_ALLOC_CHUNK, EEVEE_ViewLayerData::shadow_cascade_pool, EEVEE_LightsInfo::shadow_cascade_size, SceneEEVEE::shadow_cascade_size, EEVEE_ViewLayerData::shadow_cube_pool, EEVEE_LightsInfo::shadow_cube_size, SceneEEVEE::shadow_cube_size, EEVEE_LightsInfo::shadow_high_bitdepth, EEVEE_ViewLayerData::shadow_ubo, EEVEE_LightsInfo::shcaster_backbuffer, EEVEE_LightsInfo::shcaster_frontbuffer, EEVEE_ViewLayerData::shcasters_buffers, EEVEE_LightsInfo::soft_shadows, and SWAP.
Referenced by eevee_engine_init(), eevee_lightbake_cache_create(), and EEVEE_render_modules_init().
void EEVEE_shadows_update | ( | EEVEE_ViewLayerData * | sldata, |
EEVEE_Data * | vedata | ||
) |
Definition at line 188 of file eevee_shadows.c.
References BLI_BITMAP_ENABLE, BLI_BITMAP_RESIZE, BLI_bitmap_set_all(), BLI_BITMAP_TEST, EEVEE_LightsInfo::cache_num_cascade_layer, EEVEE_LightsInfo::cache_num_cube_layer, EEVEE_LightsInfo::cube_len, divide_ceil_u(), DRW_TEX_COMPARE, DRW_TEX_FILTER, DRW_texture_create_2d_array(), DRW_TEXTURE_FREE_SAFE, EEVEE_ShadowCasterBuffer, EEVEE_shadows_cube_setup(), EEVEE_StorageList::effects, GPU_DEPTH_COMPONENT16, GPU_DEPTH_COMPONENT24, GPU_framebuffer_create(), EEVEE_LightsInfo::light_data, EEVEE_ViewLayerData::lights, max_ii(), MAX_LIGHT, MEM_reallocN, NULL, EEVEE_LightsInfo::num_cascade_layer, EEVEE_LightsInfo::num_cube_layer, SH_CASTER_ALLOC_CHUNK, EEVEE_LightsInfo::sh_cube_update, EEVEE_LightsInfo::shadow_bounds, EEVEE_ViewLayerData::shadow_cascade_pool, EEVEE_LightsInfo::shadow_cascade_size, EEVEE_LightsInfo::shadow_cube_light_indices, EEVEE_ViewLayerData::shadow_cube_pool, EEVEE_LightsInfo::shadow_cube_size, EEVEE_ViewLayerData::shadow_fb, EEVEE_LightsInfo::shadow_high_bitdepth, EEVEE_LightsInfo::shcaster_backbuffer, EEVEE_LightsInfo::shcaster_frontbuffer, sphere_bbox_intersect(), EEVEE_Data::stl, and EEVEE_EffectsInfo::taa_current_sample.
Referenced by eevee_draw_scene(), eevee_lightbake_cache_create(), and EEVEE_render_draw().
|
static |
Definition at line 177 of file eevee_shadows.c.
References EEVEE_BoundBox::center, BoundSphere::center, fabsf, EEVEE_BoundBox::halfdim, BoundSphere::radius, x, y, and z.
Referenced by EEVEE_shadows_update().