75 film->add_default(
this);
190 update_stats->scene.times.add_entry({
"device_update", time});
208 if (
film->update_lightgroups(
this)) {
209 light_manager->tag_update(
this, ccl::LightManager::LIGHT_MODIFIED);
210 object_manager->tag_update(
this, ccl::ObjectManager::OBJECT_MODIFIED);
213 if (
film->exposure_is_modified()) {
257 progress.
set_status(
"Updating Particle Systems");
271 progress.
set_status(
"Updating Objects Flags");
278 progress.
set_status(
"Updating Primitive Offsets");
292 progress.
set_status(
"Updating Camera Volume");
299 progress.
set_status(
"Updating Lookup Tables");
327 progress.
set_status(
"Updating Lookup Tables");
341 if (
device->have_error() ==
false) {
344 progress.
set_status(
"Updating Device",
"Writing constant memory");
348 device->optimize_for_scene(
this);
354 VLOG_INFO <<
"System memory statistics after full device sync:\n"
381 return camera->get_shuttertime();
442 film->tag_modified();
493 bool has_caustics_receiver =
false;
494 bool has_caustics_caster =
false;
495 bool has_caustics_light =
false;
498 if (object->get_is_caustics_caster()) {
499 has_caustics_caster =
true;
501 else if (object->get_is_caustics_receiver()) {
502 has_caustics_receiver =
true;
504 Geometry *geom =
object->get_geometry();
506 if (object->
use_motion() || geom->get_use_motion_blur()) {
510 if (object->get_is_shadow_catcher()) {
514#ifdef WITH_OPENSUBDIV
515 Mesh *mesh =
static_cast<Mesh *
>(geom);
536 if (light->get_use_caustics()) {
537 has_caustics_light =
true;
548 dscene.data.integrator.use_caustics =
false;
549 if (
device->info.has_mnee && has_caustics_caster && has_caustics_receiver && has_caustics_light)
551 dscene.data.integrator.use_caustics =
true;
563 kernel_features |=
film->get_kernel_features(
this);
564 kernel_features |=
integrator->get_kernel_features();
566 dscene.data.kernel_features = kernel_features;
570 dscene.data.max_closures = max_closures;
623 const uint kernel_features =
dscene.data.kernel_features;
626 progress.
set_status(
"Loading render kernels (may take a few minutes the first time)");
631 if (!
device->load_kernels(kernel_features)) {
632 string message =
device->error_message();
633 if (message.empty()) {
634 message =
"Failed loading render kernel, see console for errors";
658 int max_closures = 0;
659 for (
int i = 0; i <
shaders.size(); i++) {
663 max_closures =
max(max_closures, num_closures);
684 int volume_stack_size = 0;
690 volume_stack_size += 2;
694 bool has_volume_object =
false;
696 if (!object->get_geometry()->has_volume) {
700 if (object->intersects_volume) {
707 else if (!has_volume_object) {
712 has_volume_object =
true;
721 VLOG_WORK <<
"Detected required volume stack size " << volume_stack_size;
723 return volume_stack_size;
731 if (object->get_is_shadow_catcher()) {
823 AlembicProcedural *node =
new AlembicProcedural();
824 node->set_owner(
this);
838 film->tag_modified();
844 for (
size_t i = 0; i < nodes.size(); ++i) {
845 if (nodes[i] == node) {
846 std::swap(nodes[i], nodes[nodes.size() - 1]);
851 nodes.resize(nodes.size() - 1);
936 film->tag_modified();
944 size_t new_size = nodes_array.size();
946 for (
size_t i = 0; i < new_size; ++i) {
947 T *node = nodes_array[i];
949 if (nodes_set.find(node) != nodes_set.end()) {
950 std::swap(nodes_array[i], nodes_array[new_size - 1]);
952 assert(node->get_owner() == owner);
960 nodes_array.resize(new_size);
991 for (
Shader *shader : nodes) {
992 shader->clear_reference_count();
1005 film->tag_modified();
struct ParticleSystem ParticleSystem
struct PointCloud PointCloud
ATTR_WARN_UNUSED_RESULT const BMLoop * l
bool is_pointcloud() const
static bool contains(const vector< Pass * > &passes, PassType type)
void set_status(const string &status_, const string &substatus_="")
void set_error(const string &error_message_)
static ShaderManager * create(int shadingsystem, Device *device)
NODE_DECLARE ShaderGraph * graph
#define CCL_NAMESPACE_END
size_t util_guarded_get_mem_used()
size_t util_guarded_get_mem_peak()
#define MEM_GUARDED_CALL(progress, func,...)
#define KERNEL_FEATURE_VOLUME
#define MAX_VOLUME_STACK_SIZE
#define KERNEL_FEATURE_SHADOW_CATCHER
#define KERNEL_FEATURE_OBJECT_MOTION
@ ATTR_STD_MOTION_VERTEX_NORMAL
@ ATTR_STD_VOLUME_VELOCITY_Y
@ ATTR_STD_VOLUME_VELOCITY_Z
@ ATTR_STD_VOLUME_VELOCITY
@ ATTR_STD_MOTION_VERTEX_POSITION
@ ATTR_STD_VOLUME_VELOCITY_X
#define KERNEL_FEATURE_PATH_GUIDING
#define KERNEL_FEATURE_TRANSPARENT
#define KERNEL_FEATURE_SUBSURFACE
#define KERNEL_FEATURE_NODE_BSDF
#define KERNEL_FEATURE_PATCH_EVALUATION
#define KERNEL_FEATURE_HAIR_THICK
#define KERNEL_FEATURE_NODE_VORONOI_EXTRA
#define KERNEL_FEATURE_NODE_VOLUME
#define KERNEL_FEATURE_PATH_TRACING
#define KERNEL_FEATURE_SHADOW_LINKING
#define KERNEL_FEATURE_DENOISING
#define KERNEL_FEATURE_LIGHT_LINKING
#define KERNEL_FEATURE_HAIR
#define KERNEL_FEATURE_NODE_RAYTRACE
#define KERNEL_FEATURE_BAKING
#define KERNEL_FEATURE_MNEE
#define KERNEL_FEATURE_POINTCLOUD
#define KERNEL_FEATURE_NODE_EMISSION
#define KERNEL_FEATURE_NODE_BUMP
void delete_node_from_array(vector< T > &nodes, T node)
static void log_kernel_features(const uint features)
static void remove_nodes_in_set(const set< T * > &nodes_set, vector< T * > &nodes_array, const NodeOwner *owner)
string string_from_bool(bool var)
string string_human_readable_size(size_t size)
string string_human_readable_number(size_t num)
bool has_shadow_linking() const
bool has_light_linking() const
int reference_count() const
void clear_reference_count()
void set_owner(const NodeOwner *owner_)
bool has_light_linking() const
bool has_shadow_linking() const
BakeManager * bake_manager
bool need_global_attribute(AttributeStandard std)
ParticleSystemManager * particle_system_manager
vector< Geometry * > geometry
MotionType need_motion() const
void need_global_attributes(AttributeRequestSet &attributes)
Scene(const SceneParams ¶ms, Device *device)
bool update(Progress &progress)
vector< Shader * > shaders
vector< Procedural * > procedurals
int get_max_closure_count()
LookupTables * lookup_tables
void tag_shadow_catcher_modified()
void free_memory(bool final)
vector< ParticleSystem * > particle_systems
ImageManager * image_manager
void enable_update_stats()
Shader * default_background
uint loaded_kernel_features
vector< Object * > objects
ObjectManager * object_manager
bool shadow_catcher_modified_
void update_kernel_features()
void delete_nodes(const set< T * > &nodes)
bool has_shadow_catcher()
ProceduralManager * procedural_manager
ShaderManager * shader_manager
void delete_node_impl(T *node)
bool load_kernels(Progress &progress)
LightManager * light_manager
int get_volume_stack_size() const
bool need_reset(const bool check_camera=true)
void collect_statistics(RenderStats *stats)
SceneUpdateStats * update_stats
GeometryManager * geometry_manager
float motion_shutter_time()
void device_update(Device *device, Progress &progress)
std::unique_lock< std::mutex > thread_scoped_lock