|
Blender V4.3
|
#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, 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 197 of file scene/geometry.h.
| anonymous enum : uint32_t |
Definition at line 201 of file scene/geometry.h.
| GeometryManager::GeometryManager | ( | ) |
Definition at line 182 of file scene/geometry.cpp.
References need_flags_update, and UPDATE_ALL.
| GeometryManager::~GeometryManager | ( | ) |
Definition at line 188 of file scene/geometry.cpp.
| void GeometryManager::collect_statistics | ( | const Scene * | scene, |
| RenderStats * | stats ) |
Definition at line 1117 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 636 of file scene/volume.cpp.
References AttributeSet::add(), VolumeMeshBuilder::add_padding(), Mesh::add_triangle(), Mesh::add_vertex(), ATTR_ELEMENT_VOXEL, ATTR_STD_FACE_NORMAL, ATTR_STD_VOLUME_VELOCITY, AttributeSet::attributes, Geometry::attributes, Volume::clear(), VolumeMeshBuilder::create_mesh(), device_memory::data_elements, Attribute::data_float3(), Attribute::data_voxel(), Attribute::element, VolumeMeshBuilder::empty_grid(), Shader::has_volume, hash_string(), hash_uint_to_float(), ImageHandle::image_memory(), indices, max, ImageHandle::metadata(), Scene::MOTION_NONE, Node::name, Scene::need_motion(), Geometry::need_update_rebuild, NULL, Mesh::reserve_mesh(), Progress::set_status(), Attribute::std, string_printf(), ImageMetaData::transform_3d, ImageHandle::vdb_loader(), VLOG_WORK, 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 1058 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::patches, DeviceScene::points, DeviceScene::points_shader, DeviceScene::prim_index, DeviceScene::prim_object, DeviceScene::prim_time, DeviceScene::prim_type, DeviceScene::prim_visibility, DeviceScene::tri_patch, DeviceScene::tri_patch_uv, DeviceScene::tri_shader, DeviceScene::tri_verts, DeviceScene::tri_vindex, and DeviceScene::tri_vnormal.
Referenced by device_update().
| void GeometryManager::device_update | ( | Device * | device, |
| DeviceScene * | dscene, | ||
| Scene * | scene, | ||
| Progress & | progress ) |
Definition at line 710 of file scene/geometry.cpp.
References NamedTimeStats::add_entry(), Mesh::add_face_normals(), Mesh::add_undisplaced(), Mesh::add_vertex_normals(), ATTR_STD_POSITION_UNDISPLACED, Geometry::attributes, DeviceScene::attributes_float, DeviceScene::attributes_float2, DeviceScene::attributes_float3, DeviceScene::attributes_float4, DeviceScene::attributes_map, DeviceScene::attributes_uchar4, BVHParams::best_bvh_layout(), Scene::bvh, SceneParams::bvh_layout, DeviceScene::bvh_leaf_nodes, DeviceScene::bvh_nodes, BVHLayout, SubdParams::camera, AttributeSet::clear_modified(), device_vector< T >::clear_modified(), Node::clear_modified(), Geometry::compute_bvh(), Device::const_copy_to(), DeviceScene::curve_keys, DeviceScene::curve_segments, DeviceScene::curves, DeviceScene::data, device_free(), device_update_attributes(), device_update_bvh(), device_update_displacement_images(), ObjectManager::device_update_flags(), device_update_mesh(), Scene::dicing_camera, displace(), TaskPool::Summary::full_report(), function_bind, geom_calc_offset(), Scene::geometry, SceneUpdateStats::geometry, Geometry::geometry_type, Device::get_bvh_layout_mask(), Progress::get_cancel(), Geometry::HAIR, Geometry::has_true_displacement(), Geometry::is_mesh(), Node::is_modified(), Geometry::MESH, Scene::MOTION_BLUR, Node::name, Geometry::need_attribute(), Geometry::need_build_bvh(), Scene::need_motion(), Hair::need_shadow_transparency(), Mesh::need_tesselation(), need_update(), Shader::need_update_attribute, Geometry::need_update_bvh_for_offset, Shader::need_update_displacement, Shader::need_update_uvs, Scene::object_manager, DeviceScene::object_node, Scene::objects, Scene::params, DeviceScene::patches, DeviceScene::points, DeviceScene::points_shader, DeviceScene::prim_index, DeviceScene::prim_object, DeviceScene::prim_time, DeviceScene::prim_type, DeviceScene::prim_visibility, TaskPool::push(), Camera::set_screen_size(), Progress::set_status(), Scene::shaders, string_printf(), Mesh::subd_attributes, Mesh::tessellate(), timer, UpdateTimeStats::times, TRANSFORM_MODIFIED, DeviceScene::tri_patch, DeviceScene::tri_patch_uv, DeviceScene::tri_shader, DeviceScene::tri_verts, DeviceScene::tri_vindex, DeviceScene::tri_vnormal, UPDATE_NONE, Hair::update_shadow_transparency(), Scene::update_stats, VISIBILITY_MODIFIED, VLOG_INFO, VLOG_WORK, Geometry::VOLUME, and TaskPool::wait_work().
|
protected |
Definition at line 485 of file geometry_attributes.cpp.
References AttributeRequestSet::add(), AttributeSet::add(), device_vector< T >::alloc(), ATTR_ELEMENT_OBJECT, ATTR_PRIM_GEOMETRY, ATTR_PRIM_SUBD, 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, device_vector< T >::copy_to_device_if_modified(), AttributeRequest::desc, ObjectManager::device_update_geom_offsets(), AttributeRequestSet::find(), AttributeSet::find(), Scene::geometry, Progress::get_cancel(), Geometry::index, Geometry::is_hair(), Geometry::is_mesh(), 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, Progress::set_status(), Scene::shader_manager, Mesh::subd_attributes, AttributeRequest::subd_desc, AttributeRequest::subd_type, AttributeRequest::type, update_attribute_element_size(), update_osl_globals(), update_svm_attributes(), and ShaderManager::use_osl().
Referenced by device_update().
|
protected |
Definition at line 106 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_name(), DeviceScene::bvh_leaf_nodes, DeviceScene::bvh_nodes, BVHParams::bvh_type, SceneParams::bvh_type, 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, 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, BVHParams::use_unaligned_nodes, and VLOG_INFO.
Referenced by device_update().
|
protected |
Definition at line 608 of file scene/geometry.cpp.
References ImageManager::device_update_slot(), DISPLACE_BUMP, function_bind, Scene::geometry, Geometry::geometry_type, Shader::graph, Geometry::HAIR, ImageSlotTextureNode::handle, Shader::has_displacement, Scene::image_manager, Node::is_modified(), Hair::need_shadow_transparency(), ShaderGraph::nodes, ImageHandle::num_tiles(), TaskPool::push(), Progress::set_status(), SHADER_SPECIAL_TYPE_IMAGE_SLOT, SHADER_SPECIAL_TYPE_OSL, ShaderNode::special_type, ImageHandle::svm_slot(), and TaskPool::wait_work().
Referenced by device_update().
|
protected |
Definition at line 39 of file geometry_mesh.cpp.
References device_vector< T >::alloc(), PackedPatchTable::copy_adjusting_offsets(), 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, Geometry::geometry_type, Progress::get_cancel(), Mesh::get_num_subd_faces(), Mesh::get_subd_face(), Geometry::is_hair(), Geometry::is_mesh(), Geometry::is_pointcloud(), Geometry::MESH, device_vector< T >::need_realloc(), Hair::num_curves(), PointCloud::num_points(), Mesh::SubdFace::num_ptex_faces(), Hair::num_segments(), Mesh::num_triangles(), PointCloud::pack(), Hair::pack_curves(), Mesh::pack_normals(), Mesh::pack_patches(), Mesh::pack_shaders(), Mesh::pack_verts(), DeviceScene::patches, DeviceScene::points, DeviceScene::points_shader, Geometry::prim_offset, Mesh::SubdFace::ptex_offset, Progress::set_status(), PackedPatchTable::total_size(), DeviceScene::tri_patch, DeviceScene::tri_patch_uv, DeviceScene::tri_shader, DeviceScene::tri_verts, DeviceScene::tri_vindex, DeviceScene::tri_vnormal, and Geometry::VOLUME.
Referenced by device_update().
|
protected |
| void GeometryManager::device_update_preprocess | ( | Device * | device, |
| Scene * | scene, | ||
| Progress & | progress ) |
Definition at line 352 of file scene/geometry.cpp.
References NamedTimeStats::add_entry(), 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, Hair::curve_shape, 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, SceneUpdateStats::geometry, Geometry::geometry_type, HAIR_ADDED, HAIR_REMOVED, SceneParams::hair_shape, 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(), 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, Scene::params, DeviceScene::patches, 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(), Mesh::subd_attributes, device_vector< T >::tag_modified(), Node::tag_modified(), device_vector< T >::tag_realloc(), timer, UpdateTimeStats::times, DeviceScene::tri_patch, DeviceScene::tri_patch_uv, 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 Geometry::VOLUME.
|
protected |
Definition at line 674 of file scene/geometry.cpp.
References ATTR_ELEMENT_VOXEL, AttributeSet::attributes, Geometry::attributes, Attribute::data_voxel(), ImageManager::device_update_slot(), Attribute::element, function_bind, Scene::geometry, Scene::image_manager, Node::is_modified(), TaskPool::push(), Progress::set_status(), ImageHandle::svm_slot(), ImageHandle::vdb_loader(), and TaskPool::wait_work().
Referenced by device_update_preprocess().
|
protected |
Definition at line 156 of file mesh_displace.cpp.
References Mesh::add_face_normals(), ATTR_STD_FACE_NORMAL, ATTR_STD_MOTION_VERTEX_NORMAL, ATTR_STD_MOTION_VERTEX_POSITION, ATTR_STD_VERTEX_NORMAL, Geometry::attributes, compute_face_normal(), Attribute::data_float3(), Scene::default_surface, DISPLACE_TRUE, ShaderEval::eval(), fill_shader_input(), AttributeSet::find(), function_bind, Mesh::get_triangle(), Shader::has_displacement, Geometry::has_motion_blur(), Geometry::has_true_displacement(), Node::name, normalize(), Mesh::num_triangles(), OBJECT_NONE, Scene::objects, pos, read_shader_output(), AttributeSet::remove(), Progress::set_status(), SHADER_EVAL_DISPLACE, string_printf(), Geometry::transform_negative_scaled, Mesh::Triangle::v, v, verts, and zero_float3().
Referenced by device_update().
Definition at line 273 of file scene/geometry.cpp.
References BVH_LAYOUT_MULTI_OPTIX, BVH_LAYOUT_MULTI_OPTIX_EMBREE, BVH_LAYOUT_OPTIX, BVHLayout, Hair::curve_key_offset, Hair::curve_segment_offset, Scene::geometry, Geometry::geometry_type, Mesh::get_num_subd_faces(), Mesh::get_subd_face(), Geometry::is_hair(), Geometry::is_pointcloud(), Geometry::MESH, Geometry::need_update_bvh_for_offset, Geometry::need_update_rebuild, Hair::num_curves(), PointCloud::num_points(), Mesh::SubdFace::num_ptex_faces(), Hair::num_segments(), Mesh::num_triangles(), Geometry::prim_offset, Mesh::SubdFace::ptex_offset, PackedPatchTable::total_size(), and Geometry::VOLUME.
Referenced by device_update().
| bool GeometryManager::need_update | ( | ) | const |
Definition at line 1112 of file scene/geometry.cpp.
References UPDATE_NONE.
Referenced by device_update(), and device_update_preprocess().
Definition at line 1102 of file scene/geometry.cpp.
References flag, ObjectManager::GEOMETRY_MANAGER, OBJECT_MANAGER, Scene::object_manager, and ObjectManager::tag_update().
Referenced by Geometry::tag_update(), ObjectManager::tag_update(), Shader::tag_update(), and Film::update_passes().
Definition at line 190 of file scene/geometry.cpp.
References Device::get_cpu_osl_memory(), Node::name, and Scene::objects.
Referenced by device_update_attributes().
|
protected |
Definition at line 158 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, ShaderManager::get_attribute_id(), AttributeRequest::name, device_vector< T >::need_realloc(), Scene::objects, AttributeRequestSet::requests, Scene::shader_manager, AttributeRequestSet::size(), device_vector< T >::size(), size(), and AttributeRequest::std.
Referenced by device_update_attributes().
| bool GeometryManager::need_flags_update |
Definition at line 230 of file scene/geometry.h.
Referenced by device_update_preprocess(), GeometryManager(), and Shader::tag_update().