1
1
Fork 0

MaterialX: add convert nodes #15

Merged
Bogdan Nagirniak merged 8 commits from matx-add-convert-nodes into matx-export-material 2023-09-08 16:55:00 +02:00

Purpose:

Add support for convert nodes

Technical steps:

Added nodes:

  • clamp
  • RGB to BW
  • Blackbody
  • Map Range
### Purpose: Add support for convert nodes ### Technical steps: Added nodes: * clamp * RGB to BW * Blackbody * Map Range
Georgiy Markelov added 6 commits 2023-09-07 16:28:08 +02:00
Georgiy Markelov requested review from Brian Savery (AMD) 2023-09-07 16:28:13 +02:00
Georgiy Markelov requested review from Bogdan Nagirniak 2023-09-07 16:28:13 +02:00
Georgiy Markelov requested review from Vasyl Pidhirskyi 2023-09-07 16:28:13 +02:00
Bogdan Nagirniak requested changes 2023-09-07 20:07:12 +02:00
@ -0,0 +9,4 @@
NodeItem BlackbodyNodeParser::compute()
{
/* This node doesn't have an implementation in MaterialX 1.38.6.
* It's added in MaterialX 1.38.8. Uncomment this code after switching to 1.38.8.
Collaborator

It is exists in pbrlib_def.mtlx, can be used here

It is exists in pbrlib_def.mtlx, can be used here
BogdanNagirniak marked this conversation as resolved
@ -0,0 +14,4 @@
NodeItem max = get_input_value("Max", NodeItem::Type::Float);
if (type == NODE_CLAMP_MINMAX) {
min = min.if_else(NodeItem::CompareOp::Greater, max, max, min);
Collaborator

min = min.min(max)

`min = min.min(max)`
BogdanNagirniak marked this conversation as resolved
@ -0,0 +16,4 @@
if (type == NODE_CLAMP_MINMAX) {
min = min.if_else(NodeItem::CompareOp::Greater, max, max, min);
}
Collaborator

does it correctly work with RANGE? do we need swap min max if min > max?

does it correctly work with RANGE? do we need swap min max if min > max?
BogdanNagirniak marked this conversation as resolved
@ -17,6 +17,7 @@ class NodeItem {
/* Value types */
String,
Filename,
Bool,
Collaborator

Maybe rename to Boolean, as we use full names for other types?

Maybe rename to Boolean, as we use full names for other types?
BogdanNagirniak marked this conversation as resolved
@ -0,0 +8,4 @@
NodeItem RGBToBWNodeParser::compute()
{
NodeItem color = get_input_value("Color", NodeItem::Type::Color3);
Collaborator

use Color4 type

use Color4 type
BogdanNagirniak marked this conversation as resolved
Georgiy Markelov added 2 commits 2023-09-08 15:05:23 +02:00
Bogdan Nagirniak approved these changes 2023-09-08 16:37:39 +02:00
Bogdan Nagirniak left a comment
Collaborator

Looks good

Looks good
Bogdan Nagirniak merged commit 956df4e4db into matx-export-material 2023-09-08 16:54:59 +02:00
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: DagerD/blender#15
No description provided.