forked from blender/blender
MaterialX: add color nodes #17
@ -160,6 +160,7 @@ if(WITH_MATERIALX)
|
|||||||
materialx/nodes/bsdf_translucent.cc
|
materialx/nodes/bsdf_translucent.cc
|
||||||
materialx/nodes/bsdf_transparent.cc
|
materialx/nodes/bsdf_transparent.cc
|
||||||
materialx/nodes/clamp.cc
|
materialx/nodes/clamp.cc
|
||||||
|
materialx/nodes/gamma.cc
|
||||||
materialx/nodes/emission.cc
|
materialx/nodes/emission.cc
|
||||||
materialx/nodes/huesatval.cc
|
materialx/nodes/huesatval.cc
|
||||||
materialx/nodes/invert.cc
|
materialx/nodes/invert.cc
|
||||||
|
20
source/blender/nodes/shader/materialx/nodes/gamma.cc
Normal file
20
source/blender/nodes/shader/materialx/nodes/gamma.cc
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||||
|
|
||||||
|
#include "node_parser.h"
|
||||||
|
|
||||||
|
namespace blender::nodes::materialx {
|
||||||
|
|
||||||
|
NodeItem GammaNodeParser::compute()
|
||||||
|
{
|
||||||
|
NodeItem color = get_input_value("Color", NodeItem::Type::Color3);
|
||||||
|
NodeItem gamma = get_input_value("Gamma", NodeItem::Type::Float);
|
||||||
|
|
||||||
|
NodeItem res = create_node("power", NodeItem::Type::Color3);
|
||||||
|
res.set_input("in1", color);
|
||||||
|
res.set_input("in2", gamma);
|
||||||
|
|||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace blender::nodes::materialx
|
@ -152,6 +152,7 @@ NodeItem NodeParser::get_input_link(const bNodeSocket &socket, NodeItem::Type to
|
|||||||
CASE_NODE_TYPE(SH_NODE_BLACKBODY, BlackbodyNodeParser)
|
CASE_NODE_TYPE(SH_NODE_BLACKBODY, BlackbodyNodeParser)
|
||||||
CASE_NODE_TYPE(SH_NODE_BRIGHTCONTRAST, BrightContrastNodeParser)
|
CASE_NODE_TYPE(SH_NODE_BRIGHTCONTRAST, BrightContrastNodeParser)
|
||||||
CASE_NODE_TYPE(SH_NODE_CLAMP, ClampNodeParser)
|
CASE_NODE_TYPE(SH_NODE_CLAMP, ClampNodeParser)
|
||||||
|
CASE_NODE_TYPE(SH_NODE_GAMMA, GammaNodeParser)
|
||||||
CASE_NODE_TYPE(SH_NODE_COMBINE_COLOR, CombineColorNodeParser)
|
CASE_NODE_TYPE(SH_NODE_COMBINE_COLOR, CombineColorNodeParser)
|
||||||
CASE_NODE_TYPE(SH_NODE_COMBXYZ, CombineXYZNodeParser)
|
CASE_NODE_TYPE(SH_NODE_COMBXYZ, CombineXYZNodeParser)
|
||||||
CASE_NODE_TYPE(SH_NODE_HUE_SAT, HueSatValNodeParser)
|
CASE_NODE_TYPE(SH_NODE_HUE_SAT, HueSatValNodeParser)
|
||||||
|
@ -96,6 +96,7 @@ DECLARE_NODE_PARSER(BrightContrastNodeParser)
|
|||||||
DECLARE_NODE_PARSER(ClampNodeParser)
|
DECLARE_NODE_PARSER(ClampNodeParser)
|
||||||
DECLARE_NODE_PARSER(CombineColorNodeParser)
|
DECLARE_NODE_PARSER(CombineColorNodeParser)
|
||||||
DECLARE_NODE_PARSER(CombineXYZNodeParser)
|
DECLARE_NODE_PARSER(CombineXYZNodeParser)
|
||||||
|
DECLARE_NODE_PARSER(GammaNodeParser)
|
||||||
DECLARE_NODE_PARSER(HueSatValNodeParser)
|
DECLARE_NODE_PARSER(HueSatValNodeParser)
|
||||||
DECLARE_NODE_PARSER(InvertNodeParser)
|
DECLARE_NODE_PARSER(InvertNodeParser)
|
||||||
DECLARE_NODE_PARSER(MapRangeNodeParser)
|
DECLARE_NODE_PARSER(MapRangeNodeParser)
|
||||||
|
Loading…
Reference in New Issue
Block a user
color ^ gamma