forked from blender/blender
Implement BSDF Transparent shader #36
@ -33,10 +33,12 @@ NODE_SHADER_MATERIALX_BEGIN
|
|||||||
switch (to_type_) {
|
switch (to_type_) {
|
||||||
case NodeItem::Type::BSDF: {
|
case NodeItem::Type::BSDF: {
|
||||||
NodeItem color = get_input_value("Color", NodeItem::Type::Color3);
|
NodeItem color = get_input_value("Color", NodeItem::Type::Color3);
|
||||||
|
/* Returning diffuse node as BSDF component */
|
||||||
return create_node("oren_nayar_diffuse_bsdf", NodeItem::Type::BSDF, {{"color", color}});
|
return create_node("oren_nayar_diffuse_bsdf", NodeItem::Type::BSDF, {{"color", color}});
|
||||||
}
|
}
|
||||||
case NodeItem::Type::SurfaceOpacity: {
|
case NodeItem::Type::SurfaceOpacity: {
|
||||||
NodeItem color = get_input_value("Color", NodeItem::Type::Color3);
|
NodeItem color = get_input_value("Color", NodeItem::Type::Color3);
|
||||||
|
/* Returning: 1 - <average of color components> */
|
||||||
return val(1.0f) - color.dotproduct(val(1.0f / 3.0f));
|
return val(1.0f) - color.dotproduct(val(1.0f / 3.0f));
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user