So now the SimpleSuppress macro looks like this:
image SimpleSuppress(
image In = 0,
string suppress = "g",
float percent = 100
)
{
string alt_a = (suppress == "r") ? "g" : ( (suppress == "g") ? "r" : "r" );
string alt_b = (suppress == "r") ? "b" : ( (suppress == "g") ? "b" : "g" );
Reorder_SUPPRESS = Reorder(In, suppress + suppress + suppress);
Reorder_Alt_A = Reorder(In, alt_a + alt_a + alt_a);
Reorder_Alt_B = Reorder(In, alt_b + alt_b + alt_b);
Max1 = Max(Reorder_Alt_A, Reorder_Alt_B, 1, 100);
Min1 = Min(Reorder_SUPPRESS, Max1, 1, 100);
Mix1 = Mix(In, Min1, 1, percent, suppress);
return Mix1;
}
To finish it off, let's add a simple radio button widget to the UI.h file to make sure the suppress channel is set to something valid. Put this in your SimpleSuppressUI.h file:
nuxDefRadioBtnCtrl("SimpleSuppress.suppress", 0, 1, 1, "r|red", "g|green", "b|blue");
And there you have it. Start Shake up and feed a ColorWheel into your new SimpleSuppress node to give it a test run and verify that everything's wired up correctly.

While this is a simple case that wouldn't have suffered too much from implementation with ColorX, more complex cases can show a noticeable improvement in rendering time when implemented with special-purpose nodes rather than ColorX, even more so when used a number of times in a large film-resolution project. You also get the benefit of caching on node outputs so only the operations that have to recompute will do so which can make updates much more interactive.
image SimpleSuppress(
image In = 0,
string suppress = "g",
float percent = 100
)
{
string alt_a = (suppress == "r") ? "g" : ( (suppress == "g") ? "r" : "r" );
string alt_b = (suppress == "r") ? "b" : ( (suppress == "g") ? "b" : "g" );
Reorder_SUPPRESS = Reorder(In, suppress + suppress + suppress);
Reorder_Alt_A = Reorder(In, alt_a + alt_a + alt_a);
Reorder_Alt_B = Reorder(In, alt_b + alt_b + alt_b);
Max1 = Max(Reorder_Alt_A, Reorder_Alt_B, 1, 100);
Min1 = Min(Reorder_SUPPRESS, Max1, 1, 100);
Mix1 = Mix(In, Min1, 1, percent, suppress);
return Mix1;
}
To finish it off, let's add a simple radio button widget to the UI.h file to make sure the suppress channel is set to something valid. Put this in your SimpleSuppressUI.h file:
nuxDefRadioBtnCtrl("SimpleSuppress.suppress", 0, 1, 1, "r|red", "g|green", "b|blue");
And there you have it. Start Shake up and feed a ColorWheel into your new SimpleSuppress node to give it a test run and verify that everything's wired up correctly.

While this is a simple case that wouldn't have suffered too much from implementation with ColorX, more complex cases can show a noticeable improvement in rendering time when implemented with special-purpose nodes rather than ColorX, even more so when used a number of times in a large film-resolution project. You also get the benefit of caching on node outputs so only the operations that have to recompute will do so which can make updates much more interactive.
Author: mplec
Submitted: 2005-09-17 22:22:33 UTC
Tags:
Software: Shake
Views: 29,265
Related Items
-
Heart in a Human Body 3D Model
$39.99 (USD) -
Circulatory System Anatomy in a Human Body 3D Model
$49.99 (USD) -
Digestive System in a Human Body (Anatomy ) 3D Model
$75.00 (USD) -
A man in a shirt 3D Model
$28.00 (USD) -
a simple spaceship 3D Model
$20.00 (USD) -
Space City in a Crater 3D Model
$40.00 (USD) -
Hydrangeas and roses in a vase 3D Model
$18.00 (USD) -
Respiratory System, Lungs in a Human Body 3D Model
$79.99 (USD) -
Human internal organs 3D Model
$649.00 (USD)