|
Blender V5.0
|
#include <geometry.h>
Public Types | |
| enum | : uint32_t { UV_PASS_NEEDED = (1 << 0) , MOTION_PASS_NEEDED = (1 << 1) , GEOMETRY_MODIFIED = (1 << 2) , OBJECT_MANAGER = (1 << 3) , MESH_ADDED = (1 << 4) , MESH_REMOVED = (1 << 5) , HAIR_ADDED = (1 << 6) , HAIR_REMOVED = (1 << 7) , POINT_ADDED = (1 << 12) , POINT_REMOVED = (1 << 13) , SHADER_ATTRIBUTE_MODIFIED = (1 << 8) , SHADER_DISPLACEMENT_MODIFIED = (1 << 9) , GEOMETRY_ADDED = MESH_ADDED | HAIR_ADDED | POINT_ADDED , GEOMETRY_REMOVED = MESH_REMOVED | HAIR_REMOVED | POINT_REMOVED , TRANSFORM_MODIFIED = (1 << 10) , VISIBILITY_MODIFIED = (1 << 11) , UPDATE_ALL = ~0u , UPDATE_NONE = 0u } |
Public Member Functions | |
| GeometryManager () | |
| ~GeometryManager () | |
| void | device_update_preprocess (Device *device, Scene *scene, Progress &progress) |
| 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, const uint32_t flag) |
| bool | need_update () const |
| void | collect_statistics (const Scene *scene, RenderStats *stats) |
Public Attributes | |
| bool | need_flags_update |
Protected Member Functions | |
| bool | displace (Device *device, Scene *scene, Mesh *mesh, Progress &progress) |
| void | create_volume_mesh (const Scene *scene, Volume *volume, Progress &progress) |
| void | update_osl_globals (Device *device, Scene *scene) |
| void | update_svm_attributes (Device *device, DeviceScene *dscene, Scene *scene, vector< AttributeRequestSet > &geom_attributes, vector< AttributeRequestSet > &object_attributes) |
| void | geom_calc_offset (Scene *scene, BVHLayout bvh_layout) |
| void | device_update_object (Device *device, DeviceScene *dscene, Scene *scene, Progress &progress) |
| void | device_update_mesh (Device *device, DeviceScene *dscene, Scene *scene, Progress &progress) |
| void | device_update_attributes (Device *device, DeviceScene *dscene, Scene *scene, Progress &progress) |
| void | device_update_bvh (Device *device, DeviceScene *dscene, Scene *scene, Progress &progress) |
| void | device_update_displacement_images (Device *device, Scene *scene, Progress &progress) |
| void | device_update_volume_images (Device *device, Scene *scene, Progress &progress) |
Definition at line 201 of file scene/geometry.h.
| anonymous enum : uint32_t |
Definition at line 210 of file scene/geometry.h.
| GeometryManager::GeometryManager | ( | ) |
Definition at line 168 of file scene/geometry.cpp.
References need_flags_update, and UPDATE_ALL.
|
default |
References flag.
| void GeometryManager::collect_statistics | ( | const Scene * | scene, |
| RenderStats * | stats ) |
Definition at line 1138 of file scene/geometry.cpp.
References NamedSizeStats::add_entry(), MeshStats::geometry, Scene::geometry, Node::get_total_size_in_bytes(), RenderStats::mesh, and Node::name.
|
protected |
Definition at line 513 of file scene/volume.cpp.
References Mesh::add_triangle(), Mesh::add_vertex(), ATTR_ELEMENT_VOXEL, ATTR_STD_VOLUME_VELOCITY, AttributeSet::attributes, Geometry::attributes, Volume::clear(), Attribute::data_voxel(), Attribute::element, ImageHandle::empty(), Shader::has_volume, hash_string(), hash_uint_to_float(), i, IMAGE_DATA_TYPE_NANOVDB_EMPTY, ImageHandle::image_memory(), indices, Scene::integrator, is_nanovdb_type(), LOG_DEBUG, max, Scene::MOTION_NONE, Node::name, Scene::need_motion(), Geometry::need_update_rebuild, Mesh::reserve_mesh(), Progress::set_status(), Attribute::std, string_printf(), texture(), VOLUME_INTERPOLATION_CUBIC, and VOLUME_INTERPOLATION_LINEAR.
Referenced by device_update_preprocess().
| void GeometryManager::device_free | ( | Device * | device, |
| DeviceScene * | dscene, | ||
| bool | force_free ) |
Definition at line 1082 of file scene/geometry.cpp.
References DeviceScene::attributes_float, DeviceScene::attributes_float2, DeviceScene::attributes_float3, DeviceScene::attributes_float4, DeviceScene::attributes_map, DeviceScene::attributes_uchar4, BVH_LAYOUT_NONE, DeviceScene::bvh_leaf_nodes, DeviceScene::bvh_nodes, DeviceScene::curve_keys, DeviceScene::curve_segments, DeviceScene::curves, DeviceScene::data, device_vector< T >::free_if_need_realloc(), Device::get_cpu_osl_memory(), DeviceScene::object_node, DeviceScene::points, DeviceScene::points_shader, DeviceScene::prim_index, DeviceScene::prim_object, DeviceScene::prim_time, DeviceScene::prim_type, DeviceScene::prim_visibility, DeviceScene::tri_shader, DeviceScene::tri_verts, DeviceScene::tri_vindex, and DeviceScene::tri_vnormal.
| void GeometryManager::device_update | ( | Device * | device, |
| DeviceScene * | dscene, | ||
| Scene * | scene, | ||
| Progress & | progress ) |
Definition at line 697 of file scene/geometry.cpp.
References Mesh::add_vertex_normals(), unique_ptr_vector< T >::begin(), Scene::dicing_camera, SubdParams::dicing_rate, unique_ptr_vector< T >::end(), Scene::geometry, Progress::get_cancel(), Geometry::has_true_displacement(), i, if(), Geometry::is_hair(), Geometry::is_mesh(), Node::is_modified(), Geometry::is_volume(), LOG_INFO, Hair::need_shadow_transparency(), Mesh::need_tesselation(), need_update(), unique_ptr_vector< T >::size(), Mesh::SUBDIVISION_ADAPTIVE_SPACE_PIXEL, Mesh::SUBDIVISION_CATMULL_CLARK, timer, and Scene::update_stats.
|
protected |
Definition at line 445 of file geometry_attributes.cpp.
References AttributeRequestSet::add(), AttributeSet::add(), AttributeTableBuilder::add(), AttributeTableBuilder::alloc(), assert, ATTR_ELEMENT_OBJECT, ATTR_PRIM_GEOMETRY, ATTR_STD_SHADOW_TRANSPARENCY, Geometry::attributes, Shader::attributes, DeviceScene::attributes_float, DeviceScene::attributes_float2, DeviceScene::attributes_float3, DeviceScene::attributes_float4, DeviceScene::attributes_uchar4, Attribute::buffer, AttributeTableBuilder::copy_to_device_if_modified(), AttributeRequest::desc, AttributeRequestSet::find(), AttributeSet::find(), Scene::geometry, Progress::get_cancel(), i, Geometry::index, Geometry::is_hair(), Attribute::kernel_type(), Attribute::modified, Scene::need_global_attributes(), device_vector< T >::need_realloc(), Hair::need_shadow_transparency(), NUM, Scene::object_manager, Scene::objects, AttributeRequestSet::requests, AttributeTableBuilder::reserve(), Progress::set_status(), Scene::shader_manager, unique_ptr_vector< T >::size(), AttributeRequest::type, update_osl_globals(), and update_svm_attributes().
|
protected |
Definition at line 95 of file geometry_bvh.cpp.
References BVHParams::best_bvh_layout(), Device::build_bvh(), Scene::bvh, BVHParams::bvh_layout, SceneParams::bvh_layout, BVH_LAYOUT_BVH2, BVH_LAYOUT_METAL, bvh_layout_name(), BVH_LAYOUT_OPTIX, DeviceScene::bvh_leaf_nodes, DeviceScene::bvh_nodes, BVHParams::bvh_type, SceneParams::bvh_type, BVH_TYPE_DYNAMIC, device_vector< T >::copy_to_device(), BVH::create(), BVHParams::curve_subdivisions, SceneParams::curve_subdivisions(), DeviceScene::data, Scene::geometry, Device::get_bvh_layout_mask(), Progress::get_cancel(), PackedBVH::leaf_nodes, LOG_INFO, PackedBVH::nodes, SceneParams::num_bvh_time_steps, BVHParams::num_motion_curve_steps, BVHParams::num_motion_point_steps, BVHParams::num_motion_triangle_steps, DeviceScene::object_node, PackedBVH::object_node, Scene::objects, Scene::params, DeviceScene::prim_index, PackedBVH::prim_index, DeviceScene::prim_object, PackedBVH::prim_object, DeviceScene::prim_time, PackedBVH::prim_time, DeviceScene::prim_type, PackedBVH::prim_type, DeviceScene::prim_visibility, PackedBVH::prim_visibility, PackedBVH::root_index, Progress::set_status(), array< T, alignment >::size(), device_vector< T >::steal_data(), BVHParams::top_level, SceneParams::use_bvh_spatial_split, SceneParams::use_bvh_unaligned_nodes, BVHParams::use_spatial_split, and BVHParams::use_unaligned_nodes.
|
protected |
Definition at line 597 of file scene/geometry.cpp.
References ImageManager::device_update_slot(), DISPLACE_BUMP, Scene::geometry, Shader::graph, ImageSlotTextureNode::handle, Shader::has_displacement, i, Scene::image_manager, Geometry::is_hair(), Node::is_modified(), Hair::need_shadow_transparency(), ImageHandle::num_svm_slots(), TaskPool::push(), Progress::set_status(), SHADER_SPECIAL_TYPE_IMAGE_SLOT, SHADER_SPECIAL_TYPE_OSL, ShaderNode::special_type, ImageHandle::svm_slot(), and TaskPool::wait_work().
|
protected |
Definition at line 26 of file geometry_mesh.cpp.
References device_vector< T >::alloc(), device_vector< T >::copy_to_device(), device_vector< T >::copy_to_device_if_modified(), Hair::curve_key_offset, DeviceScene::curve_keys, Hair::curve_segment_offset, DeviceScene::curve_segments, DeviceScene::curves, Scene::geometry, Progress::get_cancel(), Geometry::is_hair(), Geometry::is_mesh(), Geometry::is_pointcloud(), Geometry::is_volume(), device_vector< T >::need_realloc(), Hair::num_curves(), PointCloud::num_points(), Hair::num_segments(), Mesh::num_triangles(), PointCloud::pack(), Hair::pack_curves(), Mesh::pack_normals(), Mesh::pack_shaders(), Mesh::pack_verts(), DeviceScene::points, DeviceScene::points_shader, Geometry::prim_offset, Progress::set_status(), DeviceScene::tri_shader, DeviceScene::tri_verts, DeviceScene::tri_vindex, DeviceScene::tri_vnormal, and Mesh::vert_offset.
|
protected |
| void GeometryManager::device_update_preprocess | ( | Device * | device, |
| Scene * | scene, | ||
| Progress & | progress ) |
Definition at line 330 of file scene/geometry.cpp.
References ATTR_FLOAT2_MODIFIED, ATTR_FLOAT2_NEEDS_REALLOC, ATTR_FLOAT3_MODIFIED, ATTR_FLOAT3_NEEDS_REALLOC, ATTR_FLOAT4_MODIFIED, ATTR_FLOAT4_NEEDS_REALLOC, ATTR_FLOAT_MODIFIED, ATTR_FLOAT_NEEDS_REALLOC, ATTR_UCHAR4_MODIFIED, ATTR_UCHAR4_NEEDS_REALLOC, Geometry::attributes, DeviceScene::attributes_float, DeviceScene::attributes_float2, DeviceScene::attributes_float3, DeviceScene::attributes_float4, DeviceScene::attributes_map, DeviceScene::attributes_uchar4, ATTRS_NEED_REALLOC, Scene::bvh, DeviceScene::bvh_leaf_nodes, DeviceScene::bvh_nodes, create_volume_mesh(), DeviceScene::curve_keys, DeviceScene::curve_segments, DeviceScene::curves, DEVICE_CURVE_DATA_MODIFIED, DEVICE_CURVE_DATA_NEEDS_REALLOC, DEVICE_MESH_DATA_MODIFIED, DEVICE_MESH_DATA_NEEDS_REALLOC, DEVICE_POINT_DATA_MODIFIED, DEVICE_POINT_DATA_NEEDS_REALLOC, device_update_volume_images(), Scene::dscene, Scene::geometry, HAIR_ADDED, HAIR_REMOVED, Geometry::has_surface_bssrdf, Shader::has_surface_bssrdf, Geometry::has_volume, Shader::has_volume, Geometry::is_hair(), Geometry::is_mesh(), Node::is_modified(), Geometry::is_pointcloud(), Geometry::is_volume(), MESH_ADDED, MESH_REMOVED, need_flags_update, Mesh::need_tesselation(), need_update(), Shader::need_update_attribute, Shader::need_update_displacement, Geometry::need_update_rebuild, Shader::need_update_uvs, DeviceScene::object_node, POINT_ADDED, POINT_REMOVED, DeviceScene::points, DeviceScene::points_shader, DeviceScene::prim_index, DeviceScene::prim_object, DeviceScene::prim_time, DeviceScene::prim_type, DeviceScene::prim_visibility, Progress::set_status(), Shader::shadow_transparency_needs_realloc, Mesh::subd_attributes, device_vector< T >::tag_modified(), Node::tag_modified(), device_vector< T >::tag_realloc(), timer, DeviceScene::tri_shader, DeviceScene::tri_verts, DeviceScene::tri_vindex, DeviceScene::tri_vnormal, update_attribute_realloc_flags(), update_device_flags_attribute(), Scene::update_stats, VISIBILITY_MODIFIED, and Scene::volume_manager.
|
protected |
Definition at line 664 of file scene/geometry.cpp.
References ATTR_ELEMENT_VOXEL, AttributeSet::attributes, Geometry::attributes, Attribute::data_voxel(), ImageManager::device_update_slot(), Attribute::element, Scene::geometry, Scene::image_manager, Node::is_modified(), TaskPool::push(), Progress::set_status(), ImageHandle::svm_slot(), and TaskPool::wait_work().
Referenced by device_update_preprocess().
|
protected |
Definition at line 138 of file mesh_displace.cpp.
References Mesh::add_undisplaced(), ATTR_STD_MOTION_VERTEX_NORMAL, ATTR_STD_MOTION_VERTEX_POSITION, ATTR_STD_VERTEX_NORMAL, Geometry::attributes, Mesh::Triangle::compute_normal(), Attribute::data_float3(), Scene::default_surface, DISPLACE_TRUE, ShaderEval::eval(), AttributeSet::find(), Mesh::get_triangle(), Shader::has_displacement, Mesh::has_motion_blur(), Geometry::has_true_displacement(), i, Node::name, normalize, Mesh::num_triangles(), OBJECT_NONE, Scene::objects, Progress::set_status(), SHADER_EVAL_DISPLACE, unique_ptr_vector< T >::size(), step, string_printf(), Geometry::transform_negative_scaled, Mesh::update_tangents(), Mesh::Triangle::v, and zero_float3().
Definition at line 259 of file scene/geometry.cpp.
References BVH_LAYOUT_METAL, BVH_LAYOUT_MULTI_METAL, BVH_LAYOUT_MULTI_METAL_EMBREE, BVH_LAYOUT_MULTI_OPTIX, BVH_LAYOUT_MULTI_OPTIX_EMBREE, BVH_LAYOUT_OPTIX, SceneParams::bvh_type, BVH_TYPE_STATIC, Mesh::corner_offset, Hair::curve_key_offset, Hair::curve_segment_offset, Mesh::face_offset, Scene::geometry, Mesh::get_num_subd_faces(), Geometry::is_hair(), Geometry::is_mesh(), Geometry::is_pointcloud(), Geometry::is_volume(), Geometry::need_update_bvh_for_offset, Geometry::need_update_rebuild, Hair::num_curves(), PointCloud::num_points(), Hair::num_segments(), Mesh::num_triangles(), Scene::params, Geometry::prim_offset, and Mesh::vert_offset.
| bool GeometryManager::need_update | ( | ) | const |
Definition at line 1133 of file scene/geometry.cpp.
References UPDATE_NONE.
Referenced by device_update(), and device_update_preprocess().
| void GeometryManager::tag_update | ( | Scene * | scene, |
| const uint32_t | flag ) |
Definition at line 1123 of file scene/geometry.cpp.
References flag, ObjectManager::GEOMETRY_MANAGER, OBJECT_MANAGER, and Scene::object_manager.
Definition at line 176 of file scene/geometry.cpp.
References Device::get_cpu_osl_memory(), i, Node::name, Scene::objects, and unique_ptr_vector< T >::size().
Referenced by device_update_attributes().
|
protected |
Definition at line 138 of file geometry_attributes.cpp.
References device_vector< T >::alloc(), Geometry::attr_map_offset, Object::attr_map_offset, ATTR_PRIM_TYPES, ATTR_STD_NONE, DeviceScene::attributes_map, device_vector< T >::copy_to_device(), emit_attribute_map_terminator(), emit_attribute_mapping(), Scene::geometry, i, AttributeRequest::name, device_vector< T >::need_realloc(), Scene::objects, AttributeRequestSet::requests, Scene::shader_manager, AttributeRequestSet::size(), device_vector< T >::size(), size(), unique_ptr_vector< T >::size(), and AttributeRequest::std.
Referenced by device_update_attributes().
| bool GeometryManager::need_flags_update |
Definition at line 239 of file scene/geometry.h.
Referenced by device_update_preprocess(), and GeometryManager().