|
Blender V5.0
|
#include <shader.h>
Inherits Node.
Public Member Functions | |
| Shader () | |
| void | estimate_emission () |
| void | set_graph (unique_ptr< ShaderGraph > &&graph) |
| void | tag_update (Scene *scene) |
| void | tag_used (Scene *scene) |
| bool | has_surface_link () const |
| bool | need_update_geometry () const |
| bool | has_surface_shadow_transparency () const |
| 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 | |
| NODE_DECLARE unique_ptr< ShaderGraph > | graph |
| float | prev_volume_step_rate |
| bool | prev_has_surface_shadow_transparency |
| bool | need_update_uvs |
| bool | need_update_attribute |
| bool | need_update_displacement |
| bool | shadow_transparency_needs_realloc |
| bool | has_volume_connected |
| bool | has_surface |
| bool | has_surface_transparent |
| bool | has_surface_raytrace |
| bool | has_volume |
| bool | has_displacement |
| bool | has_surface_bssrdf |
| bool | has_bump |
| bool | has_bssrdf_bump |
| bool | has_surface_spatial_varying |
| bool | has_volume_spatial_varying |
| bool | has_volume_attribute_dependency |
| bool | has_light_path_node |
| float3 | emission_estimate |
| EmissionSampling | emission_sampling |
| bool | emission_is_constant |
| AttributeRequestSet | attributes |
| uint | id |
| Public Attributes inherited from Node | |
| ustring | name |
| const NodeType * | type |
| InternalNode | internal |
| LeafNode | leaf |
Additional Inherited Members | |
| 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 |
Definition at line 71 of file scene/shader.h.
| Shader::Shader | ( | ) |
Definition at line 88 of file scene/shader.cpp.
References DISPLACE_BUMP, emission_estimate, emission_is_constant, emission_sampling, EMISSION_SAMPLING_NONE, graph, has_bssrdf_bump, has_bump, has_displacement, has_light_path_node, has_surface, has_surface_bssrdf, has_surface_raytrace, has_surface_spatial_varying, has_surface_transparent, has_volume, has_volume_attribute_dependency, has_volume_connected, has_volume_spatial_varying, need_update_attribute, need_update_displacement, need_update_uvs, Node::Node(), prev_has_surface_shadow_transparency, prev_volume_step_rate, shadow_transparency_needs_realloc, and zero_float3().
| void Shader::estimate_emission | ( | ) |
Definition at line 239 of file scene/shader.cpp.
References emission_estimate, emission_is_constant, emission_sampling, EMISSION_SAMPLING_AUTO, EMISSION_SAMPLING_FRONT_BACK, EMISSION_SAMPLING_NONE, fabs(), EmissionNode::from_auto_conversion, graph, is_zero(), ShaderInput::link, output, output_estimate_emission(), reduce_max(), SHADER_SPECIAL_TYPE_OUTPUT_AOV, and ShaderNode::special_type.
Referenced by SVMCompiler::compile().
|
inline |
Definition at line 160 of file scene/shader.h.
References has_displacement, and has_surface.
Referenced by EnvironmentTextureNode::attributes(), GeometryNode::attributes(), GlossyBsdfNode::attributes(), HairInfoNode::attributes(), ImageTextureNode::attributes(), MetallicBsdfNode::attributes(), NormalMapNode::attributes(), OSLNode::attributes(), PointInfoNode::attributes(), PrincipledBsdfNode::attributes(), ShaderNode::attributes(), TangentNode::attributes(), TextureCoordinateNode::attributes(), and VectorDisplacementNode::attributes().
| bool Shader::has_surface_shadow_transparency | ( | ) | const |
Definition at line 313 of file scene/shader.cpp.
References graph, and ShaderNode::has_surface_transparent().
Referenced by tag_update().
| bool Shader::need_update_geometry | ( | ) | const |
Definition at line 441 of file scene/shader.cpp.
References need_update_attribute, need_update_displacement, and need_update_uvs.
| void Shader::set_graph | ( | unique_ptr< ShaderGraph > && | graph | ) |
Definition at line 282 of file scene/shader.cpp.
References DISPLACE_BUMP, graph, has_volume_connected, input, and need_update_displacement.
Referenced by ShaderManager::add_default(), and xml_read_shader_graph().
| void Shader::tag_update | ( | Scene * | scene | ) |
Definition at line 328 of file scene/shader.cpp.
References ATTR_STD_NORMAL_UNDISPLACED, ATTR_STD_POSITION_UNDISPLACED, attributes, ShaderNode::attributes(), Scene::background, DISPLACE_BOTH, emission_sampling, EMISSION_SAMPLING_NONE, Scene::geometry_manager, Background::get_shader(), graph, has_displacement, has_surface, has_surface_shadow_transparency(), has_volume, in, ShaderNode::inputs, Scene::light_manager, need_update_attribute, need_update_displacement, Scene::object_manager, output, ShaderNode::output(), prev_has_surface_shadow_transparency, prev_volume_step_rate, Scene::procedural_manager, GeometryManager::SHADER_ATTRIBUTE_MODIFIED, GeometryManager::SHADER_DISPLACEMENT_MODIFIED, Scene::shader_manager, LightManager::SHADER_MODIFIED, ShaderManager::SHADER_MODIFIED, SHADER_SPECIAL_TYPE_OUTPUT_AOV, shadow_transparency_needs_realloc, ShaderNode::special_type, Node::tag_modified(), and Scene::volume_manager.
Referenced by ShaderManager::add_default(), and xml_read_shader_graph().
| void Shader::tag_used | ( | Scene * | scene | ) |
Definition at line 430 of file scene/shader.cpp.
References Node::reference_count(), Scene::shader_manager, ShaderManager::SHADER_MODIFIED, and Node::tag_modified().
| AttributeRequestSet Shader::attributes |
Definition at line 128 of file scene/shader.h.
Referenced by GeometryManager::device_update_attributes(), Geometry::need_attribute(), Geometry::need_attribute(), Geometry::needed_attributes(), and tag_update().
| float3 Shader::emission_estimate |
Definition at line 123 of file scene/shader.h.
Referenced by ShaderManager::device_update_common(), estimate_emission(), Light::has_contribution(), LightTreeEmitter::LightTreeEmitter(), and Shader().
| bool Shader::emission_is_constant |
Definition at line 125 of file scene/shader.h.
Referenced by ShaderManager::device_update_common(), estimate_emission(), and Shader().
| EmissionSampling Shader::emission_sampling |
Definition at line 124 of file scene/shader.h.
Referenced by ShaderManager::device_update_common(), LightManager::device_update_distribution(), SVMShaderManager::device_update_specific(), estimate_emission(), light_tree_leaf_emitters_copy_and_flatten(), LightTreeEmitter::LightTreeEmitter(), Shader(), Geometry::tag_update(), Object::tag_update(), tag_update(), and Object::usable_as_light().
| NODE_DECLARE unique_ptr<ShaderGraph> Shader::graph |
Definition at line 76 of file scene/shader.h.
Referenced by SVMCompiler::compile(), ImageTextureNode::cull_tiles(), Background::device_update(), LightManager::device_update_background(), GeometryManager::device_update_displacement_images(), ShaderManager::device_update_pre(), SVMShaderManager::device_update_shader(), estimate_emission(), ShaderManager::get_kernel_features(), Scene::get_max_closure_count(), has_surface_shadow_transparency(), set_graph(), Shader(), tag_update(), and HdCyclesSession::UpdateScene().
| bool Shader::has_bssrdf_bump |
Definition at line 117 of file scene/shader.h.
Referenced by ShaderManager::device_update_common(), ShaderManager::device_update_pre(), and Shader().
| bool Shader::has_bump |
Definition at line 116 of file scene/shader.h.
Referenced by SVMCompiler::compile(), ShaderManager::device_update_common(), ShaderManager::device_update_pre(), and Shader().
| bool Shader::has_displacement |
Definition at line 114 of file scene/shader.h.
Referenced by SVMCompiler::compile_type(), GeometryManager::device_update_displacement_images(), ShaderManager::device_update_pre(), GeometryManager::displace(), fill_shader_input(), has_surface_link(), Geometry::has_true_displacement(), read_shader_output(), Shader(), and tag_update().
| bool Shader::has_light_path_node |
Definition at line 121 of file scene/shader.h.
Referenced by ShaderManager::device_update_common(), ShaderManager::device_update_pre(), and Shader().
| bool Shader::has_surface |
Definition at line 110 of file scene/shader.h.
Referenced by UVMapNode::attributes(), SVMCompiler::compile_type(), ShaderManager::device_update_common(), ShaderManager::device_update_pre(), has_surface_link(), Shader(), and tag_update().
| bool Shader::has_surface_bssrdf |
Definition at line 115 of file scene/shader.h.
Referenced by ShaderManager::device_update_pre(), GeometryManager::device_update_preprocess(), and Shader().
| bool Shader::has_surface_raytrace |
Definition at line 112 of file scene/shader.h.
Referenced by ShaderManager::device_update_common(), ShaderManager::device_update_pre(), and Shader().
| bool Shader::has_surface_spatial_varying |
Definition at line 118 of file scene/shader.h.
Referenced by ShaderManager::device_update_pre(), Shader(), and LightManager::test_enabled_lights().
| bool Shader::has_surface_transparent |
Definition at line 111 of file scene/shader.h.
Referenced by Integrator::device_update(), ShaderManager::device_update_common(), ShaderManager::device_update_pre(), Hair::need_shadow_transparency(), and Shader().
| bool Shader::has_volume |
Definition at line 113 of file scene/shader.h.
Referenced by AttributeNode::attributes(), PrincipledVolumeNode::attributes(), ShaderNode::attributes(), TextureCoordinateNode::attributes(), VolumeInfoNode::attributes(), SVMCompiler::compile_type(), Object::compute_volume_step_size(), GeometryManager::create_volume_mesh(), Background::device_update(), Integrator::device_update(), ShaderManager::device_update_common(), ShaderManager::device_update_pre(), GeometryManager::device_update_preprocess(), VolumeManager::is_homogeneous_volume(), Shader(), and tag_update().
| bool Shader::has_volume_attribute_dependency |
Definition at line 120 of file scene/shader.h.
Referenced by Object::compute_volume_step_size(), ShaderManager::device_update_common(), ShaderManager::device_update_pre(), VolumeManager::is_homogeneous_volume(), and Shader().
| bool Shader::has_volume_connected |
Definition at line 107 of file scene/shader.h.
Referenced by ShaderManager::device_update_common(), ShaderManager::get_kernel_features(), set_graph(), and Shader().
| bool Shader::has_volume_spatial_varying |
Definition at line 119 of file scene/shader.h.
Referenced by Object::compute_volume_step_size(), ShaderManager::device_update_common(), ShaderManager::device_update_pre(), VolumeManager::is_homogeneous_volume(), Shader(), and VolumeManager::tag_update().
| uint Shader::id |
Definition at line 131 of file scene/shader.h.
Referenced by RenderStats::collect_profiling(), ShaderManager::device_update_pre(), SVMShaderManager::device_update_specific(), fill_shader_input(), and ShaderManager::get_shader_id().
| bool Shader::need_update_attribute |
Definition at line 96 of file scene/shader.h.
Referenced by GeometryManager::device_update_preprocess(), need_update_geometry(), Shader(), and tag_update().
| bool Shader::need_update_displacement |
Definition at line 97 of file scene/shader.h.
Referenced by GeometryManager::device_update_preprocess(), need_update_geometry(), set_graph(), Shader(), and tag_update().
| bool Shader::need_update_uvs |
Definition at line 95 of file scene/shader.h.
Referenced by GeometryManager::device_update_preprocess(), need_update_geometry(), Shader(), and Film::update_passes().
| bool Shader::prev_has_surface_shadow_transparency |
Definition at line 92 of file scene/shader.h.
Referenced by Shader(), and tag_update().
| float Shader::prev_volume_step_rate |
Definition at line 91 of file scene/shader.h.
Referenced by Shader(), and tag_update().
| bool Shader::shadow_transparency_needs_realloc |
Definition at line 98 of file scene/shader.h.
Referenced by GeometryManager::device_update_preprocess(), Shader(), and tag_update().