Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix combine2 implementation in MDL #1975

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@

<!-- <combine2> -->
<implementation name="IM_combine2_vector2_genmdl" nodedef="ND_combine2_vector2" target="genmdl" sourcecode="float2( {{in1}},{{in2}} )" />
<implementation name="IM_combine2_color4CF_genmdl" nodedef="ND_combine2_color4CF" target="genmdl" sourcecode="color4( {{in1}}[0],{{in1}}[1],{{in1}}[2],{{in2}} )" />
<implementation name="IM_combine2_color4CF_genmdl" nodedef="ND_combine2_color4CF" target="genmdl" sourcecode="materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_combine2_color4CF({{in1}}, {{in2}})" />
<implementation name="IM_combine2_vector4VF_genmdl" nodedef="ND_combine2_vector4VF" target="genmdl" sourcecode="float4( {{in1}}[0],{{in1}}[1],{{in1}}[2],{{in2}} )" />
<implementation name="IM_combine2_vector4VV_genmdl" nodedef="ND_combine2_vector4VV" target="genmdl" sourcecode="float4( {{in1}}[0],{{in1}}[1],{{in2}}[0],{{in2}}[1] )" />

Expand Down
6 changes: 6 additions & 0 deletions source/MaterialXGenMdl/mdl/materialx/stdlib_1_6.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -4437,3 +4437,9 @@ export float3 mx_worleynoise3d_float3(
{
return noise::mx_worley_noise_float3(mxp_position, mxp_jitter, 0);
}

export core::color4 mx_combine2_color4CF(color in1, float in2)
{
float3 in1_as_float3 = float3(in1);
return core::mk_color4(in1_as_float3.x, in1_as_float3.y, in1_as_float3.z, in2);
}
1 change: 1 addition & 0 deletions source/MaterialXGenMdl/mdl/materialx/stdlib_1_8.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ export using .::stdlib_1_7 import mx_worleynoise2d_float3;
export using .::stdlib_1_7 import mx_worleynoise3d_float;
export using .::stdlib_1_7 import mx_worleynoise3d_float2;
export using .::stdlib_1_7 import mx_worleynoise3d_float3;
export using .::stdlib_1_7 import mx_combine2_color4CF;

// NOTE: Not planned to be implemented.
export using .::stdlib_1_7 import mx_geompropvalue_string;
Expand Down