Blender
V3.3
|
#include "DRW_render.h"
#include "BKE_global.h"
#include "BLI_endian_switch.h"
#include "BLI_threads.h"
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.h"
#include "BKE_object.h"
#include "DNA_collection_types.h"
#include "DNA_lightprobe_types.h"
#include "PIL_time.h"
#include "eevee_lightcache.h"
#include "eevee_private.h"
#include "GPU_capabilities.h"
#include "GPU_context.h"
#include "WM_api.h"
#include "WM_types.h"
#include "BLO_read_write.h"
#include "wm_window.h"
Go to the source code of this file.
Classes | |
struct | EEVEE_LightBake |
Macros | |
#define | IRRADIANCE_SAMPLE_SIZE_X 4 /* 3 in reality */ |
#define | IRRADIANCE_SAMPLE_SIZE_Y 2 |
#define | IRRADIANCE_FORMAT GPU_RGBA8 |
#define | IRRADIANCE_MAX_POOL_LAYER 256 |
#define | IRRADIANCE_MAX_POOL_SIZE 1024 |
#define | MAX_IRRADIANCE_SAMPLES |
Typedefs | |
typedef struct EEVEE_LightBake | EEVEE_LightBake |
Eevee's indirect lighting cache.
Definition in file eevee_lightcache.c.
Definition at line 53 of file eevee_lightcache.c.
#define IRRADIANCE_MAX_POOL_LAYER 256 |
Definition at line 57 of file eevee_lightcache.c.
#define IRRADIANCE_MAX_POOL_SIZE 1024 |
Definition at line 58 of file eevee_lightcache.c.
#define IRRADIANCE_SAMPLE_SIZE_X 4 /* 3 in reality */ |
Definition at line 45 of file eevee_lightcache.c.
#define IRRADIANCE_SAMPLE_SIZE_Y 2 |
Definition at line 46 of file eevee_lightcache.c.
#define MAX_IRRADIANCE_SAMPLES |
Definition at line 59 of file eevee_lightcache.c.
#define SORT_PROBE | ( | elems_type, | |
prbs, | |||
elems, | |||
elems_len, | |||
comp_fn | |||
) |
Definition at line 1253 of file eevee_lightcache.c.
typedef struct EEVEE_LightBake EEVEE_LightBake |
|
static |
Definition at line 1041 of file eevee_lightcache.c.
References LightGridCache::resolution.
Referenced by compute_cell_id().
|
static |
Definition at line 1049 of file eevee_lightcache.c.
References BLI_assert, cell_id_to_grid_loc(), floorf, LightProbe::grid_resolution_x, LightProbe::grid_resolution_y, LightProbe::grid_resolution_z, and MAX3.
Referenced by eevee_lightbake_render_grid_sample().
|
static |
Definition at line 542 of file eevee_lightcache.c.
References BLI_endian_switch_float_array(), BLI_endian_switch_uint32_array(), BLO_read_data_address, BLO_read_requires_endian_switch(), LightCacheTexture::components, LightCacheTexture::data, LightCacheTexture::data_type, LIGHTCACHETEX_FLOAT, LIGHTCACHETEX_UINT, NULL, LightCacheTexture::tex, LightCacheTexture::tex_size, and zero_v3_int().
Referenced by EEVEE_lightcache_blend_read_data().
Referenced by eevee_lightbake_context_disable(), and eevee_lightbake_delete_resources().
Needs to be called AFTER DRW_opengl_render_context_enable().
Definition at line 3179 of file draw_manager.c.
Referenced by DRW_render_context_enable(), eevee_lightbake_context_enable(), and eevee_lightbake_delete_resources().
Definition at line 3157 of file draw_manager.c.
Referenced by DRW_engines_free(), DRW_render_context_disable(), eevee_lightbake_context_disable(), and eevee_lightbake_delete_resources().
Definition at line 3147 of file draw_manager.c.
Referenced by DRW_engines_free(), DRW_render_context_enable(), eevee_lightbake_context_enable(), and eevee_lightbake_delete_resources().
Definition at line 3172 of file draw_manager.c.
Referenced by DRW_render_context_disable(), eevee_lightbake_context_disable(), and eevee_lightbake_delete_resources().
Definition at line 3162 of file draw_manager.c.
Referenced by DRW_render_context_enable(), eevee_lightbake_context_enable(), and eevee_lightbake_delete_resources().
|
static |
Definition at line 892 of file eevee_lightcache.c.
References EEVEE_PrivateData::background_alpha, EEVEE_LightProbeVisTest::cached, EEVEE_LightProbeVisTest::collection, EEVEE_TextureList::color, DEG_get_evaluated_scene(), EEVEE_LightBake::depsgraph, DRW_curves_update(), DRW_render_instance_buffer_finish(), DRW_render_object_iter(), DRW_render_viewport_size_set(), DRW_view_create(), DRW_view_default_get(), DRW_view_default_set(), DRW_view_set_active(), Scene::eevee, EEVEE_effects_cache_init(), EEVEE_effects_draw_init(), EEVEE_effects_init(), EEVEE_lightbake_cache_init(), EEVEE_lightprobes_cache_finish(), EEVEE_lightprobes_cache_init(), EEVEE_lightprobes_init(), EEVEE_lights_cache_finish(), EEVEE_lights_cache_init(), EEVEE_materials_cache_finish(), EEVEE_materials_cache_init(), EEVEE_materials_init(), EEVEE_render_cache(), EEVEE_shadows_init(), EEVEE_shadows_update(), EEVEE_subsurface_cache_init(), EEVEE_subsurface_draw_init(), EEVEE_view_layer_data_ensure(), EEVEE_volumes_cache_finish(), EEVEE_volumes_cache_init(), EEVEE_volumes_draw_init(), EFFECT_VOLUMETRIC, EEVEE_StorageList::effects, EEVEE_EffectsInfo::enabled_effects, EEVEE_Data::fbl, LightProbe::flag, SceneEEVEE::flag, EEVEE_StorageList::g_data, SceneEEVEE::gi_irradiance_smoothing, GPU_texture_height(), GPU_texture_width(), EEVEE_LightProbeVisTest::invert, LIGHTPROBE_FLAG_INVERT_GROUP, MEM_callocN, negate_v3(), NULL, EEVEE_LightBake::probe, EEVEE_ViewLayerData::probes, EEVEE_PrivateData::render_timesteps, EEVEE_LightBake::rt_color, EEVEE_LightBake::rt_depth, SCE_EEVEE_SHADOW_HIGH_BITDEPTH, EEVEE_LightBake::sldata, EEVEE_Data::stl, SceneEEVEE::taa_samples, EEVEE_Data::txl, unit_m4(), view, EEVEE_LightProbesInfo::vis_data, and LightProbe::visibility_grp.
Referenced by eevee_lightbake_render_grid_sample(), eevee_lightbake_render_probe_sample(), and eevee_lightbake_render_world_sample().
|
static |
Definition at line 609 of file eevee_lightcache.c.
References BLI_thread_is_main(), DRW_gpu_render_context_disable(), DRW_opengl_context_disable(), DRW_opengl_render_context_disable(), EEVEE_LightBake::gl_context, EEVEE_LightBake::gpu_context, GPU_context_main_unlock(), and GPU_use_main_context_workaround().
Referenced by EEVEE_lightbake_job(), and lightbake_do_sample().
|
static |
Definition at line 589 of file eevee_lightcache.c.
References BLI_thread_is_main(), DRW_gpu_render_context_enable(), DRW_opengl_context_enable(), DRW_opengl_render_context_enable(), EEVEE_LightBake::gl_context, EEVEE_LightBake::gpu_context, GPU_context_create(), GPU_context_main_lock(), GPU_use_main_context_workaround(), and NULL.
Referenced by EEVEE_lightbake_job(), and lightbake_do_sample().
|
static |
Definition at line 971 of file eevee_lightcache.c.
References DRW_TEX_FILTER, DRW_texture_create_2d_array(), DRW_TEXTURE_FREE_SAFE, GPU_DATA_FLOAT, GPU_texture_read(), EEVEE_LightBake::grid_prev, LightCache::grid_tx, EEVEE_LightBake::irr_size, IRRADIANCE_FORMAT, MEM_freeN, tex, and LightCacheTexture::tex.
Referenced by eevee_lightbake_render_grid_sample(), and eevee_lightbake_render_world_sample().
|
static |
Definition at line 632 of file eevee_lightcache.c.
References BKE_object_visibility(), EEVEE_LightBake::cube_len, DAG_EVAL_RENDER, DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN, DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END, depsgraph, EEVEE_LightBake::depsgraph, EEVEE_PROBE_MAX, EEVEE_LightBake::grid_len, LightProbe::grid_resolution_x, LightProbe::grid_resolution_y, LightProbe::grid_resolution_z, if(), LIGHTPROBE_TYPE_CUBE, LIGHTPROBE_TYPE_GRID, OB_LIGHTPROBE, OB_VISIBLE_SELF, EEVEE_LightBake::total_irr_samples, and LightProbe::type.
Referenced by EEVEE_lightbake_job().
|
static |
Definition at line 661 of file eevee_lightcache.c.
References DRW_TEX_FILTER, DRW_TEX_MIPMAP, DRW_texture_create_cube(), GPU_DEPTH_COMPONENT24, GPU_RGBA16F, NULL, EEVEE_LightBake::rt_color, EEVEE_LightBake::rt_depth, EEVEE_LightBake::rt_fb, and EEVEE_LightBake::store_fb.
Referenced by EEVEE_lightbake_job(), and EEVEE_lightbake_update_world_quick().
|
static |
Definition at line 676 of file eevee_lightcache.c.
References EEVEE_LightBake::bounce_len, EEVEE_LightBake::cube_len, LightCache::cube_len, EEVEE_LightBake::cube_prb, DEG_get_evaluated_scene(), EEVEE_LightBake::depsgraph, DRW_TEX_FILTER, DRW_texture_create_2d_array(), Scene::eevee, EEVEE_lightcache_create(), EEVEE_lightcache_load(), EEVEE_lightcache_validate(), LightCache::flag, SceneEEVEE::gi_cubemap_resolution, SceneEEVEE::gi_diffuse_bounces, SceneEEVEE::gi_visibility_resolution, EEVEE_LightBake::grid_len, EEVEE_LightBake::grid_prb, EEVEE_LightBake::grid_prev, EEVEE_LightBake::irr_size, IRRADIANCE_FORMAT, irradiance_pool_size_get(), EEVEE_LightBake::lcache, SceneEEVEE::light_cache_data, LIGHTCACHE_BAKING, MEM_callocN, NULL, EEVEE_LightBake::own_light_cache, EEVEE_LightBake::ref_cube_res, EEVEE_LightBake::rt_res, EEVEE_LightBake::total_irr_samples, and EEVEE_LightBake::vis_res.
Referenced by EEVEE_lightbake_job().
|
static |
Definition at line 1246 of file eevee_lightcache.c.
References eevee_lightbake_cube_influence_volume().
Referenced by eevee_lightbake_gather_probes().
|
static |
Definition at line 1234 of file eevee_lightcache.c.
References LightProbeCache::attenuationmat, and mat4_to_scale().
Referenced by eevee_lightbake_cube_comp().
|
static |
Definition at line 838 of file eevee_lightcache.c.
References BLI_mutex_lock(), BLI_mutex_unlock(), DRW_gpu_render_context_disable(), DRW_gpu_render_context_enable(), DRW_opengl_context_disable(), DRW_opengl_context_enable(), DRW_opengl_render_context_disable(), DRW_opengl_render_context_enable(), DRW_TEXTURE_FREE_SAFE, EEVEE_view_layer_data_free(), EEVEE_LightBake::gl_context, EEVEE_LightBake::gpu_context, GPU_context_discard(), EEVEE_LightBake::grid_prev, EEVEE_LightBake::mutex, NULL, EEVEE_LightBake::own_resources, EEVEE_LightBake::resource_only, EEVEE_LightBake::rt_color, EEVEE_LightBake::rt_depth, EEVEE_LightBake::rt_fb, EEVEE_LightBake::sldata, EEVEE_LightBake::store_fb, and WM_opengl_context_dispose().
Referenced by EEVEE_lightbake_job(), and EEVEE_lightbake_update_world_quick().
|
static |
Definition at line 1269 of file eevee_lightcache.c.
References BKE_object_visibility(), EEVEE_LightBake::bounce_len, LightCache::cube_data, EEVEE_LightBake::cube_len, EEVEE_LightBake::cube_prb, DAG_EVAL_RENDER, DEG_get_evaluated_scene(), DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN, DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END, depsgraph, EEVEE_LightBake::depsgraph, EEVEE_LightBake::done, Scene::eevee, eevee_lightbake_cube_comp(), eevee_lightbake_grid_comp(), EEVEE_lightprobes_cube_data_from_object(), EEVEE_lightprobes_grid_data_from_object(), EEVEE_PROBE_MAX, LightCache::grid_data, EEVEE_LightBake::grid_len, EEVEE_LightBake::grid_prb, if(), SceneEEVEE::light_cache_data, LIGHTPROBE_TYPE_CUBE, LIGHTPROBE_TYPE_GRID, OB_LIGHTPROBE, OB_VISIBLE_SELF, SORT_PROBE, EEVEE_LightBake::total, EEVEE_LightBake::total_irr_samples, and LightProbe::type.
Referenced by EEVEE_lightbake_job().
|
static |
Definition at line 1239 of file eevee_lightcache.c.
References eevee_lightbake_grid_influence_volume().
Referenced by eevee_lightbake_gather_probes().
|
static |
Definition at line 1229 of file eevee_lightcache.c.
References LightGridCache::mat, and mat4_to_scale().
Referenced by eevee_lightbake_grid_comp().
Definition at line 1359 of file eevee_lightcache.c.
References BLI_assert, BLI_thread_is_main(), EEVEE_LightBake::bounce_curr, EEVEE_LightBake::bounce_len, EEVEE_LightBake::cube, LightCache::cube_data, EEVEE_LightBake::cube_len, EEVEE_LightBake::cube_offset, EEVEE_LightBake::cube_prb, DEG_evaluate_on_framechange(), DEG_get_evaluated_view_layer(), DEG_graph_relations_update(), EEVEE_LightBake::delay, depsgraph, EEVEE_LightBake::depsgraph, EEVEE_LightBake::do_update, eevee_lightbake_context_disable(), eevee_lightbake_context_enable(), eevee_lightbake_count_probes(), eevee_lightbake_create_render_target(), eevee_lightbake_create_resources(), eevee_lightbake_delete_resources(), eevee_lightbake_gather_probes(), eevee_lightbake_readback_irradiance(), eevee_lightbake_readback_reflections(), eevee_lightbake_render_grid_sample(), eevee_lightbake_render_probe_sample(), eevee_lightbake_render_world_sample(), EEVEE_lightbake_update(), LightCache::flag, EEVEE_LightBake::frame, G, EEVEE_LightBake::gl_context, EEVEE_LightBake::grid, EEVEE_LightBake::grid_curr, LightCache::grid_data, EEVEE_LightBake::grid_len, EEVEE_LightBake::grid_prb, LightProbe::grid_resolution_x, LightProbe::grid_resolution_y, LightProbe::grid_resolution_z, EEVEE_LightBake::grid_sample, EEVEE_LightBake::grid_sample_len, EEVEE_LightBake::lcache, lightbake_do_sample(), LIGHTCACHE_BAKED, LIGHTCACHE_BAKING, LIGHTCACHE_INVALID, LIGHTCACHE_UPDATE_CUBE, LIGHTCACHE_UPDATE_GRID, LIGHTCACHE_UPDATE_WORLD, NULL, PIL_sleep_ms(), EEVEE_LightBake::probe, EEVEE_LightBake::progress, EEVEE_LightBake::rt_res, EEVEE_LightBake::stop, and EEVEE_LightBake::view_layer.
Referenced by EEVEE_lightbake_job_create(), and light_cache_bake_exec().
wmJob* EEVEE_lightbake_job_create | ( | struct wmWindowManager * | wm, |
struct wmWindow * | win, | ||
struct Main * | bmain, | ||
struct ViewLayer * | view_layer, | ||
struct Scene * | scene, | ||
int | delay, | ||
int | frame | ||
) |
Light Bake.
Definition at line 724 of file eevee_lightcache.c.
References BLI_mutex_alloc(), BLI_mutex_lock(), BLI_mutex_unlock(), EEVEE_LightBake::bmain, DAG_EVAL_RENDER, DEG_graph_new(), EEVEE_LightBake::delay, EEVEE_LightBake::depsgraph, EEVEE_lightbake_job(), EEVEE_lightbake_job_data_alloc(), EEVEE_lightbake_job_data_free(), EEVEE_lightbake_update(), EEVEE_LightBake::frame, G, EEVEE_LightBake::gl_context, GPU_use_main_context_workaround(), MEM_callocN, EEVEE_LightBake::mutex, NA_EDITED, NC_SCENE, NULL, EEVEE_LightBake::own_resources, scene, EEVEE_LightBake::scene, EEVEE_LightBake::stop, EEVEE_LightBake::view_layer_input, WM_JOB_EXCL_RENDER, WM_JOB_PRIORITY, WM_JOB_PROGRESS, WM_JOB_TYPE_LIGHT_BAKE, WM_JOB_TYPE_RENDER, WM_jobs_callbacks(), WM_jobs_customdata_get(), WM_jobs_customdata_set(), WM_jobs_get(), WM_jobs_test(), WM_jobs_timer(), WM_opengl_context_create(), and wm_window_reset_drawable().
Referenced by light_cache_bake_invoke().
void* EEVEE_lightbake_job_data_alloc | ( | struct Main * | bmain, |
struct ViewLayer * | view_layer, | ||
struct Scene * | scene, | ||
bool | run_as_job, | ||
int | frame | ||
) |
MUST run on the main thread.
Definition at line 794 of file eevee_lightcache.c.
References BLI_assert, BLI_mutex_alloc(), BLI_thread_is_main(), EEVEE_LightBake::bmain, DAG_EVAL_RENDER, DEG_graph_new(), EEVEE_LightBake::depsgraph, EEVEE_LightBake::frame, EEVEE_LightBake::gl_context, GPU_use_main_context_workaround(), MEM_callocN, EEVEE_LightBake::mutex, EEVEE_LightBake::own_light_cache, EEVEE_LightBake::own_resources, scene, EEVEE_LightBake::scene, EEVEE_LightBake::view_layer_input, WM_opengl_context_create(), and wm_window_reset_drawable().
Referenced by EEVEE_lightbake_job_create(), and light_cache_bake_exec().
Definition at line 821 of file eevee_lightcache.c.
References BLI_mutex_free(), EEVEE_LightBake::cube_prb, DEG_graph_free(), EEVEE_LightBake::depsgraph, EEVEE_LightBake::grid_prb, MEM_freeN, MEM_SAFE_FREE, and EEVEE_LightBake::mutex.
Referenced by EEVEE_lightbake_job_create(), and light_cache_bake_exec().
|
static |
Definition at line 462 of file eevee_lightcache.c.
References LightCacheTexture::components, LightCacheTexture::data, LightCacheTexture::data_type, GPU_DATA_UBYTE, GPU_texture_read(), LightCache::grid_tx, LIGHTCACHETEX_BYTE, MEM_SAFE_FREE, and LightCacheTexture::tex.
Referenced by EEVEE_lightbake_job().
|
static |
Definition at line 470 of file eevee_lightcache.c.
References LightCacheTexture::components, LightCache::cube_mips, LightCache::cube_tx, LightCacheTexture::data, LightCacheTexture::data_type, GPU_DATA_10_11_11_REV, GPU_texture_get_mipmap_size(), GPU_texture_read(), LIGHTCACHETEX_UINT, MEM_SAFE_FREE, LightCache::mips_len, LightCacheTexture::tex, and LightCacheTexture::tex_size.
Referenced by EEVEE_lightbake_job().
Definition at line 1099 of file eevee_lightcache.c.
References EEVEE_LightBake::bounce_curr, EEVEE_LightBake::bounce_len, LightProbe::clipend, LightProbe::clipsta, EEVEE_ViewLayerData::common_data, EEVEE_ViewLayerData::common_ubo, compute_cell_id(), DEG_get_evaluated_scene(), EEVEE_LightBake::depsgraph, Scene::eevee, eevee_lightbake_cache_create(), eevee_lightbake_copy_irradiance(), EEVEE_lightbake_filter_diffuse(), EEVEE_lightbake_filter_visibility(), EEVEE_lightbake_render_scene(), EEVEE_RAY_DIFFUSE, EEVEE_view_layer_data_ensure(), LightCache::flag, float(), GPU_uniformbuf_update(), EEVEE_LightBake::grid, EEVEE_LightBake::grid_curr, EEVEE_LightBake::grid_len, grid_loc_to_world_loc(), EEVEE_LightBake::grid_prev, EEVEE_LightBake::grid_sample, EEVEE_LightBake::grid_sample_len, LightCache::grid_tx, LightProbe::intensity, LightGridCache::level_bias, SceneEEVEE::light_cache_data, LIGHTCACHE_UPDATE_GRID, LightGridCache::offset, pos, EEVEE_CommonUniformBuffer::prb_num_planar, EEVEE_CommonUniformBuffer::prb_num_render_cube, EEVEE_CommonUniformBuffer::prb_num_render_grid, EEVEE_LightBake::probe, EEVEE_CommonUniformBuffer::ray_depth, EEVEE_CommonUniformBuffer::ray_type, EEVEE_LightBake::rt_color, EEVEE_LightBake::rt_depth, EEVEE_LightBake::rt_fb, EEVEE_CommonUniformBuffer::spec_toggle, EEVEE_CommonUniformBuffer::sss_toggle, EEVEE_LightBake::store_fb, stride, SWAP, LightCacheTexture::tex, EEVEE_LightBake::total_irr_samples, user_data, LightProbe::vis_blur, EEVEE_LightBake::vis_res, and LightGridCache::visibility_range.
Referenced by EEVEE_lightbake_job().
Definition at line 1184 of file eevee_lightcache.c.
References blender::math::clamp(), LightProbe::clipend, LightProbe::clipsta, EEVEE_ViewLayerData::common_data, EEVEE_ViewLayerData::common_ubo, EEVEE_LightBake::cube, EEVEE_LightBake::cube_len, LightCache::cube_len, EEVEE_LightBake::cube_offset, DEG_get_evaluated_scene(), EEVEE_LightBake::depsgraph, Scene::eevee, eevee_lightbake_cache_create(), EEVEE_lightbake_filter_glossy(), EEVEE_lightbake_render_scene(), EEVEE_RAY_GLOSSY, EEVEE_view_layer_data_ensure(), LightCache::flag, SceneEEVEE::gi_filter_quality, SceneEEVEE::gi_glossy_clamp, GPU_uniformbuf_update(), LightProbe::intensity, SceneEEVEE::light_cache_data, LIGHTCACHE_UPDATE_CUBE, LightCache::mips_len, LightProbeCache::position, EEVEE_CommonUniformBuffer::prb_num_planar, EEVEE_CommonUniformBuffer::prb_num_render_cube, EEVEE_LightBake::probe, EEVEE_CommonUniformBuffer::ray_depth, EEVEE_CommonUniformBuffer::ray_type, EEVEE_LightBake::rt_color, EEVEE_LightBake::rt_fb, EEVEE_CommonUniformBuffer::spec_toggle, EEVEE_CommonUniformBuffer::sss_toggle, EEVEE_LightBake::store_fb, and user_data.
Referenced by EEVEE_lightbake_job().
Definition at line 987 of file eevee_lightcache.c.
References blender::math::clamp(), EEVEE_ViewLayerData::common_data, EEVEE_ViewLayerData::common_ubo, LightCache::cube_len, DEG_get_evaluated_scene(), EEVEE_LightBake::depsgraph, DRW_draw_pass(), Scene::eevee, eevee_lightbake_cache_create(), eevee_lightbake_copy_irradiance(), EEVEE_lightbake_filter_diffuse(), EEVEE_lightbake_filter_glossy(), EEVEE_lightbake_render_world(), EEVEE_RAY_DIFFUSE, EEVEE_RAY_GLOSSY, EEVEE_view_layer_data_ensure(), LightCache::flag, SceneEEVEE::gi_filter_quality, SceneEEVEE::gi_glossy_clamp, GPU_framebuffer_bind(), GPU_framebuffer_texture_attach(), GPU_uniformbuf_update(), EEVEE_LightBake::grid_len, LightCache::grid_len, EEVEE_LightBake::grid_prev, LightCache::grid_tx, SceneEEVEE::light_cache_data, LIGHTCACHE_CUBE_READY, LIGHTCACHE_GRID_READY, LIGHTCACHE_UPDATE_GRID, LIGHTCACHE_UPDATE_WORLD, LightCache::mips_len, EEVEE_PassList::probe_grid_fill, EEVEE_Data::psl, EEVEE_CommonUniformBuffer::ray_depth, EEVEE_CommonUniformBuffer::ray_type, EEVEE_LightBake::rt_color, EEVEE_LightBake::rt_fb, EEVEE_LightBake::store_fb, SWAP, LightCacheTexture::tex, and user_data.
Referenced by EEVEE_lightbake_job().
Definition at line 1320 of file eevee_lightcache.c.
References DEG_id_tag_update(), Scene::eevee, EEVEE_lightcache_free(), EEVEE_lightcache_info_update(), Scene::id, ID_RECALC_COPY_ON_WRITE, EEVEE_LightBake::lcache, SceneEEVEE::light_cache_data, NULL, EEVEE_LightBake::own_light_cache, and EEVEE_LightBake::scene.
Referenced by EEVEE_lightbake_job(), and EEVEE_lightbake_job_create().
void EEVEE_lightbake_update_world_quick | ( | struct EEVEE_ViewLayerData * | sldata, |
struct EEVEE_Data * | vedata, | ||
const Scene * | scene | ||
) |
This is to update the world irradiance and reflection contribution from within the viewport drawing (does not have the overhead of a full light cache rebuild.)
Definition at line 1468 of file eevee_lightcache.c.
References blender::math::clamp(), EEVEE_ViewLayerData::common_data, EEVEE_ViewLayerData::common_ubo, LightCache::cube_len, Scene::eevee, EEVEE_lightbake_cache_init(), eevee_lightbake_create_render_target(), eevee_lightbake_delete_resources(), EEVEE_lightbake_filter_diffuse(), EEVEE_lightbake_filter_glossy(), EEVEE_lightbake_render_world(), EEVEE_RAY_DIFFUSE, EEVEE_RAY_GLOSSY, LightCache::flag, EEVEE_StorageList::g_data, SceneEEVEE::gi_cubemap_resolution, SceneEEVEE::gi_filter_quality, SceneEEVEE::gi_glossy_clamp, GPU_uniformbuf_update(), LightCache::grid_len, EEVEE_PrivateData::light_cache, LIGHTCACHE_CUBE_READY, LIGHTCACHE_GRID_READY, LIGHTCACHE_UPDATE_WORLD, max_ii(), LightCache::mips_len, EEVEE_CommonUniformBuffer::ray_depth, EEVEE_CommonUniformBuffer::ray_type, EEVEE_LightBake::resource_only, EEVEE_LightBake::rt_color, EEVEE_LightBake::rt_depth, EEVEE_LightBake::rt_fb, scene, EEVEE_Data::stl, and EEVEE_LightBake::store_fb.
Referenced by EEVEE_lightprobes_refresh().
void EEVEE_lightcache_blend_read_data | ( | BlendDataReader * | reader, |
LightCache * | cache | ||
) |
Definition at line 566 of file eevee_lightcache.c.
References BLO_read_data_address, LightCache::cube_data, LightCache::cube_mips, LightCache::cube_tx, direct_link_lightcache_texture(), LightCache::flag, LightCache::grid_data, LightCache::grid_tx, LIGHTCACHE_NOT_USABLE, and LightCache::mips_len.
Referenced by scene_blend_read_data().
void EEVEE_lightcache_blend_write | ( | BlendWriter * | writer, |
LightCache * | cache | ||
) |
Definition at line 526 of file eevee_lightcache.c.
References BLO_write_struct_array, LightCache::cube_data, LightCache::cube_len, LightCache::cube_mips, LightCache::cube_tx, LightCache::grid_data, LightCache::grid_len, LightCache::grid_tx, LightCache::mips_len, and write_lightcache_texture().
Referenced by scene_blend_write().
|
static |
Definition at line 194 of file eevee_lightcache.c.
References LightCache::cube_tx, LightCacheTexture::data, LightCache::grid_tx, and MEM_allocN_len.
Referenced by EEVEE_lightcache_info_update().
LightCache* EEVEE_lightcache_create | ( | int | grid_len, |
int | cube_len, | ||
int | cube_size, | ||
int | vis_size, | ||
const int | irr_size[3] | ||
) |
Light Cache.
Definition at line 324 of file eevee_lightcache.c.
References LightCache::cube_data, LightCache::cube_mips, LightCache::cube_tx, DRW_TEX_FILTER, DRW_TEX_MIPMAP, DRW_texture_create_2d_array(), DRW_texture_create_cube_array(), LightCache::flag, GPU_R11F_G11F_B10F, GPU_texture_get_mipmap_size(), LightCache::grid_data, LightCache::grid_tx, IRRADIANCE_FORMAT, LIGHTCACHE_INVALID, LIGHTCACHE_STATIC_VERSION, LIGHTCACHE_TYPE_STATIC, LIGHTCACHE_UPDATE_CUBE, LIGHTCACHE_UPDATE_GRID, LIGHTCACHE_UPDATE_WORLD, log2_floor_u(), MEM_callocN, MIN_CUBE_LOD_LEVEL, LightCache::mips_len, NULL, LightCache::ref_res, LightCacheTexture::tex, LightCacheTexture::tex_size, LightCache::type, LightCache::version, and LightCache::vis_res.
Referenced by eevee_lightbake_create_resources(), EEVEE_lightprobes_init(), and EEVEE_lookdev_cache_init().
void EEVEE_lightcache_free | ( | LightCache * | lcache | ) |
Definition at line 488 of file eevee_lightcache.c.
References LightCache::cube_data, LightCache::cube_mips, LightCache::cube_tx, LightCacheTexture::data, DRW_TEXTURE_FREE_SAFE, LightCache::grid_data, LightCache::grid_tx, MEM_freeN, MEM_SAFE_FREE, LightCache::mips_len, and LightCacheTexture::tex.
Referenced by EEVEE_lightbake_update(), EEVEE_view_layer_data_free(), light_cache_free_exec(), and scene_free_data().
void EEVEE_lightcache_info_update | ( | SceneEEVEE * | eevee | ) |
Definition at line 220 of file eevee_lightcache.c.
References BLI_snprintf(), BLI_str_format_byte_unit(), BLI_strncpy(), LightCache::cube_len, LightCache::cube_tx, eevee_lightcache_can_be_saved(), eevee_lightcache_irradiance_sample_count(), eevee_lightcache_memsize_get(), eevee_lightcache_version_check(), LightCache::flag, GPU_max_texture_layers(), SceneEEVEE::light_cache_data, SceneEEVEE::light_cache_info, LIGHTCACHE_BAKING, LIGHTCACHE_INVALID, NULL, LightCacheTexture::tex_size, and TIP_.
Referenced by EEVEE_lightbake_update(), light_cache_free_exec(), and scene_blend_read_data().
|
static |
Definition at line 209 of file eevee_lightcache.c.
References LightCache::grid_data, LightCache::grid_len, and LightGridCache::resolution.
Referenced by EEVEE_lightcache_info_update().
bool EEVEE_lightcache_load | ( | LightCache * | lcache | ) |
Definition at line 440 of file eevee_lightcache.c.
References eevee_lightcache_static_load(), eevee_lightcache_version_check(), LightCache::flag, LIGHTCACHE_INVALID, LIGHTCACHE_NOT_USABLE, LIGHTCACHE_TYPE_STATIC, NULL, and LightCache::type.
Referenced by eevee_lightbake_create_resources(), and EEVEE_lightprobes_init().
|
static |
Definition at line 169 of file eevee_lightcache.c.
References LightCache::cube_mips, LightCache::cube_tx, LightCacheTexture::data, LightCache::grid_tx, MEM_allocN_len, LightCache::mips_len, and size().
Referenced by EEVEE_lightcache_info_update().
|
static |
Definition at line 383 of file eevee_lightcache.c.
References LightCache::cube_data, LightCache::cube_mips, LightCache::cube_tx, data, LightCacheTexture::data, LightCache::flag, GPU_DATA_10_11_11_REV, GPU_DATA_UBYTE, GPU_max_texture_layers(), GPU_R11F_G11F_B10F, GPU_texture_create_2d_array(), GPU_texture_create_cube_array(), GPU_texture_filter_mode(), GPU_texture_mipmap_mode(), GPU_texture_update(), GPU_texture_update_mipmap(), LightCache::grid_data, LightCache::grid_tx, IRRADIANCE_FORMAT, LIGHTCACHE_NOT_USABLE, LightCache::mips_len, NULL, LightCacheTexture::tex, LightCacheTexture::tex_size, and UNPACK3.
Referenced by EEVEE_lightcache_load().
|
static |
Definition at line 295 of file eevee_lightcache.c.
References LightCache::cube_len, LightCache::cube_tx, eevee_lightcache_version_check(), LightCache::flag, LightCache::grid_len, LightCache::grid_tx, LIGHTCACHE_INVALID, log2_floor_u(), MIN_CUBE_LOD_LEVEL, LightCache::mips_len, NULL, and LightCacheTexture::tex_size.
Referenced by eevee_lightbake_create_resources().
|
static |
Definition at line 184 of file eevee_lightcache.c.
References LIGHTCACHE_STATIC_VERSION, LIGHTCACHE_TYPE_STATIC, LightCache::type, and LightCache::version.
Referenced by EEVEE_lightcache_info_update(), EEVEE_lightcache_load(), and EEVEE_lightcache_validate().
|
static |
Definition at line 1091 of file eevee_lightcache.c.
References copy_v3_v3(), LightGridCache::corner, LightGridCache::increment_x, LightGridCache::increment_y, LightGridCache::increment_z, and madd_v3_v3fl().
Referenced by eevee_lightbake_render_grid_sample().
|
static |
Definition at line 278 of file eevee_lightcache.c.
References ceilf, float(), IRRADIANCE_MAX_POOL_LAYER, IRRADIANCE_MAX_POOL_SIZE, IRRADIANCE_SAMPLE_SIZE_X, IRRADIANCE_SAMPLE_SIZE_Y, max_ii(), MIN2, and min_ii().
Referenced by eevee_lightbake_create_resources().
|
static |
Definition at line 1339 of file eevee_lightcache.c.
References depsgraph, EEVEE_LightBake::depsgraph, EEVEE_LightBake::do_update, EEVEE_LightBake::done, draw_engine_eevee_type, DRW_custom_pipeline(), eevee_lightbake_context_disable(), eevee_lightbake_context_enable(), float(), G, EEVEE_LightBake::progress, EEVEE_LightBake::stop, and EEVEE_LightBake::total.
Referenced by EEVEE_lightbake_job().
|
static |
Definition at line 507 of file eevee_lightcache.c.
References BLO_write_raw(), float(), LIGHTCACHETEX_FLOAT, LIGHTCACHETEX_UINT, and tex.
Referenced by EEVEE_lightcache_blend_write().