|
slim 1 extensions Vincent {
extensions power Vint {
//-------------------------------------------------------------------------
template color MixKolors1 {
previewinfo {
shadingrate 1
objectsize 1
objectshape Plane
frame 1
}
//--------------------------------------------------------
parameter color c1 {
description "One of the colors to mix"
label "Color 1"
detail varying
default {1 1 0}
}
parameter color c2 {
description "One of the colors to mix"
label "Color 2"
detail varying
default {1 1 1}
}
parameter float blend {
description "How much of Color 2 to mix with Color 1"
label "Blend"
subtype slider
range {0 1}
detail varying
default 0.5
}
parameter float s_center {
description "center of s"
label "s center"
subtype slider
range {0 1 0.1}
detail varying
default 1
}
parameter float t_center {
description "center of t"
label "t center"
subtype slider
range {0 1 0.1}
detail varying
default 1
}
parameter float freq {
description "wave cycle"
label "number of cycles"
subtype slider
range {0 10 1}
detail varying
default 1
}
parameter color result {
access output
display hidden
}
# The RSLFunction is where the calculations are done.
# The order in which the parameters are declared must
# match the order in which they are described above.
RSLFunction {
void
VintMixKolors1 (
color c1;
color c2;
float blend;
float s_center;
float t_center;
float freq;
output color result;
)
{
float r;
float wave;
r = sqrt((pow(s-s_center, 2 ))+(pow(t-t_center, 2)));
wave = (sin(r * 2PI * freq) + 1) * 0.5;
result = mix(c1, c2, blend * wave);
}
} } } }
|