93 if (!preserve_shaders)
110 foreach (
Node *
node, used_shaders) {
121 if (
name == ustring())
124 foreach (
Node *
node, used_shaders) {
137 foreach (
Node *
node, used_shaders) {
147 return (motion_steps > 1) ? 2.0f * step / (motion_steps - 1) - 1.0f : 0.0f;
152 if (motion_steps > 1) {
155 for (
int step = 0; step < motion_steps; step++) {
157 if (step_time ==
time) {
162 if (step != motion_steps / 2) {
189 foreach (
Node *
node, used_shaders) {
210 string msg =
"Updating Geometry BVH ";
217 object.set_geometry(
this);
220 geometry.push_back(
this);
222 objects.push_back(&
object);
239 params->use_bvh_unaligned_nodes;
278 foreach (
Node *
node, used_shaders) {
280 if (
shader->has_surface_emission) {
317 OSLGlobals *og = (OSLGlobals *)device->
osl_memory();
319 og->object_name_map.clear();
320 og->attribute_map.clear();
321 og->object_names.clear();
328 og->object_name_map[
object->name] = i;
329 og->object_names.push_back(object->
name);
332 foreach (ParamValue &attr, object->
attributes) {
333 OSLGlobals::Attribute osl_attr;
335 osl_attr.type = attr.type();
337 osl_attr.value = attr;
338 osl_attr.desc.offset = 0;
339 osl_attr.desc.flags = 0;
346 size_t j =
object->geometry->index;
347 assert(j < scene->geometry.size() &&
scene->
geometry[j] == object->geometry);
353 OSLGlobals::Attribute osl_attr;
356 osl_attr.desc = req.
desc;
358 if (req.
type == TypeDesc::TypeFloat)
359 osl_attr.
type = TypeDesc::TypeFloat;
360 else if (req.
type == TypeDesc::TypeMatrix)
361 osl_attr.type = TypeDesc::TypeMatrix;
367 osl_attr.type = TypeDesc::TypeColor;
374 else if (req.
name != ustring()) {
383 if (req.
subd_type == TypeDesc::TypeFloat)
384 osl_attr.
type = TypeDesc::TypeFloat;
385 else if (req.
subd_type == TypeDesc::TypeMatrix)
386 osl_attr.type = TypeDesc::TypeMatrix;
392 osl_attr.type = TypeDesc::TypeColor;
399 else if (req.
name != ustring()) {
409 (void)geom_attributes;
417 attr_map[index].
x =
id;
421 if (
type == TypeDesc::TypeFloat)
423 else if (
type == TypeDesc::TypeMatrix)
427 else if (
type == TypeFloat4)
434 attr_map[index].
w |= desc.
flags << 8;
443 attr_map[index + j].
y = chain;
444 attr_map[index + j].
z = chain ? chain_link + j : 0;
445 attr_map[index + j].
w = 0;
480 int attr_map_size = 0;
492 if (object_attributes[i].
size() == 0) {
493 object->attr_map_offset = 0;
496 object->attr_map_offset = attr_map_size;
501 if (attr_map_size == 0)
532 if (attributes.
size() > 0) {
533 int index =
object->attr_map_offset;
551 size_t *attr_float_size,
552 size_t *attr_float2_size,
553 size_t *attr_float3_size,
554 size_t *attr_uchar4_size)
563 *attr_uchar4_size +=
size;
565 else if (mattr->
type == TypeDesc::TypeFloat) {
566 *attr_float_size +=
size;
569 *attr_float2_size +=
size;
571 else if (mattr->
type == TypeDesc::TypeMatrix) {
572 *attr_float3_size +=
size * 4;
575 *attr_float3_size +=
size;
580 void GeometryManager::update_attribute_element_offset(
Geometry *geom,
582 size_t &attr_float_offset,
584 size_t &attr_float2_offset,
586 size_t &attr_float3_offset,
588 size_t &attr_uchar4_offset,
604 int &offset = desc.
offset;
613 offset = attr_uchar4_offset;
615 assert(attr_uchar4.
size() >= offset +
size);
617 for (
size_t k = 0; k <
size; k++) {
618 attr_uchar4[offset + k] =
data[k];
621 attr_uchar4_offset +=
size;
623 else if (mattr->
type == TypeDesc::TypeFloat) {
625 offset = attr_float_offset;
627 assert(attr_float.
size() >= offset +
size);
629 for (
size_t k = 0; k <
size; k++) {
630 attr_float[offset + k] =
data[k];
633 attr_float_offset +=
size;
637 offset = attr_float2_offset;
639 assert(attr_float2.
size() >= offset +
size);
641 for (
size_t k = 0; k <
size; k++) {
642 attr_float2[offset + k] =
data[k];
645 attr_float2_offset +=
size;
647 else if (mattr->
type == TypeDesc::TypeMatrix) {
649 offset = attr_float3_offset;
651 assert(attr_float3.
size() >= offset +
size * 3);
653 for (
size_t k = 0; k <
size * 3; k++) {
654 attr_float3[offset + k] = (&tfm->
x)[k];
657 attr_float3_offset +=
size * 3;
661 offset = attr_float3_offset;
663 assert(attr_float3.
size() >= offset +
size);
665 for (
size_t k = 0; k <
size; k++) {
666 attr_float3[offset + k] =
data[k];
669 attr_float3_offset +=
size;
682 offset -=
mesh->vert_offset;
684 offset -=
mesh->vert_offset;
689 offset -=
mesh->face_offset;
695 offset -=
mesh->corner_offset;
699 Hair *hair =
static_cast<Hair *
>(geom);
720 progress.
set_status(
"Updating Mesh",
"Computing attributes");
733 foreach (
Node *
node, geom->get_used_shaders()) {
735 geom_attributes[i].add(
shader->attributes);
748 size_t geom_idx = geom->
index;
750 assert(geom_idx < scene->geometry.size() &&
scene->
geometry[geom_idx] == geom);
758 for (
size_t j = 0; j <
object->attributes.size(); j++) {
759 ParamValue ¶m =
object->attributes[j];
763 attributes.
add(param.name());
766 assert(param.datasize() == attr->
buffer.size());
767 memcpy(attr->
buffer.data(), param.data(), param.datasize());
779 size_t attr_float_size = 0;
780 size_t attr_float2_size = 0;
781 size_t attr_float3_size = 0;
782 size_t attr_uchar4_size = 0;
816 foreach (
Attribute &attr, object_attribute_values[i].attributes) {
837 size_t attr_float_offset = 0;
838 size_t attr_float2_offset = 0;
839 size_t attr_float3_offset = 0;
840 size_t attr_uchar4_offset = 0;
857 update_attribute_element_offset(geom,
877 subd_attr->
modified |= copy_all_data;
880 update_attribute_element_offset(
mesh,
908 update_attribute_element_offset(object->geometry,
941 progress.
set_status(
"Updating Mesh",
"Copying Attributes to device");
958 size_t vert_size = 0;
961 size_t curve_key_size = 0;
962 size_t curve_size = 0;
964 size_t patch_size = 0;
965 size_t face_size = 0;
966 size_t corner_size = 0;
968 size_t optix_prim_size = 0;
983 mesh->vert_offset = vert_size;
986 mesh->patch_offset = patch_size;
987 mesh->face_offset = face_size;
988 mesh->corner_offset = corner_size;
998 if (
mesh->patch_table) {
999 mesh->patch_table_offset = patch_size;
1005 corner_size +=
mesh->subd_face_corners.
size();
1011 Hair *hair =
static_cast<Hair *
>(geom);
1016 curve_key_size += hair->get_curve_keys().size();
1029 size_t vert_size = 0;
1030 size_t tri_size = 0;
1032 size_t curve_key_size = 0;
1033 size_t curve_size = 0;
1035 size_t patch_size = 0;
1049 if (
mesh->patch_table) {
1050 mesh->patch_table_offset = patch_size;
1056 Hair *hair =
static_cast<Hair *
>(geom);
1058 curve_key_size += hair->get_curve_keys().size();
1065 if (for_displacement) {
1089 if (tri_size != 0) {
1091 progress.
set_status(
"Updating Mesh",
"Computing normals");
1109 if (
mesh->shader_is_modified() ||
mesh->smooth_is_modified() ||
1110 mesh->triangles_is_modified() || copy_all_data) {
1114 if (
mesh->verts_is_modified() || copy_all_data) {
1118 if (
mesh->triangles_is_modified() ||
mesh->vert_patch_uv_is_modified() || copy_all_data) {
1122 &tri_patch_uv[
mesh->vert_offset],
1133 progress.
set_status(
"Updating Mesh",
"Copying Mesh to device");
1142 if (curve_size != 0) {
1143 progress.
set_status(
"Updating Mesh",
"Copying Strands to device");
1146 float4 *curves = dscene->
curves.
alloc(curve_size);
1152 Hair *hair =
static_cast<Hair *
>(geom);
1154 bool curve_keys_co_modified = hair->curve_radius_is_modified() ||
1155 hair->curve_keys_is_modified();
1156 bool curve_data_modified = hair->curve_shader_is_modified() ||
1157 hair->curve_first_key_is_modified();
1159 if (!curve_keys_co_modified && !curve_data_modified && !copy_all_data) {
1177 progress.
set_status(
"Updating Mesh",
"Copying Patches to device");
1187 mesh->corner_offset);
1189 if (
mesh->patch_table) {
1191 mesh->patch_table_offset);
1202 if (for_displacement) {
1226 progress.
set_status(
"Updating Scene BVH",
"Building");
1242 const bool can_refit =
scene->
bvh !=
nullptr &&
1260 device->
build_bvh(bvh, progress, can_refit);
1269 if (has_bvh2_layout) {
1270 pack = std::move(
static_cast<BVH2 *
>(bvh)->pack);
1273 progress.
set_status(
"Updating Scene BVH",
"Packing BVH primitives");
1275 size_t num_prims = 0;
1276 size_t num_tri_verts = 0;
1284 Hair *hair =
static_cast<Hair *
>(geom);
1312 unordered_map<const Geometry *, pair<int, uint>> geometry_to_object_info;
1315 const Geometry *
const geom = ob->get_geometry();
1316 pair<int, uint> &info = geometry_to_object_info[geom];
1339 const pair<int, uint> &info = geometry_to_object_info[geom];
1347 progress.
set_status(
"Updating Scene BVH",
"Copying BVH to device");
1436 else if (attr.
type == TypeDesc::TypeFloat) {
1442 else if (attr.
type == TypeDesc::TypeMatrix) {
1461 scene->update_stats->geometry.times.add_entry({
"device_update_preprocess", time});
1465 progress.set_status(
"Updating Meshes Flags");
1468 bool volume_images_updated =
false;
1480 if (
mesh->subd_attributes.modified) {
1485 foreach (
Node *
node, geom->get_used_shaders()) {
1487 if (
shader->has_volume) {
1491 if (
shader->has_surface_bssrdf) {
1495 if (
shader->need_update_uvs) {
1507 if (
shader->need_update_attribute) {
1519 if (
shader->need_update_displacement) {
1523 mesh->tag_verts_modified();
1524 mesh->tag_subd_dicing_rate_modified();
1525 mesh->tag_subd_max_level_modified();
1526 mesh->tag_subd_objecttoworld_modified();
1545 if (!volume_images_updated) {
1546 progress.set_status(
"Updating Meshes Volume Bounds");
1547 device_update_volume_images(device,
scene, progress);
1548 volume_images_updated =
true;
1552 create_volume_mesh(volume, progress);
1560 Hair *hair =
static_cast<Hair *
>(geom);
1583 if (update_flags & (MESH_ADDED | MESH_REMOVED)) {
1587 if (update_flags & (HAIR_ADDED | HAIR_REMOVED)) {
1624 if ((update_flags & VISIBILITY_MODIFIED) != 0) {
1672 need_flags_update =
false;
1679 progress.
set_status(
"Updating Displacement Images");
1682 set<int> bump_images;
1685 foreach (
Node *
node, geom->get_used_shaders()) {
1699 bump_images.insert(slot);
1706 foreach (
int slot, bump_images) {
1715 progress.
set_status(
"Updating Volume Images");
1718 set<int> volume_images;
1734 const int slot = handle.
svm_slot();
1736 volume_images.insert(slot);
1742 foreach (
int slot, volume_images) {
1759 bool true_displacement_used =
false;
1760 size_t total_tess_needed = 0;
1765 scene->update_stats->geometry.times.add_entry({
"device_update (normals)", time});
1784 total_tess_needed++;
1789 true_displacement_used =
true;
1799 if (progress.get_cancel()) {
1804 if (total_tess_needed) {
1807 scene->update_stats->geometry.times.add_entry(
1808 {
"device_update (adaptive subdivision)", time});
1814 dicing_camera->get_full_width(), dicing_camera->get_full_height(), 1);
1825 string msg =
"Tessellating ";
1832 progress.set_status(
"Updating Mesh", msg);
1840 if (progress.get_cancel()) {
1846 if (progress.get_cancel()) {
1852 bool old_need_object_flags_update =
false;
1853 if (true_displacement_used) {
1856 scene->update_stats->geometry.times.add_entry(
1857 {
"device_update (displacement: load images)", time});
1860 device_update_displacement_images(device,
scene, progress);
1866 device_free(device, dscene,
false);
1869 device->get_bvh_layout_mask());
1870 mesh_calc_offset(
scene, bvh_layout);
1871 if (true_displacement_used) {
1874 scene->update_stats->geometry.times.add_entry(
1875 {
"device_update (displacement: copy meshes to device)", time});
1878 device_update_mesh(device, dscene,
scene,
true, progress);
1880 if (progress.get_cancel()) {
1887 scene->update_stats->geometry.times.add_entry({
"device_update (attributes)", time});
1890 device_update_attributes(device, dscene,
scene, progress);
1891 if (progress.get_cancel()) {
1897 bool displacement_done =
false;
1903 scene->update_stats->geometry.times.add_entry({
"device_update (displacement)", time});
1911 if (displace(device, dscene,
scene,
mesh, progress)) {
1912 displacement_done =
true;
1923 if (progress.get_cancel()) {
1929 if (progress.get_cancel()) {
1934 if (displacement_done) {
1937 scene->update_stats->geometry.times.add_entry(
1938 {
"device_update (displacement: attributes)", time});
1941 device_free(device, dscene,
false);
1943 device_update_attributes(device, dscene,
scene, progress);
1944 if (progress.get_cancel()) {
1954 bool need_update_scene_bvh = (
scene->
bvh ==
nullptr ||
1955 (update_flags & (TRANSFORM_MODIFIED | VISIBILITY_MODIFIED)) != 0);
1959 scene->update_stats->geometry.times.add_entry({
"device_update (build object BVHs)", time});
1967 need_update_scene_bvh =
true;
1978 VLOG(2) <<
"Objects BVH build pool statistics:\n" << summary.
full_report();
1982 shader->need_update_uvs =
false;
1983 shader->need_update_attribute =
false;
1984 shader->need_update_displacement =
false;
1994 scene->update_stats->geometry.times.add_entry({
"device_update (compute bounds)", time});
1998 object->compute_bounds(motion_blur);
2002 if (progress.get_cancel()) {
2006 if (need_update_scene_bvh) {
2009 scene->update_stats->geometry.times.add_entry({
"device_update (build scene BVH)", time});
2012 device_update_bvh(device, dscene,
scene, progress);
2013 if (progress.get_cancel()) {
2021 device->get_bvh_layout_mask());
2026 scene->update_stats->geometry.times.add_entry(
2027 {
"device_update (copy meshes to device)", time});
2030 device_update_mesh(device, dscene,
scene,
false, progress);
2031 if (progress.get_cancel()) {
2036 if (true_displacement_used) {
2058 update_flags = UPDATE_NONE;
2115 OSLGlobals *og = (OSLGlobals *)device->
osl_memory();
2118 og->object_name_map.clear();
2119 og->attribute_map.clear();
2120 og->object_names.clear();
2129 update_flags |= flag;
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
ATTR_WARN_UNUSED_RESULT const void * element
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
CCL_NAMESPACE_BEGIN const char * bvh_layout_name(BVHLayout layout)
CCL_NAMESPACE_BEGIN typedef KernelBVHLayout BVHLayout
vector< AttributeRequest > requests
AttributeDescriptor subd_desc
Attribute * add(ustring name, TypeDesc type, AttributeElement element)
list< Attribute > attributes
Attribute * find(ustring name) const
ImageHandle & data_voxel()
Transform * data_transform()
size_t element_size(Geometry *geom, AttributePrimitive prim) const
static const char * standard_name(AttributeStandard std)
int num_motion_triangle_steps
static BVHLayout best_bvh_layout(BVHLayout requested_layout, BVHLayoutMask supported_layouts)
int num_motion_curve_steps
vector< Geometry * > geometry
static BVH * create(const BVHParams ¶ms, const vector< Geometry * > &geometry, const vector< Object * > &objects, Device *device)
vector< Object * > objects
device_vector< float4 > tri_vnormal
device_vector< float4 > prim_tri_verts
device_vector< float2 > prim_time
device_vector< uint > patches
device_vector< uint > prim_visibility
device_vector< uint4 > tri_vindex
device_vector< uint > prim_tri_index
device_vector< float2 > attributes_float2
device_vector< uint4 > attributes_map
device_vector< float4 > curves
device_vector< int > object_node
device_vector< int > prim_object
device_vector< float4 > curve_keys
device_vector< int4 > bvh_leaf_nodes
device_vector< uint > tri_shader
device_vector< float > attributes_float
device_vector< float2 > tri_patch_uv
device_vector< uint > tri_patch
device_vector< int > prim_type
device_vector< float4 > attributes_float3
device_vector< int4 > bvh_nodes
device_vector< int > prim_index
device_vector< uchar4 > attributes_uchar4
virtual BVHLayoutMask get_bvh_layout_mask() const =0
virtual void build_bvh(BVH *bvh, Progress &progress, bool refit)
virtual void * osl_memory()
void device_update_displacement_images(Device *device, Scene *scene, Progress &progress)
void update_osl_attributes(Device *device, Scene *scene, vector< AttributeRequestSet > &geom_attributes)
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
void device_update_mesh(Device *device, DeviceScene *dscene, Scene *scene, bool for_displacement, Progress &progress)
void mesh_calc_offset(Scene *scene, BVHLayout bvh_layout)
void device_update_attributes(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 device_update_bvh(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
void collect_statistics(const Scene *scene, RenderStats *stats)
void device_update_preprocess(Device *device, Scene *scene, Progress &progress)
void device_update_volume_images(Device *device, Scene *scene, Progress &progress)
void update_svm_attributes(Device *device, DeviceScene *dscene, Scene *scene, vector< AttributeRequestSet > &geom_attributes, vector< AttributeRequestSet > &object_attributes)
Transform transform_normal
void compute_bvh(Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, int n, int total)
float motion_time(int step) const
virtual void compute_bounds()=0
virtual void pack_primitives(PackedBVH *pack, int object, uint visibility, PackFlags pack_flags)=0
bool need_update_bvh_for_offset
bool has_voxel_attributes() const
bool has_true_displacement() const
bool need_build_bvh(BVHLayout layout) const
int motion_step(float time) const
bool need_attribute(Scene *scene, AttributeStandard std)
bool is_instanced() const
AttributeRequestSet needed_attributes()
bool has_motion_blur() const
void tag_update(Scene *scene, bool rebuild)
Geometry(const NodeType *node_type, const Type type)
bool transform_negative_scaled
void tag_bvh_update(bool rebuild)
virtual void clear(bool preserve_shaders=false)
VDBImageLoader * vdb_loader(const int tile_index=0) const
int svm_slot(const int tile_index=0) const
void device_update_slot(Device *device, Scene *scene, int slot, Progress *progress)
void tag_update(Scene *scene, uint32_t flag)
void add_entry(const NamedSizeEntry &entry)
void tag_update(Scene *scene, uint32_t flag)
void device_update_flags(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress, bool bounds_valid=true)
void device_update_mesh_offsets(Device *device, DeviceScene *dscene, Scene *scene)
void set_status(const string &status_, const string &substatus_="")
bool use_bvh_unaligned_nodes
bool use_bvh_spatial_split
CurveShapeType hair_shape
uint get_attribute_id(ustring name)
T * resize(size_t newsize)
T * alloc(size_t width, size_t height=0, size_t depth=0)
void copy_to_device_if_modified()
void give_data(array< T > &to)
void steal_data(array< T > &from)
void free_if_need_realloc(bool force_free)
static void emit_attribute_map_terminator(uint4 *attr_map, int index, bool chain, uint chain_link)
static void update_device_flags_attribute(uint32_t &device_update_flags, const AttributeSet &attributes)
NODE_ABSTRACT_DEFINE(Geometry)
static void emit_attribute_map_entry(uint4 *attr_map, int index, uint id, TypeDesc type, const AttributeDescriptor &desc)
static void emit_attribute_mapping(uint4 *attr_map, int index, Scene *scene, AttributeRequest &req, Geometry *geom)
CCL_NAMESPACE_BEGIN PackFlags operator|=(PackFlags &pack_flags, uint32_t value)
static void update_attribute_element_size(Geometry *geom, Attribute *mattr, AttributePrimitive prim, size_t *attr_float_size, size_t *attr_float2_size, size_t *attr_float3_size, size_t *attr_uchar4_size)
@ DEVICE_MESH_DATA_NEEDS_REALLOC
@ ATTR_UCHAR4_NEEDS_REALLOC
@ ATTR_FLOAT2_NEEDS_REALLOC
@ DEVICE_MESH_DATA_MODIFIED
@ DEVICE_CURVE_DATA_MODIFIED
@ ATTR_FLOAT_NEEDS_REALLOC
@ CURVE_DATA_NEED_REALLOC
@ DEVICE_CURVE_DATA_NEEDS_REALLOC
@ ATTR_FLOAT3_NEEDS_REALLOC
@ SHADER_SPECIAL_TYPE_IMAGE_SLOT
#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_POSITION_UNDISPLACED
@ ATTR_STD_MOTION_VERTEX_POSITION
@ BVH_LAYOUT_MULTI_OPTIX_EMBREE
@ ATTR_ELEMENT_CORNER_BYTE
@ ATTR_ELEMENT_CURVE_KEY_MOTION
@ ATTR_ELEMENT_VERTEX_MOTION
static void vnormal(PROCESS *process, const float point[3], float r_no[3])
#define SOCKET_NODE_ARRAY(name, ui_name, node_type,...)
#define SOCKET_UINT(name, ui_name, default_value,...)
#define SOCKET_BOOLEAN(name, ui_name, default_value,...)
void update(Scene *scene)
void set_screen_size_and_resolution(int width_, int height_, int resolution_)
void pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_data, size_t curvekey_offset)
size_t num_curves() const
size_t num_segments() const
CurveShapeType curve_shape
int num_ptex_faces() const
void tessellate(DiagSplit *split)
size_t get_num_subd_faces() const
void add_vertex_normals()
Triangle get_triangle(size_t i) const
void pack_verts(const vector< uint > &tri_prim_index, uint4 *tri_vindex, uint *tri_patch, float2 *tri_patch_uv, size_t vert_offset, size_t tri_offset)
void pack_normals(float4 *vnormal)
void pack_patches(uint *patch_data, uint vert_offset, uint face_offset, uint corner_offset)
@ SUBDIVISION_CATMULL_CLARK
size_t num_triangles() const
SubdFace get_subd_face(size_t index) const
void pack_shaders(Scene *scene, uint *shader)
static NodeType * add(const char *name, CreateFunc create, Type type=NONE, const NodeType *base=NULL)
size_t get_total_size_in_bytes() const
vector< ParamValue > attributes
int get_device_index() const
uint visibility_for_tracing() const
array< uint > prim_visibility
array< float4 > prim_tri_verts
array< float2 > prim_time
array< uint > prim_tri_index
void copy_adjusting_offsets(uint *dest, int doffset)
bool need_global_attribute(AttributeStandard std)
vector< Geometry * > geometry
void need_global_attributes(AttributeRequestSet &attributes)
vector< Shader * > shaders
ImageManager * image_manager
vector< Object * > objects
ObjectManager * object_manager
ShaderManager * shader_manager
LightManager * light_manager
SceneUpdateStats * update_stats
GeometryManager * geometry_manager
string full_report() const
void push(TaskRunFunction &&task)
void wait_work(Summary *stats=NULL)
#define MEM_GUARDED_CALL(progress, func,...)
ccl_device_inline float4 float3_to_float4(const float3 a)
ccl_device_inline uint as_uint(int i)
static constexpr TypeDesc TypeRGBA(TypeDesc::FLOAT, TypeDesc::VEC4, TypeDesc::COLOR)
CCL_NAMESPACE_BEGIN static constexpr OIIO_NAMESPACE_USING TypeDesc TypeFloat2(TypeDesc::FLOAT, TypeDesc::VEC2)
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)