49 : bvh_nodes(device,
"__bvh_nodes",
MEM_GLOBAL),
50 bvh_leaf_nodes(device,
"__bvh_leaf_nodes",
MEM_GLOBAL),
51 object_node(device,
"__object_node",
MEM_GLOBAL),
52 prim_tri_index(device,
"__prim_tri_index",
MEM_GLOBAL),
53 prim_tri_verts(device,
"__prim_tri_verts",
MEM_GLOBAL),
55 prim_visibility(device,
"__prim_visibility",
MEM_GLOBAL),
56 prim_index(device,
"__prim_index",
MEM_GLOBAL),
57 prim_object(device,
"__prim_object",
MEM_GLOBAL),
59 tri_shader(device,
"__tri_shader",
MEM_GLOBAL),
60 tri_vnormal(device,
"__tri_vnormal",
MEM_GLOBAL),
61 tri_vindex(device,
"__tri_vindex",
MEM_GLOBAL),
63 tri_patch_uv(device,
"__tri_patch_uv",
MEM_GLOBAL),
65 curve_keys(device,
"__curve_keys",
MEM_GLOBAL),
68 object_motion_pass(device,
"__object_motion_pass",
MEM_GLOBAL),
69 object_motion(device,
"__object_motion",
MEM_GLOBAL),
70 object_flag(device,
"__object_flag",
MEM_GLOBAL),
71 object_volume_step(device,
"__object_volume_step",
MEM_GLOBAL),
72 camera_motion(device,
"__camera_motion",
MEM_GLOBAL),
73 attributes_map(device,
"__attributes_map",
MEM_GLOBAL),
74 attributes_float(device,
"__attributes_float",
MEM_GLOBAL),
75 attributes_float2(device,
"__attributes_float2",
MEM_GLOBAL),
76 attributes_float3(device,
"__attributes_float3",
MEM_GLOBAL),
77 attributes_uchar4(device,
"__attributes_uchar4",
MEM_GLOBAL),
78 light_distribution(device,
"__light_distribution",
MEM_GLOBAL),
80 light_background_marginal_cdf(device,
"__light_background_marginal_cdf",
MEM_GLOBAL),
81 light_background_conditional_cdf(device,
"__light_background_conditional_cdf",
MEM_GLOBAL),
85 lookup_table(device,
"__lookup_table",
MEM_GLOBAL),
86 sample_pattern_lut(device,
"__sample_pattern_lut",
MEM_GLOBAL),
89 memset((
void *)&
data, 0,
sizeof(
data));
95 default_surface(
NULL),
98 default_background(
NULL),
104 kernels_loaded(false),
106 max_closure_global(1)
125 camera = create_node<Camera>();
128 film = create_node<Film>();
275 progress.
set_status(
"Updating Particle Systems");
287 progress.
set_status(
"Updating Objects Flags");
299 progress.
set_status(
"Updating Camera Volume");
305 progress.
set_status(
"Updating Lookup Tables");
329 progress.
set_status(
"Updating Lookup Tables");
342 progress.
set_status(
"Updating Device",
"Writing constant memory");
350 VLOG(1) <<
"System memory statistics after full device sync:\n"
373 return camera->get_shuttertime();
462 bool use_motion =
need_motion() == Scene::MotionType::MOTION_BLUR;
463 requested_features.
use_hair =
false;
468 Geometry *geom =
object->get_geometry();
470 requested_features.
use_object_motion |=
object->use_motion() | geom->get_use_motion_blur();
473 if (object->get_is_shadow_catcher()) {
478 #ifdef WITH_OPENSUBDIV
495 if (
film->get_denoising_data_pass()) {
500 return requested_features;
521 bool new_kernels_needed =
load_kernels(progress,
false);
529 if (new_kernels_needed || kernel_switch_needed) {
550 progress.
set_status(
"Loading render kernels (may take a few minutes the first time)");
554 VLOG(2) <<
"Requested features:\n" << requested_features;
558 message =
"Failed loading render kernel, see console for errors";
581 int max_closures = 0;
582 for (
int i = 0; i <
shaders.size(); i++) {
585 int num_closures =
shader->graph->get_num_closures();
586 max_closures =
max(max_closures, num_closures);
605 template<>
Light *Scene::create_node<Light>()
608 node->set_owner(
this);
614 template<>
Mesh *Scene::create_node<Mesh>()
617 node->set_owner(
this);
623 template<>
Hair *Scene::create_node<Hair>()
626 node->set_owner(
this);
632 template<>
Volume *Scene::create_node<Volume>()
635 node->set_owner(
this);
641 template<>
Object *Scene::create_node<Object>()
644 node->set_owner(
this);
653 node->set_owner(
this);
659 template<>
Shader *Scene::create_node<Shader>()
662 node->set_owner(
this);
668 template<> AlembicProcedural *Scene::create_node<AlembicProcedural>()
671 AlembicProcedural *
node =
new AlembicProcedural();
672 node->set_owner(
this);
683 for (
size_t i = 0; i < nodes.size(); ++i) {
684 if (nodes[i] ==
node) {
685 std::swap(nodes[i], nodes[nodes.size() - 1]);
690 nodes.resize(nodes.size() - 1);
722 if (
node->is_hair()) {
770 size_t new_size = nodes_array.size();
772 for (
size_t i = 0; i < new_size; ++i) {
773 T *
node = nodes_array[i];
775 if (nodes_set.find(
node) != nodes_set.end()) {
776 std::swap(nodes_array[i], nodes_array[new_size - 1]);
778 assert(
node->get_owner() == owner);
786 nodes_array.resize(new_size);
struct ParticleSystem ParticleSystem
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Shader
ATTR_WARN_UNUSED_RESULT const BMLoop * l
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
void device_free(Device *device, DeviceScene *dscene)
void tag_update(Scene *scene)
void device_free(Device *device, DeviceScene *dscene)
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
bool use_integrator_branched
bool modified(const DeviceRequestedFeatures &requested_features)
bool use_background_light
bool use_patch_evaluation
bool use_true_displacement
DeviceScene(Device *device)
virtual DeviceKernelStatus get_active_kernel_switch_state()
virtual void const_copy_to(const char *name, void *host, size_t size)=0
virtual bool wait_for_availability(const DeviceRequestedFeatures &)
virtual const string & error_message()
virtual bool load_kernels(const DeviceRequestedFeatures &)
static void add_default(Scene *scene)
void device_free(Device *device, DeviceScene *dscene, Scene *scene)
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
void device_free(Device *device, DeviceScene *dscene, bool force_free)
void tag_update(Scene *scene, uint32_t flag)
void collect_statistics(const Scene *scene, RenderStats *stats)
void device_update_preprocess(Device *device, Scene *scene, Progress &progress)
bool has_true_displacement() const
void device_update(Device *device, Scene *scene, Progress &progress)
void device_free(Device *device)
void device_free_builtin(Device *device)
void collect_statistics(RenderStats *stats)
void tag_update(Scene *scene, uint32_t flag)
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
void device_free(Device *device, DeviceScene *dscene, bool force_free=false)
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
void device_free(Device *device, DeviceScene *dscene, const bool free_background=true)
bool has_background_light(Scene *scene)
void tag_update(Scene *scene, uint32_t flag)
void device_free(Device *device, DeviceScene *dscene)
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
void add_entry(const NamedTimeEntry &entry)
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
void tag_update(Scene *scene, uint32_t flag)
void device_free(Device *device, DeviceScene *dscene, bool force_free)
void device_update_flags(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress, bool bounds_valid=true)
void device_free(Device *device, DeviceScene *dscene)
void tag_update(Scene *scene)
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
static bool contains(const vector< Pass > &passes, PassType)
void update(Scene *scene, Progress &progress)
void set_kernel_status(const string &kernel_status_)
void set_status(const string &status_, const string &substatus_="")
void set_error(const string &error_message_)
CurveShapeType hair_shape
ShadingSystem shadingsystem
virtual void device_free(Device *device, DeviceScene *dscene, Scene *scene)=0
virtual void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)=0
void get_requested_features(Scene *scene, DeviceRequestedFeatures *requested_features)
static ShaderManager * create(int shadingsystem)
void update_shaders_used(Scene *scene)
void tag_update(Scene *scene, uint32_t flag)
static void add_default(Scene *scene)
virtual void reset(Scene *scene)=0
@ DEVICE_KERNEL_FEATURE_KERNEL_AVAILABLE
@ DEVICE_KERNEL_FEATURE_KERNEL_INVALID
#define CCL_NAMESPACE_END
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
@ ATTR_STD_MOTION_VERTEX_NORMAL
@ ATTR_STD_MOTION_VERTEX_POSITION
void delete_node_from_array(vector< T > &nodes, T node)
static void remove_nodes_in_set(const set< T * > &nodes_set, vector< T * > &nodes_array, const NodeOwner *owner)
KernelIntegrator integrator
BakeManager * bake_manager
bool need_global_attribute(AttributeStandard std)
ParticleSystemManager * particle_system_manager
vector< Geometry * > geometry
void need_global_attributes(AttributeRequestSet &attributes)
vector< Shader * > shaders
vector< Procedural * > procedurals
int get_max_closure_count()
bool load_kernels(Progress &progress, bool lock_scene=true)
LookupTables * lookup_tables
DeviceRequestedFeatures get_requested_device_features()
void free_memory(bool final)
vector< ParticleSystem * > particle_systems
ImageManager * image_manager
void enable_update_stats()
vector< Object * > objects
ObjectManager * object_manager
void delete_nodes(const set< T * > &nodes)
ProceduralManager * procedural_manager
ShaderManager * shader_manager
DeviceRequestedFeatures loaded_kernel_features
void delete_node_impl(T *node)
LightManager * light_manager
bool update(Progress &progress, bool &kernel_switch_needed)
void collect_statistics(RenderStats *stats)
SceneUpdateStats * update_stats
GeometryManager * geometry_manager
float motion_shutter_time()
Scene(const SceneParams ¶ms, Device *device)
void device_update(Device *device, Progress &progress)
size_t util_guarded_get_mem_used()
size_t util_guarded_get_mem_peak()
#define MEM_GUARDED_CALL(progress, func,...)
string string_human_readable_size(size_t size)
string string_human_readable_number(size_t num)
std::unique_lock< std::mutex > thread_scoped_lock