|
Blender V4.3
|
#include <shader_graph.h>
Inherits Node.
Inherited by AddClosureNode, AmbientOcclusionNode, AttributeNode, BackgroundNode, BevelNode, BlackbodyNode, BrightContrastNode, BsdfBaseNode, BumpNode, CameraNode, ClampNode, ColorNode, CombineColorNode, CombineHSVNode, CombineRGBNode, CombineXYZNode, ConvertNode, CurvesNode, DisplacementNode, EmissionNode, FloatCurveNode, FresnelNode, GammaNode, GeometryNode, HSVNode, HairInfoNode, HoldoutNode, InvertNode, LayerWeightNode, LightFalloffNode, LightPathNode, MapRangeNode, MappingNode, MathNode, MixClosureNode, MixClosureWeightNode, MixColorNode, MixFloatNode, MixNode, MixVectorNode, MixVectorNonUniformNode, NormalMapNode, NormalNode, OSLNode, ObjectInfoNode, OutputAOVNode, OutputNode, ParticleInfoNode, PointDensityTextureNode, PointInfoNode, RGBRampNode, RGBToBWNode, SeparateColorNode, SeparateHSVNode, SeparateRGBNode, SeparateXYZNode, SetNormalNode, TangentNode, TextureCoordinateNode, TextureNode, UVMapNode, ValueNode, VectorDisplacementNode, VectorMapRangeNode, VectorMathNode, VectorRotateNode, VectorTransformNode, VertexColorNode, VolumeInfoNode, VolumeNode, WavelengthNode, WhiteNoiseTextureNode, and WireframeNode.
Public Member Functions | |
| ShaderNode (const NodeType *type) | |
| virtual | ~ShaderNode () |
| void | create_inputs_outputs (const NodeType *type) |
| void | remove_input (ShaderInput *input) |
| ShaderInput * | input (const char *name) |
| ShaderOutput * | output (const char *name) |
| ShaderInput * | input (ustring name) |
| ShaderOutput * | output (ustring name) |
| virtual ShaderNode * | clone (ShaderGraph *graph) const =0 |
| virtual void | attributes (Shader *shader, AttributeRequestSet *attributes) |
| virtual void | compile (SVMCompiler &compiler)=0 |
| virtual void | compile (OSLCompiler &compiler)=0 |
| virtual void | expand (ShaderGraph *) |
| virtual void | constant_fold (const ConstantFolder &) |
| virtual void | simplify_settings (Scene *) |
| virtual bool | has_surface_emission () |
| virtual bool | has_surface_transparent () |
| virtual bool | has_surface_bssrdf () |
| virtual bool | has_bump () |
| virtual bool | has_bssrdf_bump () |
| virtual bool | has_spatial_varying () |
| virtual bool | has_attribute_dependency () |
| virtual bool | has_volume_support () |
| virtual int | get_feature () |
| virtual ClosureType | get_closure_type () |
| virtual bool | equals (const ShaderNode &other) |
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, int value) |
| void | set (const SocketType &input, uint value) |
| void | set (const SocketType &input, uint64_t value) |
| void | set (const SocketType &input, float value) |
| void | set (const SocketType &input, float2 value) |
| void | set (const SocketType &input, 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 &input) const |
| void | copy_value (const SocketType &input, const Node &other, const SocketType &other_input) |
| void | set_value (const SocketType &input, const Node &other, const SocketType &other_input) |
| 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 | |
| vector< ShaderInput * > | inputs |
| vector< ShaderOutput * > | outputs |
| int | id |
| ShaderBump | bump |
| ShaderNodeSpecialType | special_type |
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 149 of file shader_graph.h.
|
explicit |
Definition at line 67 of file shader_graph.cpp.
References bump, create_inputs_outputs(), Node::name, SHADER_BUMP_NONE, SHADER_SPECIAL_TYPE_NONE, and special_type.
|
virtual |
Definition at line 77 of file shader_graph.cpp.
|
virtual |
Reimplemented in AttributeNode, EnvironmentTextureNode, GeometryNode, GlossyBsdfNode, HairInfoNode, ImageTextureNode, MetallicBsdfNode, NormalMapNode, ParticleInfoNode, PointDensityTextureNode, PointInfoNode, PrincipledBsdfNode, PrincipledHairBsdfNode, PrincipledVolumeNode, TangentNode, TextureCoordinateNode, UVMapNode, VectorDisplacementNode, VertexColorNode, and VolumeInfoNode.
Definition at line 148 of file shader_graph.cpp.
References ATTR_STD_GENERATED, ATTR_STD_GENERATED_TRANSFORM, ATTR_STD_UV, SocketType::LINK_TEXTURE_GENERATED, and SocketType::LINK_TEXTURE_UV.
Referenced by AttributeNode::attributes(), EnvironmentTextureNode::attributes(), GeometryNode::attributes(), GlossyBsdfNode::attributes(), HairInfoNode::attributes(), ImageTextureNode::attributes(), MetallicBsdfNode::attributes(), NormalMapNode::attributes(), ParticleInfoNode::attributes(), PointDensityTextureNode::attributes(), PointInfoNode::attributes(), PrincipledBsdfNode::attributes(), PrincipledHairBsdfNode::attributes(), PrincipledVolumeNode::attributes(), TangentNode::attributes(), TextureCoordinateNode::attributes(), UVMapNode::attributes(), VectorDisplacementNode::attributes(), VertexColorNode::attributes(), and VolumeInfoNode::attributes().
|
pure virtual |
Implemented in EnvironmentTextureNode, IESLightNode, ImageTextureNode, OSLNode, and PointDensityTextureNode.
Referenced by ShaderGraph::copy_nodes().
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
Reimplemented in AddClosureNode, BackgroundNode, BlackbodyNode, BrightContrastNode, BumpNode, ClampNode, ColorNode, CombineColorNode, CombineHSVNode, CombineRGBNode, CombineXYZNode, ConvertNode, CurvesNode, DisplacementNode, EmissionNode, FloatCurveNode, GammaNode, InvertNode, MappingNode, MathNode, MixClosureNode, MixColorNode, MixFloatNode, MixNode, MixVectorNode, MixVectorNonUniformNode, RGBCurvesNode, RGBRampNode, RGBToBWNode, SeparateColorNode, SeparateHSVNode, SeparateRGBNode, SeparateXYZNode, ValueNode, VectorCurvesNode, VectorDisplacementNode, and VectorMathNode.
Definition at line 172 of file shader_graph.h.
| void ShaderNode::create_inputs_outputs | ( | const NodeType * | type | ) |
Definition at line 86 of file shader_graph.cpp.
References SocketType::flags, and SocketType::LINKABLE.
Referenced by ShaderGraph::copy_nodes(), and ShaderNode().
|
virtual |
Reimplemented in BsdfBaseNode, EnvironmentTextureNode, ImageSlotTextureNode, ImageTextureNode, OSLNode, OutputAOVNode, OutputNode, PointDensityTextureNode, and VolumeNode.
Definition at line 169 of file shader_graph.cpp.
References bump, Node::equals_value(), SocketType::flags, ShaderInput::link, SocketType::LINKABLE, NULL, and ShaderInput::socket_type.
Referenced by ShaderGraph::deduplicate_nodes(), and PointDensityTextureNode::equals().
|
inlinevirtual |
Reimplemented in MapRangeNode, MathNode, VectorMapRangeNode, and VolumeInfoNode.
Definition at line 168 of file shader_graph.h.
|
inlinevirtual |
Reimplemented in BsdfBaseNode, GlassBsdfNode, GlossyBsdfNode, HairBsdfNode, HoldoutNode, MetallicBsdfNode, RefractionBsdfNode, SheenBsdfNode, SubsurfaceScatteringNode, and VolumeNode.
Definition at line 235 of file shader_graph.h.
References CLOSURE_NONE_ID.
|
inlinevirtual |
Reimplemented in AmbientOcclusionNode, BackgroundNode, BevelNode, BsdfBaseNode, BumpNode, DisplacementNode, EmissionNode, OSLNode, PrincipledHairBsdfNode, VectorDisplacementNode, VolumeNode, and VoronoiTextureNode.
Definition at line 229 of file shader_graph.h.
References bump, KERNEL_FEATURE_NODE_BUMP, and SHADER_BUMP_NONE.
Referenced by BackgroundNode::get_feature(), BsdfBaseNode::get_feature(), EmissionNode::get_feature(), OSLNode::get_feature(), PrincipledHairBsdfNode::get_feature(), VolumeNode::get_feature(), and VoronoiTextureNode::get_feature().
|
inlinevirtual |
Reimplemented in AttributeNode, EnvironmentTextureNode, GeometryNode, GlossyBsdfNode, HairInfoNode, ImageTextureNode, MetallicBsdfNode, NormalMapNode, ParticleInfoNode, PointDensityTextureNode, PointInfoNode, PrincipledBsdfNode, PrincipledVolumeNode, TangentNode, TextureCoordinateNode, UVMapNode, VectorDisplacementNode, VertexColorNode, and VolumeInfoNode.
Definition at line 203 of file shader_graph.h.
|
inlinevirtual |
Reimplemented in PrincipledBsdfNode, and SubsurfaceScatteringNode.
Definition at line 195 of file shader_graph.h.
|
inlinevirtual |
Reimplemented in BsdfBaseNode.
Definition at line 191 of file shader_graph.h.
|
inlinevirtual |
Reimplemented in AmbientOcclusionNode, AttributeNode, BevelNode, BsdfBaseNode, BumpNode, CameraNode, FresnelNode, GeometryNode, HairInfoNode, LayerWeightNode, LightFalloffNode, NormalMapNode, OSLNode, PointDensityTextureNode, PointInfoNode, TangentNode, TextureCoordinateNode, UVMapNode, VertexColorNode, VolumeInfoNode, and WireframeNode.
Definition at line 199 of file shader_graph.h.
|
inlinevirtual |
Reimplemented in PrincipledBsdfNode, and SubsurfaceScatteringNode.
Definition at line 187 of file shader_graph.h.
|
inlinevirtual |
Reimplemented in EmissionNode, OSLNode, and PrincipledBsdfNode.
Definition at line 179 of file shader_graph.h.
|
inlinevirtual |
Reimplemented in PrincipledBsdfNode, PrincipledHairBsdfNode, RayPortalBsdfNode, and TransparentBsdfNode.
Definition at line 183 of file shader_graph.h.
|
inlinevirtual |
Reimplemented in EmissionNode, OSLNode, and VolumeNode.
Definition at line 207 of file shader_graph.h.
| ShaderInput * ShaderNode::input | ( | const char * | name | ) |
Definition at line 99 of file shader_graph.cpp.
References ShaderInput::name(), and NULL.
Referenced by GlossyBsdfNode::attributes(), MetallicBsdfNode::attributes(), PrincipledBsdfNode::attributes(), PrincipledHairBsdfNode::attributes(), PrincipledVolumeNode::attributes(), ShaderGraph::bump_from_displacement(), BsdfNode::compile(), CurvesNode::compile(), VolumeNode::compile(), ShaderGraph::compute_displacement_hash(), AddClosureNode::constant_fold(), BackgroundNode::constant_fold(), BumpNode::constant_fold(), CurvesNode::constant_fold(), EmissionNode::constant_fold(), FloatCurveNode::constant_fold(), GammaNode::constant_fold(), InvertNode::constant_fold(), MixClosureNode::constant_fold(), RGBCurvesNode::constant_fold(), ShaderGraph::constant_fold(), VectorCurvesNode::constant_fold(), ShaderGraph::copy_nodes(), ImageTextureNode::cull_tiles(), ShaderGraph::default_inputs(), LightManager::device_update_background(), MapRangeNode::expand(), MathNode::expand(), ShaderGraph::finalize(), ShaderManager::get_kernel_features(), SubsurfaceScatteringNode::has_bssrdf_bump(), BsdfBaseNode::has_bump(), PrincipledBsdfNode::has_surface_bssrdf(), PrincipledBsdfNode::has_surface_emission(), PrincipledBsdfNode::has_surface_transparent(), PrincipledHairBsdfNode::has_surface_transparent(), GlossyBsdfNode::is_isotropic(), MetallicBsdfNode::is_isotropic(), remove_input(), GlossyBsdfNode::simplify_settings(), MetallicBsdfNode::simplify_settings(), OutputAOVNode::simplify_settings(), PrincipledBsdfNode::simplify_settings(), ShaderGraph::transform_multi_closure(), and ShaderGraph::verify_volume_output().
| ShaderInput * ShaderNode::input | ( | ustring | name | ) |
Definition at line 120 of file shader_graph.cpp.
References ShaderInput::name(), and NULL.
| ShaderOutput * ShaderNode::output | ( | const char * | name | ) |
Definition at line 110 of file shader_graph.cpp.
References ShaderOutput::name(), and NULL.
Referenced by CCL_NAMESPACE_BEGIN::ShaderGraphBuilder::add_connection(), ShaderManager::add_default(), add_nodes(), ShaderGraph::bump_from_displacement(), SVMCompiler::compile(), SVMCompiler::compile_type(), BumpNode::constant_fold(), ShaderGraph::copy_nodes(), ShaderGraph::default_inputs(), LightManager::device_update_background(), MapRangeNode::expand(), MathNode::expand(), VolumeInfoNode::expand(), ShaderManager::get_kernel_features(), Shader::tag_update(), and ShaderGraph::transform_multi_closure().
| ShaderOutput * ShaderNode::output | ( | ustring | name | ) |
Definition at line 131 of file shader_graph.cpp.
References ShaderOutput::name(), and NULL.
| void ShaderNode::remove_input | ( | ShaderInput * | input | ) |
Definition at line 141 of file shader_graph.cpp.
|
inlinevirtual |
Reimplemented in GlossyBsdfNode, MetallicBsdfNode, OutputAOVNode, PrincipledBsdfNode, and SkyTextureNode.
Definition at line 177 of file shader_graph.h.
| ShaderBump ShaderNode::bump |
Definition at line 215 of file shader_graph.h.
Referenced by equals(), get_feature(), and ShaderNode().
| int ShaderNode::id |
Definition at line 214 of file shader_graph.h.
Referenced by ShaderGraph::break_cycles(), ShaderNodeIDComparator::operator()(), and ShaderGraph::remove_proxy_nodes().
| vector<ShaderInput *> ShaderNode::inputs |
Definition at line 211 of file shader_graph.h.
Referenced by add_nodes(), ShaderGraph::copy_nodes(), SVMCompiler::generate_multi_closure(), and ShaderGraph::remove_proxy_nodes().
| vector<ShaderOutput *> ShaderNode::outputs |
Definition at line 212 of file shader_graph.h.
Referenced by add_node(), add_nodes(), ShaderGraph::copy_nodes(), ShaderGraph::deduplicate_nodes(), ShaderGraph::remove_proxy_nodes(), and xml_read_shader_graph().
| ShaderNodeSpecialType ShaderNode::special_type |
Definition at line 217 of file shader_graph.h.
Referenced by BsdfBaseNode::BsdfBaseNode(), ConvertNode::constant_fold(), ConvertNode::ConvertNode(), SubsurfaceScatteringNode::has_bssrdf_bump(), BsdfBaseNode::has_bump(), ImageSlotTextureNode::ImageSlotTextureNode(), ShaderGraph::remove_proxy_nodes(), and ShaderNode().