MaterialX: Implement Gradient Texture node. #28

Merged
Bogdan Nagirniak merged 6 commits from Vasyl-Pidhirskyi/blender:BLEN-550 into matx-export-material 2023-09-21 09:31:28 +02:00
Showing only changes of commit f9c66e2c64 - Show all commits

View File

@ -179,12 +179,12 @@ NODE_SHADER_MATERIALX_BEGIN
res = vector.extract(1).atan2(vector.extract(0)) / (val(float(M_PI * 2.0f))) + val(0.5f);
break;
case SHD_BLEND_QUADRATIC_SPHERE:
res = create_node("dotproduct", NodeItem::Type::Float, {{"in1", vector}, {"in2", vector}});
res = create_node("dotproduct", NodeItem::Type::Float, {{"in1", vector}, {"in2", vector}}).sqrt();
res = (val(0.999999f) - res).max(val(0.0f));
res = res * res;
break;
case SHD_BLEND_SPHERICAL:
res = create_node("dotproduct", NodeItem::Type::Float, {{"in1", vector}, {"in2", vector}});
res = create_node("dotproduct", NodeItem::Type::Float, {{"in1", vector}, {"in2", vector}}).sqrt();
res = (val(0.999999f) - res).max(val(0.0f));
break;
}