Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/scene/light.h
| Show All 11 Lines | |||||
| * the right Node::set overload as it does not know that Shader is a Node */ | * the right Node::set overload as it does not know that Shader is a Node */ | ||||
| #include "scene/shader.h" | #include "scene/shader.h" | ||||
| #include "util/ies.h" | #include "util/ies.h" | ||||
| #include "util/thread.h" | #include "util/thread.h" | ||||
| #include "util/types.h" | #include "util/types.h" | ||||
| #include "util/vector.h" | #include "util/vector.h" | ||||
| namespace LPE { | |||||
| class DfAutomata; | |||||
| } | |||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| class Device; | class Device; | ||||
| class DeviceScene; | class DeviceScene; | ||||
| class Object; | class Object; | ||||
| class Progress; | class Progress; | ||||
| class Scene; | class Scene; | ||||
| class Shader; | class Shader; | ||||
| Show All 39 Lines | public: | ||||
| NODE_SOCKET_API(bool, is_portal) | NODE_SOCKET_API(bool, is_portal) | ||||
| NODE_SOCKET_API(bool, is_enabled) | NODE_SOCKET_API(bool, is_enabled) | ||||
| NODE_SOCKET_API(Shader *, shader) | NODE_SOCKET_API(Shader *, shader) | ||||
| NODE_SOCKET_API(int, max_bounces) | NODE_SOCKET_API(int, max_bounces) | ||||
| NODE_SOCKET_API(uint, random_id) | NODE_SOCKET_API(uint, random_id) | ||||
| NODE_SOCKET_API(ustring, lightgroup) | NODE_SOCKET_API(ustring, lightgroup) | ||||
| NODE_SOCKET_API(ustring, lpe_tag) | |||||
| void tag_update(Scene *scene); | void tag_update(Scene *scene); | ||||
| /* Check whether the light has contribution the scene. */ | /* Check whether the light has contribution the scene. */ | ||||
| bool has_contribution(Scene *scene); | bool has_contribution(Scene *scene); | ||||
| friend class LightManager; | friend class LightManager; | ||||
| }; | }; | ||||
| Show All 32 Lines | public: | ||||
| void tag_update(Scene *scene, uint32_t flag); | void tag_update(Scene *scene, uint32_t flag); | ||||
| bool need_update() const; | bool need_update() const; | ||||
| /* Check whether there is a background light. */ | /* Check whether there is a background light. */ | ||||
| bool has_background_light(Scene *scene); | bool has_background_light(Scene *scene); | ||||
| int get_lpe_tag_index(const ustring &lpe_tag_name); | |||||
| protected: | protected: | ||||
| /* Optimization: disable light which is either unsupported or | /* Optimization: disable light which is either unsupported or | ||||
| * which doesn't contribute to the scene or which is only used for MIS | * which doesn't contribute to the scene or which is only used for MIS | ||||
| * and scene doesn't need MIS. | * and scene doesn't need MIS. | ||||
| */ | */ | ||||
| void test_enabled_lights(Scene *scene); | void test_enabled_lights(Scene *scene); | ||||
| void device_update_points(Device *device, DeviceScene *dscene, Scene *scene); | void device_update_points(Device *device, DeviceScene *dscene, Scene *scene); | ||||
| void device_update_distribution(Device *device, | void device_update_distribution(Device *device, | ||||
| DeviceScene *dscene, | DeviceScene *dscene, | ||||
| Scene *scene, | Scene *scene, | ||||
| Progress &progress); | Progress &progress); | ||||
| void device_update_background(Device *device, | void device_update_background(Device *device, | ||||
| DeviceScene *dscene, | DeviceScene *dscene, | ||||
| Scene *scene, | Scene *scene, | ||||
| Progress &progress); | Progress &progress); | ||||
| void device_update_ies(DeviceScene *dscene); | void device_update_ies(DeviceScene *dscene); | ||||
| void device_update_lpe(DeviceScene *dscene, Scene *scene, Progress &progress); | |||||
| /* Check whether light manager can use the object as a light-emissive. */ | /* Check whether light manager can use the object as a light-emissive. */ | ||||
| bool object_usable_as_light(Object *object); | bool object_usable_as_light(Object *object); | ||||
| void update_light_path_automata(DeviceScene *dscene, const LPE::DfAutomata &dfautomata); | |||||
| void free_light_path_automata(DeviceScene *dscene); | |||||
| struct IESSlot { | struct IESSlot { | ||||
| IESFile ies; | IESFile ies; | ||||
| uint hash; | uint hash; | ||||
| int users; | int users; | ||||
| }; | }; | ||||
| vector<IESSlot *> ies_slots; | vector<IESSlot *> ies_slots; | ||||
| thread_mutex ies_mutex; | thread_mutex ies_mutex; | ||||
| bool last_background_enabled; | bool last_background_enabled; | ||||
| int last_background_resolution; | int last_background_resolution; | ||||
| /* For converting LPE tags to unique indices. The mutex is here as | |||||
| * it is accessed in multiple threads in the ObjectManager. */ | |||||
| thread_mutex symbol_to_index_map_mutex; | |||||
| map<string, int> symbol_to_index_map; | |||||
| int num_lpe_tags; | |||||
| /* Initialize the symbol_to_index_map with default events. */ | |||||
| void initialize_symbol_to_index_map(); | |||||
| uint32_t update_flags; | uint32_t update_flags; | ||||
| }; | }; | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif /* __LIGHT_H__ */ | #endif /* __LIGHT_H__ */ | ||||