|
Blender
V2.93
|
#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 () | |
| ~LightManager () | |
| int | add_ies (const string &ies) |
| int | add_ies_from_file (const string &filename) |
| void | remove_ies (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, uint32_t flag) |
| bool | need_update () const |
| bool | has_background_light (Scene *scene) |
Public Attributes | |
| bool | use_light_visibility |
| bool | need_update_background |
Protected Member Functions | |
| void | test_enabled_lights (Scene *scene) |
| void | device_update_points (Device *device, DeviceScene *dscene, Scene *scene) |
| void | device_update_distribution (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) |
| bool | object_usable_as_light (Object *object) |
Protected Attributes | |
| vector< IESSlot * > | ies_slots |
| thread_mutex | ies_mutex |
| bool | last_background_enabled |
| int | last_background_resolution |
| uint32_t | update_flags |
| anonymous enum : uint32_t |
| LightManager::LightManager | ( | ) |
Definition at line 191 of file light.cpp.
References last_background_enabled, last_background_resolution, need_update_background, UPDATE_ALL, update_flags, and use_light_visibility.
| int LightManager::add_ies | ( | const string & | ies | ) |
Definition at line 1058 of file light.cpp.
References hash, hash_string(), ies_mutex, ies_slots, need_update_background, UPDATE_ALL, update_flags, and users.
Referenced by add_ies_from_file().
| int LightManager::add_ies_from_file | ( | const string & | filename | ) |
Definition at line 1046 of file light.cpp.
References add_ies(), and path_read_text().
| void LightManager::device_free | ( | Device * | device, |
| DeviceScene * | dscene, | ||
| const bool | free_background = true |
||
| ) |
Definition at line 1025 of file light.cpp.
References device_vector< T >::free(), DeviceScene::ies_lights, DeviceScene::light_background_conditional_cdf, DeviceScene::light_background_marginal_cdf, DeviceScene::light_distribution, and DeviceScene::lights.
Referenced by Scene::free_memory().
| void LightManager::device_update | ( | Device * | device, |
| DeviceScene * | dscene, | ||
| Scene * | scene, | ||
| Progress & | progress | ||
| ) |
Definition at line 978 of file light.cpp.
References need_update(), scene, time, and Scene::update_stats.
Referenced by Scene::device_update().
|
protected |
Definition at line 579 of file light.cpp.
References device_vector< T >::alloc(), KernelData::background, Scene::background, TextureMapping::compute_transform(), device_vector< T >::copy_to_device(), cosf, DeviceScene::data, divide_up(), ImageHandle::empty(), Progress::get_cancel(), Background::get_shader(), SkyTextureNode::get_sun_size(), ImageSlotTextureNode::handle, ImageMetaData::height, ShaderNode::input(), KernelData::integrator, LIGHT_BACKGROUND, DeviceScene::light_background_conditional_cdf, DeviceScene::light_background_marginal_cdf, Scene::lights, ShaderInput::link, M_2PI_F, M_PI_2_F, make_float3, make_float4, make_int2, KernelBackground::map_res_x, KernelBackground::map_res_y, KernelBackground::map_weight, max, ImageHandle::metadata(), node, NODE_SKY_NISHITA, NULL, ShaderNode::output(), blender::parallel_for(), ShaderOutput::parent, KernelBackground::portal_weight, r, scene, Progress::set_status(), shade_background_pixels(), shader(), sinf, KernelBackground::sun, KernelBackground::sun_weight, TextureNode::tex_mapping, time_dt(), transform_direction(), transform_inverse(), Node::type, KernelIntegrator::use_direct_light, KernelBackground::use_mis, VLOG, ImageMetaData::width, float2::x, int2::x, float3::x, float2::y, int2::y, float3::y, y, and float3::z.
|
protected |
Definition at line 286 of file light.cpp.
References device_vector< T >::alloc(), KernelData::background, device_vector< T >::copy_to_device(), DeviceScene::data, Scene::default_surface, KernelData::film, float(), device_vector< T >::free(), Progress::get_cancel(), Mesh::get_triangle(), if(), KernelData::integrator, KernelLightDistribution::lamp, LIGHT_AREA, LIGHT_BACKGROUND, LIGHT_DISTANT, DeviceScene::light_distribution, LIGHT_POINT, LIGHT_SPOT, Scene::lights, KernelBackground::map_weight, mesh, KernelLightDistribution::mesh_light, KernelIntegrator::num_all_lights, KernelIntegrator::num_distribution, KernelBackground::num_portals, Mesh::num_triangles(), object_usable_as_light(), Scene::objects, KernelFilm::pass_shadow_scale, PATH_RAY_DIFFUSE, PATH_RAY_GLOSSY, PATH_RAY_TRANSMIT, PATH_RAY_VOLUME_SCATTER, KernelIntegrator::pdf_lights, KernelIntegrator::pdf_triangles, KernelBackground::portal_offset, KernelBackground::portal_weight, KernelLightDistribution::prim, Geometry::prim_offset, scene, Progress::set_status(), shader(), SHADER_EXCLUDE_DIFFUSE, SHADER_EXCLUDE_GLOSSY, SHADER_EXCLUDE_SCATTER, SHADER_EXCLUDE_TRANSMIT, Mesh::size, KernelBackground::sun_weight, t, KernelLightDistribution::totarea, Geometry::transform_applied, transform_point(), triangle_area(), KernelIntegrator::use_direct_light, KernelIntegrator::use_lamp_mis, use_light_visibility, and VLOG.
|
protected |
Definition at line 1114 of file light.cpp.
References __int_as_float(), device_vector< T >::alloc(), IESFile::clear(), device_vector< T >::copy_to_device(), data, LightManager::IESSlot::hash, LightManager::IESSlot::ies, DeviceScene::ies_lights, ies_slots, IESFile::packed_size(), size(), LightManager::IESSlot::users, and users.
|
protected |
Definition at line 733 of file light.cpp.
References device_vector< T >::alloc(), angle(), KernelLight::area, blender::compositor::area(), KernelAreaLight::axisu, KernelAreaLight::axisv, Scene::background, KernelLight::co, device_vector< T >::copy_to_device(), KernelDistantLight::cosangle, cosf, Scene::default_light, KernelSpotLight::dir, KernelAreaLight::dir, KernelLight::distant, float(), ShaderManager::get_shader_id(), KernelSpotLight::invarea, KernelAreaLight::invarea, KernelDistantLight::invarea, KernelLight::itfm, len, LIGHT_AREA, LIGHT_BACKGROUND, LIGHT_DISTANT, LIGHT_POINT, LIGHT_SPOT, DeviceScene::lights, Scene::lights, M_PI_4_F, M_PI_F, max, KernelLight::max_bounces, KernelAreaLight::normalize_spread, PATH_RAY_DIFFUSE, PATH_RAY_GLOSSY, PATH_RAY_TRANSMIT, PATH_RAY_VOLUME_SCATTER, KernelSpotLight::radius, KernelDistantLight::radius, KernelLight::random, random(), safe_normalize(), KernelLight::samples, scene, shader(), SHADER_AREA_LIGHT, SHADER_CAST_SHADOW, SHADER_EXCLUDE_DIFFUSE, SHADER_EXCLUDE_GLOSSY, SHADER_EXCLUDE_SCATTER, SHADER_EXCLUDE_TRANSMIT, KernelLight::shader_id, Scene::shader_manager, SHADER_USE_MIS, KernelLight::spot, KernelSpotLight::spot_angle, KernelSpotLight::spot_smooth, KernelLight::strength, KernelAreaLight::tan_spread, tanf, KernelLight::tfm, transform_inverse(), KernelLight::type, use_light_visibility, VLOG, float3::x, float3::y, and float3::z.
| bool LightManager::has_background_light | ( | Scene * | scene | ) |
Definition at line 207 of file light.cpp.
References LIGHT_BACKGROUND, Scene::lights, and scene.
Referenced by Scene::get_requested_device_features(), and Shader::tag_update().
| bool LightManager::need_update | ( | ) | const |
Definition at line 1041 of file light.cpp.
References update_flags, and UPDATE_NONE.
Referenced by device_update(), and Scene::need_data_update().
|
protected |
Definition at line 258 of file light.cpp.
References Object::bounds, Geometry::geometry_type, Geometry::MESH, node, PATH_RAY_DIFFUSE, PATH_RAY_GLOSSY, PATH_RAY_TRANSMIT, shader(), BoundBox::valid(), and Geometry::VOLUME.
Referenced by device_update_distribution().
| void LightManager::remove_ies | ( | int | slot | ) |
Definition at line 1095 of file light.cpp.
References ies_mutex, ies_slots, need_update_background, UPDATE_ALL, update_flags, and users.
Referenced by IESLightNode::~IESLightNode().
Definition at line 1036 of file light.cpp.
References update_flags.
Referenced by Scene::create_node(), Scene::delete_node_impl(), Scene::delete_nodes(), Scene::reset(), Light::tag_update(), Object::tag_update(), Shader::tag_update(), Geometry::tag_update(), and ObjectManager::tag_update().
|
protected |
Definition at line 217 of file light.cpp.
References Scene::background, Background::get_shader(), Light::has_contribution(), last_background_enabled, last_background_resolution, LIGHT_BACKGROUND, Scene::lights, need_update_background, scene, shader(), and VLOG_IF.
|
protected |
Definition at line 162 of file light.h.
Referenced by add_ies(), and remove_ies().
Definition at line 161 of file light.h.
Referenced by add_ies(), device_update_ies(), remove_ies(), and ~LightManager().
|
protected |
Definition at line 164 of file light.h.
Referenced by LightManager(), and test_enabled_lights().
|
protected |
Definition at line 165 of file light.h.
Referenced by LightManager(), and test_enabled_lights().
| bool LightManager::need_update_background |
Definition at line 114 of file light.h.
Referenced by add_ies(), LightManager(), remove_ies(), Shader::tag_update(), and test_enabled_lights().
|
protected |
Definition at line 167 of file light.h.
Referenced by add_ies(), LightManager(), need_update(), remove_ies(), and tag_update().
| bool LightManager::use_light_visibility |
Definition at line 111 of file light.h.
Referenced by device_update_distribution(), device_update_points(), and LightManager().