38 bvh_leaf_nodes(device,
"bvh_leaf_nodes",
MEM_GLOBAL),
39 object_node(device,
"object_node",
MEM_GLOBAL),
41 prim_visibility(device,
"prim_visibility",
MEM_GLOBAL),
43 prim_object(device,
"prim_object",
MEM_GLOBAL),
47 tri_vnormal(device,
"tri_vnormal",
MEM_GLOBAL),
50 tri_patch_uv(device,
"tri_patch_uv",
MEM_GLOBAL),
53 curve_segments(device,
"curve_segments",
MEM_GLOBAL),
56 points_shader(device,
"points_shader",
MEM_GLOBAL),
58 object_motion_pass(device,
"object_motion_pass",
MEM_GLOBAL),
59 object_motion(device,
"object_motion",
MEM_GLOBAL),
60 object_flag(device,
"object_flag",
MEM_GLOBAL),
61 object_volume_step(device,
"object_volume_step",
MEM_GLOBAL),
62 object_prim_offset(device,
"object_prim_offset",
MEM_GLOBAL),
63 camera_motion(device,
"camera_motion",
MEM_GLOBAL),
64 attributes_map(device,
"attributes_map",
MEM_GLOBAL),
65 attributes_float(device,
"attributes_float",
MEM_GLOBAL),
66 attributes_float2(device,
"attributes_float2",
MEM_GLOBAL),
67 attributes_float3(device,
"attributes_float3",
MEM_GLOBAL),
68 attributes_float4(device,
"attributes_float4",
MEM_GLOBAL),
69 attributes_uchar4(device,
"attributes_uchar4",
MEM_GLOBAL),
70 light_distribution(device,
"light_distribution",
MEM_GLOBAL),
72 light_background_marginal_cdf(device,
"light_background_marginal_cdf",
MEM_GLOBAL),
73 light_background_conditional_cdf(device,
"light_background_conditional_cdf",
MEM_GLOBAL),
77 lookup_table(device,
"lookup_table",
MEM_GLOBAL),
78 sample_pattern_lut(device,
"sample_pattern_lut",
MEM_GLOBAL),
81 memset((
void *)&
data, 0,
sizeof(
data));
87 default_surface(
NULL),
90 default_background(
NULL),
96 kernels_loaded(false),
117 camera = create_node<Camera>();
120 film = create_node<Film>();
294 progress.
set_status(
"Updating Particle Systems");
306 progress.
set_status(
"Updating Objects Flags");
312 progress.
set_status(
"Updating Primitive Offsets");
324 progress.
set_status(
"Updating Camera Volume");
330 progress.
set_status(
"Updating Lookup Tables");
354 progress.
set_status(
"Updating Lookup Tables");
369 progress.
set_status(
"Updating Device",
"Writing constant memory");
379 VLOG_INFO <<
"System memory statistics after full device sync:\n"
402 return camera->get_shuttertime();
496 bool use_motion =
need_motion() == Scene::MotionType::MOTION_BLUR;
508 bool has_caustics_receiver =
false;
509 bool has_caustics_caster =
false;
510 bool has_caustics_light =
false;
513 if (object->get_is_caustics_caster()) {
514 has_caustics_caster =
true;
516 else if (object->get_is_caustics_receiver()) {
517 has_caustics_receiver =
true;
519 Geometry *geom =
object->get_geometry();
521 if (object->
use_motion() || geom->get_use_motion_blur()) {
524 if (geom->get_use_motion_blur()) {
528 if (object->get_is_shadow_catcher()) {
532 #ifdef WITH_OPENSUBDIV
548 if (light->get_use_caustics()) {
549 has_caustics_light =
true;
554 if (has_caustics_caster && has_caustics_receiver && has_caustics_light) {
638 progress.
set_status(
"Loading render kernels (may take a few minutes the first time)");
646 message =
"Failed loading render kernel, see console for errors";
669 int max_closures = 0;
670 for (
int i = 0; i <
shaders.size(); i++) {
674 max_closures =
max(max_closures, num_closures);
695 int volume_stack_size = 0;
701 volume_stack_size += 2;
705 bool has_volume_object =
false;
707 if (!object->get_geometry()->has_volume) {
711 if (object->intersects_volume) {
718 else if (!has_volume_object) {
723 has_volume_object =
true;
732 VLOG_WORK <<
"Detected required volume stack size " << volume_stack_size;
734 return volume_stack_size;
742 if (object->get_is_shadow_catcher()) {
759 template<>
Light *Scene::create_node<Light>()
762 node->set_owner(
this);
768 template<>
Mesh *Scene::create_node<Mesh>()
771 node->set_owner(
this);
777 template<>
Hair *Scene::create_node<Hair>()
780 node->set_owner(
this);
786 template<>
Volume *Scene::create_node<Volume>()
789 node->set_owner(
this);
798 node->set_owner(
this);
804 template<>
Object *Scene::create_node<Object>()
807 node->set_owner(
this);
816 node->set_owner(
this);
822 template<>
Shader *Scene::create_node<Shader>()
825 node->set_owner(
this);
831 template<> AlembicProcedural *Scene::create_node<AlembicProcedural>()
834 AlembicProcedural *
node =
new AlembicProcedural();
835 node->set_owner(
this);
844 template<>
Pass *Scene::create_node<Pass>()
847 node->set_owner(
this);
855 for (
size_t i = 0; i < nodes.size(); ++i) {
856 if (nodes[i] ==
node) {
857 std::swap(nodes[i], nodes[nodes.size() - 1]);
862 nodes.resize(nodes.size() - 1);
900 if (
node->is_hair()) {
955 size_t new_size = nodes_array.size();
957 for (
size_t i = 0; i < new_size; ++i) {
958 T *
node = nodes_array[i];
960 if (nodes_set.find(
node) != nodes_set.end()) {
961 std::swap(nodes_array[i], nodes_array[new_size - 1]);
963 assert(
node->get_owner() == owner);
971 nodes_array.resize(new_size);
1002 for (
Shader *shader : nodes) {
1003 shader->clear_reference_count();
struct ParticleSystem ParticleSystem
struct PointCloud PointCloud
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
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)
DeviceScene(Device *device)
virtual void optimize_for_scene(Scene *)
virtual void const_copy_to(const char *name, void *host, size_t size)=0
virtual bool load_kernels(uint)
virtual const string & error_message()
uint get_kernel_features(const Scene *scene) const
static void add_default(Scene *scene)
void device_free(Device *device, DeviceScene *dscene, Scene *scene)
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
bool update_lightgroups(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 is_pointcloud() 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)
uint get_kernel_features() const
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)
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_prim_offsets(Device *device, DeviceScene *dscene, Scene *scene)
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 type)
void update(Scene *scene, Progress &progress)
void set_status(const string &status_, const string &substatus_="")
void set_error(const string &error_message_)
CurveShapeType hair_shape
ShadingSystem shadingsystem
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
virtual void device_free(Device *device, DeviceScene *dscene, Scene *scene)=0
static ShaderManager * create(int shadingsystem)
void tag_update(Scene *scene, uint32_t flag)
uint get_kernel_features(Scene *scene)
static void add_default(Scene *scene)
virtual void reset(Scene *scene)=0
NODE_DECLARE ShaderGraph * graph
#define CCL_NAMESPACE_END
SyclQueue void void size_t num_bytes void
size_t util_guarded_get_mem_used()
size_t util_guarded_get_mem_peak()
#define MEM_GUARDED_CALL(progress, func,...)
#define MAX_VOLUME_STACK_SIZE
@ 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
@ KERNEL_FEATURE_NODE_VOLUME
@ KERNEL_FEATURE_NODE_EMISSION
@ KERNEL_FEATURE_NODE_BSDF
@ KERNEL_FEATURE_NODE_BUMP
@ KERNEL_FEATURE_OBJECT_MOTION
@ KERNEL_FEATURE_SUBSURFACE
@ KERNEL_FEATURE_PRINCIPLED
@ KERNEL_FEATURE_CAMERA_MOTION
@ KERNEL_FEATURE_SHADOW_CATCHER
@ KERNEL_FEATURE_TRANSPARENT
@ KERNEL_FEATURE_HAIR_THICK
@ KERNEL_FEATURE_PATCH_EVALUATION
@ KERNEL_FEATURE_PATH_TRACING
@ KERNEL_FEATURE_NODE_VORONOI_EXTRA
@ KERNEL_FEATURE_POINTCLOUD
@ KERNEL_FEATURE_DENOISING
@ KERNEL_FEATURE_NODE_RAYTRACE
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
static const pxr::TfToken Shader("Shader", pxr::TfToken::Immortal)
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)
int reference_count() const
void clear_reference_count()
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)
bool update(Progress &progress)
vector< Shader * > shaders
vector< Procedural * > procedurals
int get_max_closure_count()
bool load_kernels(Progress &progress, bool lock_scene=true)
LookupTables * lookup_tables
void tag_shadow_catcher_modified()
void free_memory(bool final)
vector< ParticleSystem * > particle_systems
ImageManager * image_manager
void enable_update_stats()
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)
LightManager * light_manager
int get_volume_stack_size() const
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)
std::unique_lock< std::mutex > thread_scoped_lock