Blender
V3.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 |
Definition at line 164 of file scene/geometry.h.
anonymous enum : uint32_t |
Definition at line 168 of file scene/geometry.h.
GeometryManager::GeometryManager | ( | ) |
Definition at line 295 of file scene/geometry.cpp.
References need_flags_update, and UPDATE_ALL.
GeometryManager::~GeometryManager | ( | ) |
Definition at line 301 of file scene/geometry.cpp.
void GeometryManager::collect_statistics | ( | const Scene * | scene, |
RenderStats * | stats | ||
) |
Definition at line 2214 of file scene/geometry.cpp.
References NamedSizeStats::add_entry(), Scene::geometry, MeshStats::geometry, Node::get_total_size_in_bytes(), RenderStats::mesh, Node::name, and scene.
Referenced by Scene::collect_statistics().
|
protected |
Definition at line 634 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, node, NULL, Mesh::reserve_mesh(), scene, Progress::set_status(), Attribute::std, string_printf(), ImageMetaData::transform_3d, ImageHandle::vdb_loader(), VLOG_WORK, void, VOLUME_INTERPOLATION_CUBIC, and VOLUME_INTERPOLATION_LINEAR.
void GeometryManager::device_free | ( | Device * | device, |
DeviceScene * | dscene, | ||
bool | force_free | ||
) |
Definition at line 2154 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, DeviceScene::tri_vnormal, and void.
Referenced by Scene::free_memory().
void GeometryManager::device_update | ( | Device * | device, |
DeviceScene * | dscene, | ||
Scene * | scene, | ||
Progress & | progress | ||
) |
Definition at line 1797 of file scene/geometry.cpp.
References Mesh::add_face_normals(), Mesh::add_undisplaced(), Mesh::add_vertex_normals(), ATTR_STD_POSITION_UNDISPLACED, Scene::geometry, Geometry::geometry_type, Progress::get_cancel(), Geometry::HAIR, Geometry::has_true_displacement(), Node::is_modified(), Geometry::MESH, mesh, Geometry::need_attribute(), Hair::need_shadow_transparency(), Mesh::need_tesselation(), need_update(), scene, time, Scene::update_stats, VLOG_INFO, and Geometry::VOLUME.
Referenced by Scene::device_update().
|
protected |
Definition at line 743 of file scene/geometry.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(), mesh, Attribute::modified, Scene::need_global_attributes(), device_vector< T >::need_realloc(), node, NUM, Scene::object_manager, Scene::objects, AttributeRequestSet::requests, scene, Progress::set_status(), Scene::shader_manager, AttributeRequest::subd_desc, AttributeRequest::subd_type, AttributeRequest::type, update_attribute_element_size(), update_osl_attributes(), update_svm_attributes(), and ShaderManager::use_osl().
|
protected |
Definition at line 1273 of file scene/geometry.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, device_vector< T >::copy_to_device(), BVH::create(), BVHParams::curve_subdivisions, SceneParams::curve_subdivisions(), DeviceScene::data, KernelData::device_bvh, 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, PackedBVH::object_node, DeviceScene::object_node, Scene::objects, Scene::params, PackedBVH::prim_index, DeviceScene::prim_index, PackedBVH::prim_object, DeviceScene::prim_object, PackedBVH::prim_time, DeviceScene::prim_time, PackedBVH::prim_type, DeviceScene::prim_type, PackedBVH::prim_visibility, DeviceScene::prim_visibility, PackedBVH::root_index, scene, 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.
|
protected |
Definition at line 1712 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(), node, ShaderGraph::nodes, ImageHandle::num_tiles(), blender::compositor::pool, TaskPool::push(), scene, Progress::set_status(), SHADER_SPECIAL_TYPE_IMAGE_SLOT, ImageHandle::svm_slot(), and TaskPool::wait_work().
|
protected |
Definition at line 1088 of file scene/geometry.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, 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, 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, scene, Progress::set_status(), Mesh::size, PackedPatchTable::total_size(), DeviceScene::tri_patch, DeviceScene::tri_patch_uv, DeviceScene::tri_shader, DeviceScene::tri_verts, DeviceScene::tri_vindex, DeviceScene::tri_vnormal, vnormal(), and Geometry::VOLUME.
|
protected |
void GeometryManager::device_update_preprocess | ( | Device * | device, |
Scene * | scene, | ||
Progress & | progress | ||
) |
Definition at line 1457 of file scene/geometry.cpp.
References need_flags_update, need_update(), scene, time, and Scene::update_stats.
Referenced by Scene::device_update().
|
protected |
Definition at line 1761 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(), blender::compositor::pool, TaskPool::push(), scene, Progress::set_status(), ImageHandle::svm_slot(), ImageHandle::vdb_loader(), and TaskPool::wait_work().
|
protected |
Definition at line 153 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(), mesh, Node::name, node, blender::math::normalize(), Mesh::num_triangles(), OBJECT_NONE, Scene::objects, pos, read_shader_output(), AttributeSet::remove(), scene, Progress::set_status(), SHADER_EVAL_DISPLACE, Mesh::size, string_printf(), Geometry::transform_negative_scaled, Mesh::Triangle::v, v, verts, and zero_float3().
Definition at line 1009 of file scene/geometry.cpp.
References BVH_LAYOUT_MULTI_OPTIX, BVH_LAYOUT_MULTI_OPTIX_EMBREE, BVH_LAYOUT_OPTIX, 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, 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, scene, Mesh::size, PackedPatchTable::total_size(), and Geometry::VOLUME.
bool GeometryManager::need_update | ( | ) | const |
Definition at line 2209 of file scene/geometry.cpp.
References UPDATE_NONE.
Referenced by device_update(), device_update_preprocess(), and Scene::need_data_update().
Definition at line 2199 of file scene/geometry.cpp.
References ObjectManager::GEOMETRY_MANAGER, OBJECT_MANAGER, Scene::object_manager, scene, and ObjectManager::tag_update().
Referenced by Scene::create_node(), Scene::delete_node_impl(), Scene::delete_nodes(), Scene::reset(), Shader::tag_update(), Geometry::tag_update(), ObjectManager::tag_update(), and Film::update_passes().
|
protected |
Definition at line 305 of file scene/geometry.cpp.
References ATTR_ELEMENT_NONE, ATTR_ELEMENT_OBJECT, ATTR_PRIM_GEOMETRY, ATTR_PRIM_SUBD, ATTR_PRIM_TYPES, ATTR_STD_NONE, Attribute, Object::attributes, AttributeRequest::desc, AttributeDescriptor::element, Scene::geometry, Device::get_cpu_osl_memory(), Node::name, AttributeRequest::name, Scene::objects, AttributeRequestSet::requests, scene, Attribute::standard_name(), AttributeRequest::std, AttributeRequest::subd_desc, AttributeRequest::subd_type, AttributeDescriptor::type, AttributeRequest::type, TypeFloat2(), TypeRGBA(), and void.
Referenced by device_update_attributes().
|
protected |
Definition at line 468 of file scene/geometry.cpp.
References device_vector< T >::alloc(), Geometry::attr_map_offset, Object::attr_map_offset, ATTR_PRIM_TYPES, DeviceScene::attributes_map, device_vector< T >::copy_to_device(), emit_attribute_map_terminator(), emit_attribute_mapping(), Scene::geometry, device_vector< T >::need_realloc(), Scene::objects, AttributeRequestSet::requests, scene, AttributeRequestSet::size(), device_vector< T >::size(), and size().
Referenced by device_update_attributes().
bool GeometryManager::need_flags_update |
Definition at line 197 of file scene/geometry.h.
Referenced by device_update_preprocess(), GeometryManager(), and Shader::tag_update().