|
Blender V5.0
|
#include <hair.h>
Inherits Geometry.
Classes | |
| struct | Curve |
Public Member Functions | |
| Hair () | |
| ~Hair () override | |
| void | clear (bool preserve_shaders=false) override |
| void | resize_curves (const int numcurves, const int numkeys) |
| void | reserve_curves (const int numcurves, const int numkeys) |
| void | add_curve_key (const float3 co, const float radius) |
| void | add_curve (const int first_key, const int shader) |
| void | copy_center_to_motion_step (const int motion_step) |
| void | compute_bounds () override |
| void | apply_transform (const Transform &tfm, const bool apply_to_motion) override |
| Curve | get_curve (const size_t i) const |
| size_t | num_keys () const |
| size_t | num_curves () const |
| size_t | num_segments () const |
| bool | is_traceable () const |
| void | get_uv_tiles (ustring map, unordered_set< int > &tiles) override |
| void | pack_curves (Scene *scene, float4 *curve_key_co, KernelCurve *curve, KernelCurveSegment *curve_segments) |
| PrimitiveType | primitive_type () const override |
| bool | need_shadow_transparency () |
| bool | update_shadow_transparency (Device *device, Scene *scene, Progress &progress) |
| Public Member Functions inherited from Geometry | |
| Geometry (const NodeType *node_type, const Type type) | |
| ~Geometry () override | |
| bool | need_attribute (Scene *scene, AttributeStandard std) |
| bool | need_attribute (Scene *scene, ustring name) |
| AttributeRequestSet | needed_attributes () |
| float | motion_time (const int step) const |
| int | motion_step (const float time) const |
| void | compute_bvh (Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, const size_t n, size_t total) |
| bool | need_build_bvh (BVHLayout layout) const |
| bool | is_instanced () const |
| bool | has_true_displacement () const |
| virtual bool | has_motion_blur () const |
| bool | has_voxel_attributes () const |
| bool | is_mesh () const |
| bool | is_hair () const |
| bool | is_pointcloud () const |
| bool | is_volume () const |
| bool | is_light () const |
| void | tag_update (Scene *scene, bool rebuild) |
| Public Member Functions inherited from Node | |
| Node (const NodeType *type, ustring name=ustring()) | |
| virtual | ~Node ()=0 |
| void | set (const SocketType &input, bool value) |
| void | set (const SocketType &input, const int value) |
| void | set (const SocketType &input, const uint value) |
| void | set (const SocketType &input, const uint64_t value) |
| void | set (const SocketType &input, const float value) |
| void | set (const SocketType &input, const float2 value) |
| void | set (const SocketType &input, const float3 value) |
| void | set (const SocketType &input, const char *value) |
| void | set (const SocketType &input, ustring value) |
| void | set (const SocketType &input, const Transform &value) |
| void | set (const SocketType &input, Node *value) |
| template<class ValueType, std::enable_if_t< std::is_enum_v< ValueType >, bool > = true> | |
| void | set (const SocketType &input, const ValueType &value) |
| void | set (const SocketType &input, array< bool > &value) |
| void | set (const SocketType &input, array< int > &value) |
| void | set (const SocketType &input, array< float > &value) |
| void | set (const SocketType &input, array< float2 > &value) |
| void | set (const SocketType &input, array< float3 > &value) |
| void | set (const SocketType &input, array< ustring > &value) |
| void | set (const SocketType &input, array< Transform > &value) |
| void | set (const SocketType &input, array< Node * > &value) |
| bool | get_bool (const SocketType &input) const |
| int | get_int (const SocketType &input) const |
| uint | get_uint (const SocketType &input) const |
| uint64_t | get_uint64 (const SocketType &input) const |
| float | get_float (const SocketType &input) const |
| float2 | get_float2 (const SocketType &input) const |
| float3 | get_float3 (const SocketType &input) const |
| ustring | get_string (const SocketType &input) const |
| Transform | get_transform (const SocketType &input) const |
| Node * | get_node (const SocketType &input) const |
| const array< bool > & | get_bool_array (const SocketType &input) const |
| const array< int > & | get_int_array (const SocketType &input) const |
| const array< float > & | get_float_array (const SocketType &input) const |
| const array< float2 > & | get_float2_array (const SocketType &input) const |
| const array< float3 > & | get_float3_array (const SocketType &input) const |
| const array< ustring > & | get_string_array (const SocketType &input) const |
| const array< Transform > & | get_transform_array (const SocketType &input) const |
| const array< Node * > & | get_node_array (const SocketType &input) const |
| bool | has_default_value (const SocketType &input) const |
| void | set_default_value (const SocketType &input) |
| bool | equals_value (const Node &other, const SocketType &socket) const |
| void | copy_value (const SocketType &socket, const Node &other, const SocketType &other_socket) |
| void | set_value (const SocketType &socket, const Node &other, const SocketType &other_socket) |
| bool | equals (const Node &other) const |
| void | hash (MD5Hash &md5) |
| size_t | get_total_size_in_bytes () const |
| bool | is_a (const NodeType *type) |
| bool | socket_is_modified (const SocketType &input) const |
| bool | is_modified () const |
| void | tag_modified () |
| void | clear_modified () |
| void | print_modified_sockets () const |
| const NodeOwner * | get_owner () const |
| void | set_owner (const NodeOwner *owner_) |
| int | reference_count () const |
| void | reference () |
| void | dereference () |
| void | clear_reference_count () |
Public Attributes | |
| size_t | curve_key_offset |
| size_t | curve_segment_offset |
| CurveShapeType | curve_shape |
| Public Attributes inherited from Geometry | |
| Type | geometry_type |
| AttributeSet | attributes |
| BoundBox | bounds |
| bool | transform_applied |
| bool | transform_negative_scaled |
| Transform | transform_normal |
| unique_ptr< BVH > | bvh |
| size_t | attr_map_offset |
| size_t | prim_offset |
| bool | has_volume |
| bool | has_surface_bssrdf |
| bool | need_update_rebuild |
| bool | need_update_bvh_for_offset |
| size_t | index |
| Public Attributes inherited from Node | |
| ustring | name |
| const NodeType * | type |
| InternalNode | internal |
| LeafNode | leaf |
Additional Inherited Members | |
| Public Types inherited from Geometry | |
| enum | Type { MESH , HAIR , VOLUME , POINTCLOUD , LIGHT } |
| Static Public Attributes inherited from Geometry | |
| static const uint | MAX_MOTION_STEPS = 129 |
| Protected Member Functions inherited from Node | |
| template<typename T> | |
| void | set_if_different (const SocketType &input, T value) |
| void | set_if_different (const SocketType &input, Node *value) |
| template<typename T> | |
| void | set_if_different (const SocketType &input, array< T > &value) |
| void | set_if_different (const SocketType &input, array< Node * > &value) |
| void | dereference_all_used_nodes () |
| Static Protected Member Functions inherited from Node | |
| template<typename T> | |
| static T & | get_socket_value (const Node *node, const SocketType &socket) |
| Protected Attributes inherited from Node | |
| const NodeOwner * | owner |
| int | ref_count {0} |
| SocketModifiedFlags | socket_modified |
| Hair::Hair | ( | ) |
Definition at line 292 of file hair.cpp.
References curve_key_offset, CURVE_RIBBON, curve_segment_offset, curve_shape, Geometry::Geometry(), and Geometry::HAIR.
Referenced by ~Hair().
|
overridedefault |
| void Hair::add_curve | ( | const int | first_key, |
| const int | shader ) |
Definition at line 342 of file hair.cpp.
Referenced by ExportCurveSegments(), and ~Hair().
Definition at line 333 of file hair.cpp.
Referenced by ExportCurveSegments(), and ~Hair().
|
overridevirtual |
Implements Geometry.
Definition at line 445 of file hair.cpp.
References ATTR_STD_MOTION_VERTEX_POSITION, Geometry::attributes, cross, Attribute::data_float4(), dot(), fabsf, i, make_float3(), make_float4, powf, transform_get_column(), transform_point(), and float4::w.
Referenced by ~Hair().
|
overridevirtual |
Reimplemented from Geometry.
Definition at line 321 of file hair.cpp.
References Geometry::attributes, and Geometry::clear().
Referenced by ExportCurveSegments(), and ~Hair().
|
overridevirtual |
Implements Geometry.
Definition at line 377 of file hair.cpp.
References ATTR_STD_MOTION_VERTEX_POSITION, Geometry::attributes, Geometry::bounds, Hair::Curve::bounds_grow(), Attribute::data_float4(), BoundBox::empty, get_curve(), BoundBox::grow(), BoundBox::grow_safe(), i, make_float3(), num_curves(), Hair::Curve::num_segments(), num_segments(), parallel_reduce(), BoundBox::valid(), and zero_float3().
Referenced by ~Hair().
| void Hair::copy_center_to_motion_step | ( | const int | motion_step | ) |
Definition at line 351 of file hair.cpp.
References ATTR_STD_MOTION_VERTEX_POSITION, Geometry::attributes, Attribute::data_float3(), and Geometry::motion_step().
Referenced by ~Hair().
|
inline |
Definition at line 111 of file hair.h.
References get_curve(), and i.
Referenced by BVHBuild::add_reference_curves(), BVHUnaligned::compute_aligned_prim_boundbox(), BVHUnaligned::compute_aligned_space(), compute_bounds(), count_curve_segments(), export_hair_curves_motion(), fill_shader_input(), get_curve(), pack_curves(), BVH2::refit_primitives(), BVHSpatialSplit::split_curve_primitive(), and BVHSpatialSplit::split_object_reference().
|
overridevirtual |
Implements Geometry.
Definition at line 361 of file hair.cpp.
References ATTR_PRIM_GEOMETRY, ATTR_STD_UV, Geometry::attributes, Attribute::get_uv_tiles(), and tiles.
|
inline |
Definition at line 136 of file hair.h.
References num_segments().
Referenced by need_shadow_transparency().
| bool Hair::need_shadow_transparency | ( | ) |
Definition at line 585 of file hair.cpp.
References Shader::has_surface_transparent, is_traceable(), and Node::Node().
Referenced by GeometryManager::device_update(), GeometryManager::device_update_attributes(), GeometryManager::device_update_displacement_images(), and update_shadow_transparency().
|
inline |
Definition at line 126 of file hair.h.
Referenced by BVHBuild::add_reference_curves(), compute_bounds(), count_curve_segments(), GeometryManager::device_update_mesh(), Attribute::element_size(), export_hair_curves_motion(), ExportCurveSegments(), fill_shader_input(), GeometryManager::geom_calc_offset(), pack_curves(), and BVHSpatialSplit::split_object_reference().
|
inline |
Definition at line 121 of file hair.h.
Referenced by export_hair_curves_motion(), and update_shadow_transparency().
|
inline |
Definition at line 131 of file hair.h.
Referenced by compute_bounds(), GeometryManager::device_update_mesh(), GeometryManager::geom_calc_offset(), is_traceable(), and Scene::update_kernel_features().
| void Hair::pack_curves | ( | Scene * | scene, |
| float4 * | curve_key_co, | ||
| KernelCurve * | curve, | ||
| KernelCurveSegment * | curve_segments ) |
Definition at line 486 of file hair.cpp.
References curve_key_offset, Scene::default_surface, Hair::Curve::first_key, KernelCurve::first_key, get_curve(), i, Geometry::index, make_float4, num_curves(), Hair::Curve::num_keys, KernelCurve::num_keys, Hair::Curve::num_segments(), KernelCurveSegment::prim, Geometry::prim_offset, PRIMITIVE_PACK_SEGMENT, primitive_type(), KernelCurve::shader_id, Scene::shader_manager, KernelCurve::type, KernelCurveSegment::type, and Node::type.
Referenced by GeometryManager::device_update_mesh().
|
overridevirtual |
Implements Geometry.
Definition at line 529 of file hair.cpp.
References CURVE_RIBBON, curve_shape, CURVE_THICK_LINEAR, Geometry::has_motion_blur(), PRIMITIVE_CURVE_RIBBON, PRIMITIVE_CURVE_THICK, PRIMITIVE_CURVE_THICK_LINEAR, PRIMITIVE_MOTION_CURVE_RIBBON, PRIMITIVE_MOTION_CURVE_THICK, and PRIMITIVE_MOTION_CURVE_THICK_LINEAR.
Referenced by BVHBuild::add_reference_curves(), and pack_curves().
| void Hair::reserve_curves | ( | const int | numcurves, |
| const int | numkeys ) |
Definition at line 311 of file hair.cpp.
References Geometry::attributes.
Referenced by ExportCurveSegments(), and ~Hair().
| void Hair::resize_curves | ( | const int | numcurves, |
| const int | numkeys ) |
Definition at line 301 of file hair.cpp.
References Geometry::attributes.
Referenced by export_hair_curves(), and ~Hair().
Definition at line 601 of file hair.cpp.
References ATTR_STD_SHADOW_TRANSPARENCY, Geometry::attributes, Attribute::data_float(), ShaderEval::eval(), fill_shader_input(), i, Node::name, need_shadow_transparency(), num_keys(), OBJECT_NONE, Scene::objects, read_shader_output(), Progress::set_status(), SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY, unique_ptr_vector< T >::size(), and string_printf().
| size_t Hair::curve_key_offset |
Definition at line 89 of file hair.h.
Referenced by AttributeTableBuilder::add(), GeometryManager::device_update_mesh(), GeometryManager::geom_calc_offset(), Hair(), and pack_curves().
| size_t Hair::curve_segment_offset |
Definition at line 90 of file hair.h.
Referenced by GeometryManager::device_update_mesh(), GeometryManager::geom_calc_offset(), and Hair().
| CurveShapeType Hair::curve_shape |
Definition at line 91 of file hair.h.
Referenced by Hair(), primitive_type(), and Scene::update_kernel_features().