Blender  V2.93
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
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 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
 

Detailed Description

Definition at line 93 of file 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 95 of file light.h.

Constructor & Destructor Documentation

◆ LightManager()

LightManager::LightManager ( )

◆ ~LightManager()

LightManager::~LightManager ( )

Definition at line 200 of file light.cpp.

References ies_slots.

Member Function Documentation

◆ add_ies()

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().

◆ 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().

◆ device_free()

void LightManager::device_free ( Device device,
DeviceScene dscene,
const bool  free_background = true 
)

◆ device_update()

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().

◆ device_update_background()

void LightManager::device_update_background ( Device device,
DeviceScene dscene,
Scene scene,
Progress progress 
)
protected

◆ device_update_distribution()

void LightManager::device_update_distribution ( Device device,
DeviceScene dscene,
Scene scene,
Progress progress 
)
protected

◆ device_update_ies()

void LightManager::device_update_ies ( DeviceScene dscene)
protected

◆ device_update_points()

void LightManager::device_update_points ( Device device,
DeviceScene dscene,
Scene scene 
)
protected

◆ has_background_light()

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().

◆ need_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().

◆ object_usable_as_light()

bool LightManager::object_usable_as_light ( Object object)
protected

◆ remove_ies()

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().

◆ tag_update()

void LightManager::tag_update ( Scene scene,
uint32_t  flag 
)

◆ test_enabled_lights()

void LightManager::test_enabled_lights ( Scene scene)
protected

Member Data Documentation

◆ ies_mutex

thread_mutex LightManager::ies_mutex
protected

Definition at line 162 of file light.h.

Referenced by add_ies(), and remove_ies().

◆ ies_slots

vector<IESSlot *> LightManager::ies_slots
protected

Definition at line 161 of file 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 164 of file light.h.

Referenced by LightManager(), and test_enabled_lights().

◆ last_background_resolution

int LightManager::last_background_resolution
protected

Definition at line 165 of file light.h.

Referenced by LightManager(), and test_enabled_lights().

◆ need_update_background

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().

◆ update_flags

uint32_t LightManager::update_flags
protected

Definition at line 167 of file light.h.

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

◆ use_light_visibility

bool LightManager::use_light_visibility

Definition at line 111 of file light.h.

Referenced by device_update_distribution(), device_update_points(), and LightManager().


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