Blender V4.3
LightManager Class Reference

#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 need_update_background

Protected Member Functions

void test_enabled_lights (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< IESSlot * > ies_slots
thread_mutex ies_mutex
bool last_background_enabled
int last_background_resolution
uint32_t update_flags

Detailed Description

Definition at line 99 of file scene/light.h.

Member Enumeration Documentation

◆ anonymous enum

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 101 of file scene/light.h.

Constructor & Destructor Documentation

◆ LightManager()

LightManager::LightManager ( )

◆ ~LightManager()

LightManager::~LightManager ( )

Definition at line 223 of file scene/light.cpp.

References ies_slots.

Member Function Documentation

◆ add_ies()

int LightManager::add_ies ( const string & ies)

◆ add_ies_from_file()

int LightManager::add_ies_from_file ( const string & filename)

Definition at line 1490 of file scene/light.cpp.

References add_ies(), and path_read_text().

◆ device_free()

◆ device_update()

◆ device_update_background()

◆ device_update_distribution()

◆ device_update_ies()

◆ device_update_lights()

void LightManager::device_update_lights ( DeviceScene * dscene,
Scene * scene )
protected

Definition at line 1122 of file scene/light.cpp.

References device_vector< T >::alloc(), angle(), KernelDistantLight::angle, KernelLight::area, KernelAreaLight::axis_u, KernelAreaLight::axis_v, Scene::background, KernelLight::co, device_vector< T >::copy_to_device(), KernelSpotLight::cos_half_larger_spread, KernelSpotLight::cos_half_spot_angle, cosf, DeviceScene::data, Scene::default_light, KernelAreaLight::dir, KernelSpotLight::dir, KernelLight::distant, KernelDistantLight::eval_fac, KernelSpotLight::eval_fac, float, FLT_MAX, fmaxf, fminf, Light::get_axisu(), Light::get_axisv(), Light::get_co(), Light::get_dir(), ShaderManager::get_shader_id(), KernelSpotLight::half_cot_half_spot_angle, KernelDistantLight::half_inv_sin_half_angle, Scene::integrator, KernelAreaLight::invarea, inversesqrtf(), KernelSpotLight::is_sphere, KernelLight::itfm, len_squared(), KernelAreaLight::len_u, KernelAreaLight::len_v, LIGHT_AREA, LIGHT_BACKGROUND, LIGHT_DISTANT, LIGHT_POINT, KernelLight::light_set_membership, LIGHT_SPOT, KernelLight::lightgroup, LIGHTGROUP_NONE, Scene::lightgroups, DeviceScene::lights, Scene::lights, M_PI_F, KernelLight::max_bounces, normalize_len(), KernelAreaLight::normalize_spread, KernelDistantLight::one_minus_cosangle, PATH_RAY_DIFFUSE, PATH_RAY_GLOSSY, PATH_RAY_TRANSMIT, PATH_RAY_VOLUME_SCATTER, KernelDistantLight::pdf, powf, KernelSpotLight::radius, KernelLight::random, random(), KernelSpotLight::ray_segment_dp, safe_normalize(), SHADER_AREA_LIGHT, SHADER_CAST_SHADOW, SHADER_EXCLUDE_CAMERA, SHADER_EXCLUDE_DIFFUSE, SHADER_EXCLUDE_GLOSSY, SHADER_EXCLUDE_SCATTER, SHADER_EXCLUDE_SHADOW_CATCHER, SHADER_EXCLUDE_TRANSMIT, KernelLight::shader_id, Scene::shader_manager, SHADER_USE_MIS, KernelLight::shadow_set_membership, sinf, KernelLight::spot, KernelSpotLight::spot_smooth, sqr(), sqrtf, KernelLight::strength, KernelAreaLight::tan_half_spread, tanf, KernelLight::tfm, transform_inverse(), KernelLight::type, KernelLight::use_caustics, and VLOG_INFO.

Referenced by device_update().

◆ device_update_tree()

◆ has_background_light()

bool LightManager::has_background_light ( Scene * scene)

Definition at line 230 of file scene/light.cpp.

References LIGHT_BACKGROUND, and Scene::lights.

Referenced by Shader::tag_update().

◆ need_update()

bool LightManager::need_update ( ) const

Definition at line 1485 of file scene/light.cpp.

References update_flags, and UPDATE_NONE.

Referenced by device_update(), and HdCyclesSession::UpdateScene().

◆ remove_ies()

void LightManager::remove_ies ( int slot)

Definition at line 1539 of file scene/light.cpp.

References ies_mutex, ies_slots, need_update_background, UPDATE_ALL, update_flags, and users.

◆ tag_update()

◆ test_enabled_lights()

Member Data Documentation

◆ ies_mutex

thread_mutex LightManager::ies_mutex
protected

Definition at line 164 of file scene/light.h.

Referenced by add_ies(), and remove_ies().

◆ ies_slots

vector<IESSlot *> LightManager::ies_slots
protected

Definition at line 163 of file scene/light.h.

Referenced by add_ies(), device_update_ies(), remove_ies(), and ~LightManager().

◆ last_background_enabled

bool LightManager::last_background_enabled
protected

Definition at line 166 of file scene/light.h.

Referenced by LightManager(), and test_enabled_lights().

◆ last_background_resolution

int LightManager::last_background_resolution
protected

Definition at line 167 of file scene/light.h.

Referenced by LightManager(), and test_enabled_lights().

◆ need_update_background

bool LightManager::need_update_background

◆ update_flags

uint32_t LightManager::update_flags
protected

Definition at line 169 of file scene/light.h.

Referenced by add_ies(), device_update(), LightManager(), need_update(), remove_ies(), and tag_update().


The documentation for this class was generated from the following files: