diff options
Diffstat (limited to 'intern/cycles/render/nodes.h')
-rw-r--r-- | intern/cycles/render/nodes.h | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h index a755b653a5b..c0271a3c8eb 100644 --- a/intern/cycles/render/nodes.h +++ b/intern/cycles/render/nodes.h @@ -252,6 +252,7 @@ public: class PointDensityTextureNode : public ShaderNode { public: SHADER_NODE_NO_CLONE_CLASS(PointDensityTextureNode) + virtual int get_group() { return NODE_GROUP_LEVEL_3; } ~PointDensityTextureNode(); ShaderNode *clone() const; @@ -321,7 +322,14 @@ private: static bool initialized; }; -class BsdfNode : public ShaderNode { +class BsdfBaseNode : public ShaderNode { +public: + BsdfBaseNode(const NodeType *node_type); + + ClosureType closure; +}; + +class BsdfNode : public BsdfBaseNode { public: explicit BsdfNode(const NodeType *node_type); SHADER_NODE_BASE_CLASS(BsdfNode) @@ -333,7 +341,6 @@ public: float3 color; float3 normal; float surface_mix_weight; - ClosureType closure; virtual bool equals(const ShaderNode& /*other*/) { @@ -361,6 +368,39 @@ public: float roughness; }; +/* Disney principled BRDF */ +class PrincipledBsdfNode : public BsdfBaseNode { +public: + SHADER_NODE_CLASS(PrincipledBsdfNode) + + bool has_spatial_varying() { return true; } + bool has_surface_bssrdf(); + bool has_bssrdf_bump(); + void compile(SVMCompiler& compiler, ShaderInput *metallic, ShaderInput *subsurface, ShaderInput *subsurface_radius, + ShaderInput *specular, ShaderInput *roughness, ShaderInput *specular_tint, ShaderInput *anisotropic, + ShaderInput *sheen, ShaderInput *sheen_tint, ShaderInput *clearcoat, ShaderInput *clearcoat_roughness, + ShaderInput *ior, ShaderInput *transmission, ShaderInput *anisotropic_rotation, ShaderInput *transmission_roughness); + + float3 base_color; + float3 subsurface_color, subsurface_radius; + float metallic, subsurface, specular, roughness, specular_tint, anisotropic, + sheen, sheen_tint, clearcoat, clearcoat_roughness, ior, transmission, + anisotropic_rotation, transmission_roughness; + float3 normal, clearcoat_normal, tangent; + float surface_mix_weight; + ClosureType distribution, distribution_orig; + + virtual bool equals(const ShaderNode * /*other*/) + { + /* TODO(sergey): With some care BSDF nodes can be de-duplicated. */ + return false; + } + + ClosureType get_closure_type() { return closure; } + bool has_integrator_dependency(); + void attributes(Shader *shader, AttributeRequestSet *attributes); +}; + class TranslucentBsdfNode : public BsdfNode { public: SHADER_NODE_CLASS(TranslucentBsdfNode) @@ -445,6 +485,7 @@ public: virtual ClosureType get_closure_type() { return CLOSURE_EMISSION_ID; } bool has_surface_emission() { return true; } + bool has_volume_support() { return true; } float3 color; float strength; @@ -496,6 +537,7 @@ public: return ShaderNode::get_feature() | NODE_FEATURE_VOLUME; } virtual ClosureType get_closure_type() { return closure; } + virtual bool has_volume_support() { return true; } float3 color; float density; |