Linear

The Linear Visualiser represents the Set of Bars, Particles and Particle Connectors that can be drawn on a straight line.


Primitives

A Bar or a Particle is referred to as a Primitive.

A Primitive resides in a Fragment (this is different from the Fragment in a Vertex / Fragment Shader), and has properties that define its size and appearance.


Fragments

A Fragment is the division of the total Window View into different 'Columns'. This serves as the housing space for the Primitives.

Each Fragment has a width that must be a constant throughout the current Frame of the Shader Program, and is represented by fragmentWidth.

If a Primitive's width exceeds that of the Fragment, then the Primitive appears as if it's been clipped or cut-off. This is intended, as no two Primitives from different Fragments can overlap.

This is because Linear Shader's logic divides the screen in different sections (Fragments) and treats them independently.


Working

In the Common GLSL Configuration File, various variables and functions have been laid out that are essential for the Shader to Compile.

The variables primarily define:

  • The width of the Fragment,

  • The vertical directions of the Primitives (Up, Down, or both), and

  • Type(s) of Primitive to display (Bar, Particle, or both)

The functions serve as concrete stages in the processing of the Shader, and hence allow the specification of different values that affect the Primitives' Visuals.


Fragment Represents the underlying Fragment that can show one Particle and one Bar. None of the Attributes are meant to be modified.
PropertyData TypeDescriptionExample
nfloatNumber of the current Fragment . Ranges from 0 to lastN .-
lastNfloatNumber of the last possible Fragment .-
spanfloatSpan of the Fragment . Lies in [-fragmentWidth/2.,fragmentWidth/2.]-
coordsvec2Absolute Coordinates in the Shader , corresponding to (x,y) . Lies in [vec2(0,0), vec2(resolution.xy)]-
centerCoordsvec2Absolute Coordinates of the Fragment's Center .-

Audio Settings Represents the various Audio-transformation properties for each side.
PropertyData TypeDescriptionExample
reverseLeftintSpecifies the reversal of the left audio channel. Either 0 or 1.0
reverseRightintSpecifies the reversal of the right audio channel. Either 0 or 1.0
modeint0 for mirrored audio output, where the left half corresponds to the left audio channel and the right half corresponds to the right audio channel. 1 for linear audio output, where the top half represents the right audio channel and the bottom half represents the left audio channel.1
combineChannelsintSpecifies whether the audio values should be combined from the left and right channels. Either 0 or 1.1

Audio Represents the captured Audio Data, and its multiplier.
PropertyData TypeDescriptionExample
multiplierfloatAmplification for the audio value100
currentvec2Stores the Current Fragment's left audio channel data in x, and the right audio channel data in y.-
prevvec2Stores the Previous Fragment's left audio channel data in x, and the right audio channel data in y.-
nextvec2Stores the Next Fragment's left audio channel data in x, and the right audio channel data in y.-

Cap Represents a Cap that can 'bounce' over a Primitive (Bar or Particle). Requires 1 Image Texture to be enabled when visualiserMode is either 0 or 1, and requires 2 whenvisualiserMode is 2.
PropertyData TypeDescriptionExample
enableboolSpecifies whether the Caps should be enabled.false
ratefloatThe Downwards fall rate for the Cap . Constant.0.03
elasticityfloatBounciness of the Cap when encountering the Edge of the Parent Primitive .0.03
elasticityMinThresholdfloatMinimum 'bounciness' value that is used to immediately put the Cap at rest on the Parent Primitive's Edge.0.6
launchVelocityfloatUpwards Velocity of the Cap when the parent Primitive moves upwards.0.04
sizevec2Size of the Cap .vec2(3, 5)
accelerationfloatAcceleration for the downwards fall of the Cap .0.5
launchFlingMultiplierfloatUpwards Thrust of the Cap influenced by the current Audio value in the Fragment , when the Parent Primitive moves upwards.0.5
dragFactorfloatDrag factor. Higher values yield a constant downwards terminal velocity for the Cap .0.01
offsetvec2Offset for the Cap . Will be added to the coordinates of the Cap .vec2(0,12)
audiovec2The audio value that will be used for the Cap . x stores the left channel for the current Fragment and y stores the right channel. Each channel is used according to the channel of the Primitive .-
softnessvec3Softness of the Cap . x, y and z respectively represent softness values for the top , left & right , and bottom edges. Higher softness value yields a smoother and blurred edge.vec3(1, 1.5, 1)
colorvec4Color of the Cap .vec4(1, 0, 0, 0)

Connector Half Represents the left and right sides of a Connector.
PropertyData TypeDescriptionExample
enableintSpecifies whether the Connector Half should be enabled.0
heightfloatHeight of the Connector Half .3
borderSizefloatBorderSize of the Connector Half .2
innerSoftnessfloatInner Softness of the Connector Half . Higher softness value yields a smoother and blurred edge.0.5
outerSoftnessfloatOuter Softness of the Connector Half . Higher softness value yields a smoother and blurred edge.0.5
colorvec4Inner Color of the Connector Half .vec4(1.0, 1.0, 0.0, 1.0)
borderColorvec4Outer Color of the Connector Half .vec4(1.0, 1.0, 1.0, 1.0)

Connector Represents the combination of left and right Connectors.
PropertyData TypeDescriptionExample
leftConnectorHalfLeft Connector Half-
rightConnectorHalfRight Connector Half-
jointModeintJoint Mode1
jointColorModeintJoint Color Mode0
leftCentervec2Stores the coordinates of the Particle in the Left Fragment .-
currentCentervec2Stores the coordinates of the Particle in the Current Fragment .-
rightCentervec2Stores the coordinates of the Particle in the Right Fragment .-

Particle Represents a Particle.
PropertyData TypeDescriptionExample
fragmentFragmentStores the current Fragment .-
audioAudioStores captured Audio Data.-
capCapStores the Cap for the Particle .-
connectorConnectorStores Connector Settings.-
reverseBottomOffsetintSpecifies whether the bottom offset value provided should be inverted for the Bottom Particles .1
radiusfloatSpecifies the radius of the Particle .3
borderSizefloatSpecifies the borderSize of the Particle .2
interChannelDistancefloatSpecifies the vertical distance between the Top and Bottom Particles12
innerSoftnessfloatSpecifies the inner Softness of the Particle . Higher softness value yields a smoother and blurred edge.0.5
outerSoftnessfloatSpecifies the inner Softness of the Particle . Higher softness value yields a smoother and blurred edge.0.5
offsetvec2Specifies the offset of the Particle . Added to the coordinates of the Particle . Use setOffsets() to properly show connectors if enabled.vec2(1,12)
colorvec4Inner Color of the Particle .vec4(1, 0, 0, 1)
borderColorvec4Outer Color of the Particle .vec4(1, 1, 1, 1)

Bar Represents a Bar.
PropertyData TypeDescriptionExample
fragmentFragmentStores the current Fragment .-
audioAudioStores captured Audio Data.-
upCapCapStores the Top Cap for the Bar .-
downCapCapStores the Bottom Cap for the Bar .-
typeintSpecifies the type of Bars to draw: 0 for Rectangular , and 1 for Rounded . Only Rectangular Bars can be merged.1
mergeLeftBarintSpecifies merging of the Bar on the Left. Either 0 or 1.1
mergeRightBarintSpecifies merging of the Bar on the Right. Either 0 or 1.1
clampLeftMergeBorderint1 to specify left Border to be always present on the very first Bar , when mergeLeftBar is 1.1
clampRightMergeBorderint1 to specify right Border to be always present on the very last Bar , when mergeRightBar is 1.1
offsetvec2Specifies the offset of the Bar . Added to Bar's coordinates.vec2(0,-12)
sizevec3Specifies the Size of the Bar . x, y and z represent the minimum upwards height, horizontal size, and the minimum downwards height.vec3(3, 12, 3)
borderSizevec3Specifies the BorderSize of the Bar . x, y and z represent the top, left & right, down side Borders.vec3(1, 2, 1)
innerSoftnessvec3Softness of the Inner Edge of the Bar . x, y and z respectively represent softness values for the top , left & right , and bottom edges. Higher softness value yields a smoother and blurred edge.vec3(0.5)
outerSoftnessvec3Softness of the Outer Edge of the Bar . x, y and z respectively represent softness values for the top , left & right , and bottom edges. Higher softness value yields a smoother and blurred edge.vec3(0.5)
colorvec4Specifies the Inner Color of the Bar .vec4(0,1,1,1)
borderColorvec4Specifies the Outer Color of the Bar .vec4(0.0, 1.0, 0.5, 1.0)
bgColorvec4Specifies the background Color over which Bars are displayed.vec4(0.5)