//----------------------------//
ArtMatic 1 in 3 out components
//----------------------------//


Set Constant
Scale Vector (Ax,Bx,Cx)
Add (x+A,x+B,x+C)
3D derivative (dx,dy,dz)
RGB Neon line
RGB half plane
Unpack
Main gradient #
Indexed gradient
Shaded plain color #
RGB gamma
Monochrome ramp
Hue color
Random color
Multi Perlin noise
Linear motion
Circular motion
Random motion
Timeloop Interpolator
Compiled tree (Subtree)

//----------------------------//

Introduction

1->3 Components generally serve one of three functions: to convert a scalar (single value) stream to RGB color, to generate three independent values, or to unpack an RGB stream.




//----------------------------//

13 Set Constant

ArtMatic script function :Constant

parameters :
A : Red (0.0 : 1.0)
B : Green (0.0 : 1.0)
C : Blue (0.0 : 1.0)

discussion :
Create three independent constant values whose values are determined by parameters A, B, C and the chosen Algorithm. The input value is ignored. The output can be thought of as either three independent values or as a single RGB color.

Script examples:
explicit: vec3 va = Constant(A1); //will create a constant tile without parameter, connected to A1
implicit any: vec3 va =(1,2,3); //will create a constant tile with given parameters
implicit color: vec3 va =color(0.8,0,1); //will create a purple color constant

algorithms :




13 Scale Vector (Ax,Bx,Cx)

ArtMatic script function :Scale_Vector

parameters :
A : A (-16.0 : 16.0)
E9 options
B : B (-16.0 : 16.0) E9 options
C : C (-16.0 : 16.0) E9 options

discussion :
Scale the input value using parameters A, B and C. Output is A*x, B*x, C*x.



13 Add (x+A,x+B,x+C)

ArtMatic script function :Add

parameters :
A : A (-50.0 : 50.0)
E9 options
B : B (-50.0 : 50.0) E9 options
C : C (-50.0 : 50.0) E9 options

discussion :
This component is sometimes referred to as Add Vector, the constant vector added being (A,B,C). The three outputs are x+A, x+B and x+C. Add Vector can be useful for adding offsets to the same axis to move several objects in the same axis.



13 3D derivative (dx,dy,dz)

ArtMatic script function :derivative

parameters :
A : Amplitude (-2.0 : 2.0)
B : Normalize % (0.0 : 1.0)

discussion :
Returns the partial derivatives dX, dY and dZ of the input function (which shall be a 3D function). When the algorithm is set to "VY Object/Terrain Normale" the normal is given directly from ArtMatic Voyager rendering in the shading phase and the input is ignored. This component is useful to implement custom shaders and textures for 3D DF objects and terrains. 'Amplitude' is usually kept at 1 but you can set it at -1 to reverse the normal. 'Normalize' can be used to force the normal to be of 1 magnitude.

algorithms :



13 RGB Neon line

ArtMatic script function :RGB_Neon_line

parameters :
A : Red (0.0 : 1.0)
B : Green (0.0 : 1.0)
C : Blue (0.0 : 1.0)
D : Spread % (0.0 : 1.0)

discussion :
This is a simple color shader that generates a vertical horizontal line if fed by the global X input or a horizontal line if fed by the global Y input. The component can also be thought of as a complex filter that outputs its maximum value (as an RGB color) where the absolute value of its input is 0 and generates increasingly smaller values as the absolute value of its input increases. When attached to the output of surface, the result is a monochrome image made up of shades of the color defined by parameters A, B and C.



13 RGB half plane

ArtMatic script function :RGB_half_plane

parameters :
A : Amplitude (-8.0 : 8.0)
B : Offset (-16.0 : 16.0)
C : Color Cycle (0.0 : 1.0)
D : Color Saturation (0.0 : 1.0)

discussion :
This component can be seen as either a simple color shader or a mathematical primitive. When used as a color shader, it generates a ‘half-plane’ of the color defined by Parameter C. When the offset is 0, the color is generated wherever the input value times Parameter A is negative; everywhere else is black. There is a smooth transition from black to the defined color. With non-zero settings of parameter A that are close to 0, the transitional area increases in size. This transition area may only be visible when zoomed far in or with amplitude values very close to 0. When 'Amplitude' is 0, the output is the color defined by Parameter C. When A < 0, the color appears on the right. When A > 0, the color appears on the left. Advanced users can use this component to implement complex systems that behave differently for negative and positive input values.

Example 1: A Half-plane connected directly to the Global X generates a half-plane of the color defined by Color Cycle:

Example 2: When connected to a surface, the result is a virtually two-tone pattern with no intermediate shades except where the input value is very close to 0.



13 Unpack

ArtMatic script function :Unpack

parameters :
No parameters.

discussion :
Unpack a 3D/RGB stream into its component streams. The stream must have been packed with the 3->1 Pack component or comes from a tile producing a packed stream directly. Most frequently, this is used with compiled trees: either inside of a compiled tree to unpack RGB values passed into the compiled tree through a single input or to unpack RGB values passed out of a compiled tree through a single output.
The corresponding inverse function is the 31
Pack(x,y,z) which packs the xyz input.



13 Main gradient #

ArtMatic script function :Gradient

parameters :
A : Scale X (0.0 : 8.0)
B : Offset (-2.0 : 2.0)

discussion :
Main Gradient maps input value to a color of the
Main gradient (the current gradient). When parameters A 'Scale' and B 'Offset' are 1 and 0 respectively, 0 maps to the leftmost color of the gradient and 8 maps to the rightmost color.

algorithms :



13 Indexed gradient

ArtMatic script function :Indexed_gradient

parameters :
A : Scale X (0.0 : 8.0)
B : Offset (-2.0 : 2.0)
C : Index (0 : 48) integer

discussion :
This component is similar to
13 Main Gradient but uses parameter C (Index) to choose the gradient that will be taken from the built-in Gradient list.
Starting engine 8.08 Indexed Gradient has the same algotithm options than 13 Main Gradient.

algorithms :



13 Shaded plain color #

ArtMatic script function :Shaded_color

parameters :
A : Red (0.0 : 1.0)
B : Green (0.0 : 1.0)
C : Blue (0.0 : 1.0)
D : Contrast % (0.0 : 16.0)
E9 options

discussion :
This component maps input value to a shade of the color defined by parameters Red,Green,Blue. or a shade of its complementary color. The parameter D 'Contrast' scales the input prior the luminance shading of the color. With Ramp the shading uses D*|x| while with Contrast the shading uses clamp(mix(1,x,D),0,1) meaning a value of 0 for D will means no shading takes place.

algorithms :



13 RGB gamma

ArtMatic script function :RGB_gamma

parameters :
A : Gamma red (0.125 : 8.0)
B : Gamma green (0.125 : 8.0)
C : Gamma blue (0.125 : 8.0)

discussion :
Map a value to RGB with independent control of the R, G and B channels response curve. Gamma is an efficient way to 'tint' monochrome image or to give linear grey shades a colored neon light look.



13 Monochrome ramp

ArtMatic script function :Monochrome

parameters :
A : Red (0.0 : 1.0)
B : Green (0.0 : 1.0)
C : Blue (0.0 : 1.0)
D : Contrast % (0.0 : 2.0)
E9 options

discussion :
Monochrome ramp, available starting E9, returns a monochromatic gradient function of x with a color ramp ranging from black to "color" to white, "color" being set by parameters.
The contrast controls the slope of the gradient, typically by multiplying input x before mapping to the gradient;



13 Hue color

ArtMatic script function :Hue_color

parameters :
A : Hue Variance (0.0 : 720.0)
B : Saturation (0.0 : 1.0)
C : Luminance (0.0 : 1.0)

discussion :
Color shader that maps input to a color defined by the HLS values defined by parameters A, B and C. The saturation and luminance of the output color are determined by parameters B and C. Parameter A, Hue Variance, is multiplied with the input value before the being mapped to a hue value. As a result, when Hue Variance is small, this component is not very sensitive to changes in the input value. When Hue Variance is large, the component is very sensitive to input value changes. The output is periodic.



13 Random color

ArtMatic script function :Random_color

parameters :
A : Color Variance (-4.0 : 4.0)
B : Saturation (0.0 : 1.0)
C : Luminance (0.0 : 1.0)

discussion :
Color shader that performs a random mapping of the input value to an RGB color whose saturation and luminance are determined by parameters B and C. The color range is determined by parameter A. The output is smoothed so that there are smooth transitions from color to color when the input is continuous.



13 Multi Perlin noise

ArtMatic script function :MultiPerlin_noise

parameters :
A : Amplitude (-8.0 : 8.0)
B : Octaves (1.0 : 128.0)
C : Frequency (0.0 : 32.0)
D : Roughness (0.125 : 0.750)

discussion :
13 Multi Perlin noise returns a 3D Vector of
Multi Perlin noise with different phases for each components. It can be seen as a triple 11 Multi Perlin noise function. As with the 11 version the "Octaves" parameter controls the amount of higher frequencies additions and the 'Roughness' parameter the fractal dimension of the resulting noise. Values are balanced and can become negatives so when using it as a random color generator you will need to scale and offset the values.



13 Linear motion

ArtMatic script function :Linear_motion

parameters :
A : Direction x (-1.0 : 1.0)
E9 options
B : Direction y (-1.0 : 1.0) E9 options
C : Direction z (-1.0 : 1.0) E9 options
D : Speed (-50.0 : 50.0) E9 options

discussion :
"Linear motion" provides a 3D linear motion akin to the 12 Linear motion tile when input is connected to time (w) or z input in 2D systems. The direction is given by the "Direction" vector parameter that will be normalised internally. Use (0 ,-1,0) to move upward for example. The 'Speed' parameter scales the input time. When negative, motion will proceed backward. The motion is at constant speed if the input is linear. The resulting position has to be added to the target coordinates to actually move it, usually with a packed 3D vector add like Packed RGB Add or better Packed Vector Maths when the target is a 3D object.



13 Circular motion

ArtMatic script function :Circular_motion

parameters :
A : Radius (0.0 : 100.0)
E9 options
B : Angle oX (-180.0 : 180.0) angle in degree
C : Angle oZ (-180.0 : 180.0) angle in degree
D : Speed % (-50.0 : 50.0)

discussion :
When the input is connected to time (w), the result is a circular motion in 3D. With angles oX and oZ at zero the circle is on the XZ plane. You may rotate the circle plane with the 'Angle oX' and 'Angle oZ' parameters (in degree). The 'Radius' sets the radius of the circle.The 'Speed' parameters scales the input time. When negative, motion will proceed backward.
The motion position produced by Circular motion has to be added to the target coordinates usually with a Packed Vector Maths tile when the target is a 3D object.
The tile has the options to interpret the radius in various units.
Examples : Libraries/Components demo/Motion3DMetaballs.artm



13 Random motion

ArtMatic script function :Random_motion

parameters :
A : Radius (0.0 : 100.0)
E9 options
B : Speed % (-50.0 : 50.0)

discussion :
This component creates continuous random 3D motion when the input is connected to time (w). 'Radius' sets the radius of the motion and 'Speed' parameter scales the input time. When negative, motion will proceed backward. The random motion path is generated using a 1D vector valued (3D) perlin noise function.The motion position produced by Random motion has to be added to the target coordinates usually with a a Packed Vector Maths tile when the target is a 3D object.
The tile has the options to interpret the radius in various units.
Examples : Libraries/Maths/Functions plots/RandomMotion3D.artm



13 Timeloop Interpolator

ArtMatic script function :Timeloop_Interpolator

parameters :
A : Period (0.125 : 32.0)

discussion :
Timeloop Interpolator is a utility that makes creation of seamless loops easy.
It outputs 2 overlapping cycling ramps in first 2 outputs with a blending function in third output (z). The blending function shall be used to fade whatever the 2 cycling ramps controls so that looping is continuous. Usually you will use a 31 interpolation tile to blend the 2 functions with z controlling the interpolation like
31 z Blend and the Timeloop tile will be connected to time. If the function to loop is RGBA use Packed z Blend and pass z to the alpha input. The looping take place over the given period so set the animation time to an integer multiple of the period to have 1 or several loop instances.
With Timeloop Interpolator you can create continuous periodic signals with anything as well as seamless motion loops.
Examples : Libraries/Animated Loops/FiberWaves Loop 16.artm Libraries/Animated Loops/Gamma Clouds PanX.artm Libraries/Maths/Periodic fractal signal.artm



13 Compiled tree (Subtree)

ArtMatic script function :Subtree_

parameters :
A : Scale (0.0 : 1.0)
B : Iterations (0 : 256) integer

discussion :
Compiled Trees are groups of tiles that can be used in place of single tiles as a kind of macro or subroutine.
13 CT can hold any 1 input / 3 ouputs tree that can be seen generally as a 3D vector valued 1D function. In particular 13 CT will often be used to output an RGB color derived from elevation or time, or to define a 3D motion path (3D parametric curve). Select a 13 tile and use Tree menu : New compiled tree to create a new CT from the selection (or type 'n' key).
With
E9 you may also create a 13 CT using ArtMatic script language (Tree menu : New CT as text ) and directly type the fonction you want. For example it could be a procedural color gradient function of input like :
vec3 va = color(x,x^2,x^3);
To save a CT on disk to use the function elsewhere use Save compiled tree from the Tree Edit menu.
You may also copy and paste the entire CT by using Copy Tile and Paste Tile from the Edit menu.
You may iterate the tree by "Iterations" number when the tree contains an Iterations tile to modify and accumulates various values. "Scale" provide an optionnal scaling of outputs and is set at 1 by default (no scaling).