VBWOut
Opaque black and white output VGen
See also: VRGBAOut VRGBOut
Description
Provides a single value for all three color channels, resulting in a black-and-white, opaque color output signal.
Supported Rates: pixel
Class Methods
VBWOut.pr(value)
Make a VBWOut VGen at requested rate.
Arguments
value
The black and white value, with 0.0 representing black and 1.0 representing white.
Returns:
The vector VVec4.pr(value, value, value, 1.0)
dimensions
input |
output |
1 |
4 |
Examples
(
~blades = ScinthDef.new(\blades, { |scale=2.0, xmod=0.5, ymod=0.5|
var pos = VNormPos.pr() * scale;
var sawA = VSaw.pr(0.7, (VX.pr(pos) % xmod) * VY.pr(pos));
var sawB = VSaw.pr(0.9, VX.pr(pos) * (VY.pr(pos) % ymod));
VBWOut.pr(sawA * sawB);
}).add;
)
(
~k = Scinth.new(\blades);
)
(
~molly = ScinImageBuffer.read(path: "~/src/TestGoldImages/sourceMedia/molly.png".standardizePath);
)
(
~bwMolly = ScinthDef.new(\bwMolly, {
var size = VTextureSize.fr(~molly);
var aspect = VVec2.fr(VY.fr(size) / VX.fr(size), 1.0);
var colors = VSampler.pr(~molly, VTexPos.pr * aspect);
VBWOut.pr(VLength.pr(VVec3.pr(VX.pr(colors), VY.pr(colors), VZ.pr(colors))));
}).add;
)
(
~t = Scinth.new(\bwMolly);
)
Last modified July 28, 2020: Update for a 0.0.7 Scintillator release (#5) (0177d81)