|
Blender V5.3
|
#include <light.h>
Classes | |
| struct | IESSlot |
Public Types | |
| enum | : uint32_t { MESH_NEED_REBUILD = (1 << 0) , EMISSIVE_MESH_MODIFIED = (1 << 1) , LIGHT_MODIFIED = (1 << 2) , LIGHT_ADDED = (1 << 3) , LIGHT_REMOVED = (1 << 4) , OBJECT_MANAGER = (1 << 5) , SHADER_COMPILED = (1 << 6) , SHADER_MODIFIED = (1 << 7) , UPDATE_ALL = ~0u , UPDATE_NONE = 0u } |
Public Member Functions | |
| LightManager () | |
| int | add_ies (const string &content, const bool log_parsing_error) |
| int | add_ies_from_file (const string &filename) |
| void | remove_ies (const int slot) |
| void | device_update (Device *device, DeviceScene *dscene, Scene *scene, Progress &progress) |
| void | device_free (Device *device, DeviceScene *dscene, const bool free_background=true) |
| void | tag_update (Scene *scene, const uint32_t flag) |
| bool | need_update () const |
| bool | has_background_light (Scene *scene) |
Public Attributes | |
| bool | need_update_background |
Protected Member Functions | |
| void | test_enabled_lights (Scene *scene) |
| void | count_lights (KernelIntegrator *kintegrator, const Scene *scene) |
| void | device_update_lights (DeviceScene *dscene, Scene *scene) |
| void | device_update_distribution (Device *device, DeviceScene *dscene, Scene *scene, Progress &progress) |
| void | device_update_tree (Device *device, DeviceScene *dscene, Scene *scene, Progress &progress) |
| void | device_update_background (Device *device, DeviceScene *dscene, Scene *scene, Progress &progress) |
| void | device_update_ies (DeviceScene *dscene) |
Protected Attributes | |
| vector< unique_ptr< IESSlot > > | ies_slots |
| thread_mutex | ies_mutex |
| bool | last_background_enabled |
| int | last_background_resolution |
| uint32_t | update_flags |
Definition at line 186 of file scene/light.h.
| anonymous enum : uint32_t |
| Enumerator | |
|---|---|
| MESH_NEED_REBUILD | |
| EMISSIVE_MESH_MODIFIED | |
| LIGHT_MODIFIED | |
| LIGHT_ADDED | |
| LIGHT_REMOVED | |
| OBJECT_MANAGER | |
| SHADER_COMPILED | |
| SHADER_MODIFIED | |
| UPDATE_ALL | |
| UPDATE_NONE | |
Definition at line 188 of file scene/light.h.
| LightManager::LightManager | ( | ) |
Definition at line 488 of file scene/light.cpp.
References last_background_enabled, last_background_resolution, need_update_background, UPDATE_ALL, and update_flags.
| int LightManager::add_ies | ( | const string & | content, |
| const bool | log_parsing_error ) |
Definition at line 1551 of file scene/light.cpp.
References hash, ies_mutex, ies_slots, LOG_ERROR, need_update_background, UPDATE_ALL, and update_flags.
Referenced by add_ies_from_file().
| int LightManager::add_ies_from_file | ( | const string & | filename | ) |
Definition at line 1533 of file scene/light.cpp.
References add_ies(), LOG_ERROR, and path_read_text().
|
protected |
Definition at line 1390 of file scene/light.cpp.
References Light::is_background_light(), Light::is_distant_light(), Light::is_portal_light(), and Scene::objects.
Referenced by device_update_lights().
| void LightManager::device_free | ( | Device * | device, |
| DeviceScene * | dscene, | ||
| const bool | free_background = true ) |
Definition at line 1504 of file scene/light.cpp.
References device_vector< T >::free(), DeviceScene::ies_lights, DeviceScene::light_background_conditional_cdf, DeviceScene::light_background_marginal_cdf, DeviceScene::light_distribution, DeviceScene::light_to_tree, DeviceScene::light_tree_emitters, DeviceScene::light_tree_nodes, DeviceScene::lights, DeviceScene::object_lookup_offset, and DeviceScene::triangle_to_tree.
Referenced by device_update().
| void LightManager::device_update | ( | Device * | device, |
| DeviceScene * | dscene, | ||
| Scene * | scene, | ||
| Progress & | progress ) |
Definition at line 1453 of file scene/light.cpp.
References device_free(), device_update_background(), device_update_distribution(), device_update_ies(), device_update_lights(), device_update_tree(), Progress::get_cancel(), need_update(), need_update_background, test_enabled_lights(), update_flags, UPDATE_NONE, and Scene::update_stats.
|
protected |
Definition at line 1200 of file scene/light.cpp.
References device_vector< T >::alloc(), Scene::background, TextureMapping::compute_transform(), device_vector< T >::copy_to_device(), cosf, DeviceScene::data, divide_up(), ImageHandle::empty(), FLT_MAX, Progress::get_cancel(), Background::get_shader(), SkyTextureNode::get_sun_average_radiance(), SkyTextureNode::get_sun_size(), Shader::graph, ImageSlotTextureNode::handle, ImageMetaData::height, ShaderNode::input(), Light::is_background_light(), DeviceScene::light_background_conditional_cdf, DeviceScene::light_background_marginal_cdf, ShaderInput::link, LOG_DEBUG, LOG_INFO, M_2PI_F, M_PI_2_F, M_PI_F, make_float3(), make_float4, make_int2(), max, ImageHandle::metadata(), min, node, Scene::objects, ShaderNode::output(), ShaderIO::parent, Progress::set_status(), shade_background_pixels(), sinf, sun_direction(), TextureNode::tex_mapping, time_dt(), transform_direction(), transform_inverse(), Node::type, ImageMetaData::width, float2::x, int2::x, float2::y, and int2::y.
Referenced by device_update().
|
protected |
Definition at line 569 of file scene/light.cpp.
References device_vector< T >::alloc(), device_vector< T >::copy_to_device(), DeviceScene::data, Scene::default_surface, Shader::emission_sampling, EMISSION_SAMPLING_NONE, device_vector< T >::free(), Progress::get_cancel(), Geometry::get_position(), Mesh::get_triangle(), DeviceScene::light_distribution, light_object_visibility_flags(), LOG_INFO, Mesh::num_triangles(), KernelLightDistribution::object_id, OBJECT_NONE, Scene::objects, KernelLightDistribution::prim, Geometry::prim_offset, Progress::set_error(), Progress::set_status(), KernelLightDistribution::totarea, Geometry::transform_applied, transform_point(), triangle_area(), Object::usable_as_light(), Mesh::Triangle::v, Mesh::Triangle::valid(), and KernelLightDistribution::visibility_flag.
Referenced by device_update().
|
protected |
Definition at line 1611 of file scene/light.cpp.
References __int_as_float, device_vector< T >::alloc(), device_vector< T >::copy_to_device(), DeviceScene::ies_lights, and ies_slots.
Referenced by device_update().
|
protected |
Definition at line 1419 of file scene/light.cpp.
References device_vector< T >::alloc(), device_vector< T >::copy_to_device(), Light::copy_to_kernel(), count_lights(), DeviceScene::data, Scene::integrator, Light::is_portal_light(), DeviceScene::lights, LOG_INFO, Scene::objects, and Scene::use_light_mis().
Referenced by device_update().
|
protected |
Definition at line 1054 of file scene/light.cpp.
References device_vector< T >::alloc(), LightTree::build(), device_vector< T >::copy_to_device(), device_vector< T >::data(), DeviceScene::data, LightTreeFlatten::emitters, Progress::get_cancel(), LightTree::get_emitters(), LightTreeFlatten::light_array, LightTree::light_link_receiver_used, LIGHT_LINK_SET_MAX, DeviceScene::light_to_tree, DeviceScene::light_tree_emitters, light_tree_emitters_copy_and_flatten(), light_tree_flatten(), DeviceScene::light_tree_nodes, light_tree_specialize_nodes_flatten(), LOG_INFO, LightTree::num_emitters(), LightTree::num_nodes, LightTree::num_triangles, DeviceScene::object_lookup_offset, LightTreeFlatten::object_lookup_offset, Scene::objects, LightTreeFlatten::scene, Progress::set_status(), unique_ptr_vector< T >::size(), LightTreeFlatten::triangle_array, and DeviceScene::triangle_to_tree.
Referenced by device_update().
| bool LightManager::has_background_light | ( | Scene * | scene | ) |
Definition at line 496 of file scene/light.cpp.
References Light::is_background_light(), and Scene::objects.
| bool LightManager::need_update | ( | ) | const |
Definition at line 1528 of file scene/light.cpp.
References update_flags, and UPDATE_NONE.
Referenced by device_update().
| void LightManager::remove_ies | ( | const int | slot | ) |
Definition at line 1592 of file scene/light.cpp.
References assert, ies_mutex, ies_slots, need_update_background, UPDATE_ALL, and update_flags.
| void LightManager::tag_update | ( | Scene * | scene, |
| const uint32_t | flag ) |
Definition at line 1523 of file scene/light.cpp.
References update_flags.
|
protected |
Definition at line 511 of file scene/light.cpp.
References Scene::background, Background::get_shader(), Light::has_contribution(), Shader::has_surface_spatial_varying, Light::is_background_light(), Light::is_portal_light(), last_background_enabled, last_background_resolution, LOG_INFO, need_update_background, and Scene::objects.
Referenced by device_update().
|
protected |
Definition at line 252 of file scene/light.h.
Referenced by add_ies(), and remove_ies().
|
protected |
Definition at line 251 of file scene/light.h.
Referenced by add_ies(), device_update_ies(), and remove_ies().
|
protected |
Definition at line 254 of file scene/light.h.
Referenced by LightManager(), and test_enabled_lights().
|
protected |
Definition at line 255 of file scene/light.h.
Referenced by LightManager(), and test_enabled_lights().
| bool LightManager::need_update_background |
Definition at line 205 of file scene/light.h.
Referenced by add_ies(), device_update(), LightManager(), remove_ies(), and test_enabled_lights().
|
protected |
Definition at line 257 of file scene/light.h.
Referenced by add_ies(), device_update(), LightManager(), need_update(), remove_ies(), and tag_update().