ACMX Vulkan Shader Library
GLSL 4.50 shader effects for ACMX's Vulkan renderer
Loading...
Searching...
No Matches
energy-cache-code-magnetic-ribbons.frag File Reference

Vulkan fragment shader: energy-cache-code-magnetic-ribbons. More...

Go to the source code of this file.

Macros

#define amp_peak   ext.u2.w
#define amp_smooth   ext.u3.w
#define history_head   int(ext.u3.x)
#define iResolution   ext.u0.zw
#define spectrum_history_head   int(ext.audio_history.x)
#define spectrum_history_size   int(ext.audio_history.y)
#define time_f   ext.u2.y
#define SIZE   8
#define CACHE_HISTORY_LAYER(index)
#define SPECTRUM_HISTORY_LAYER(index)

Functions

 layout (set=0, binding=1, std140) uniform SpriteExtended
 layout (location=0) in vec2 tc
 layout (set=0, binding=0) uniform sampler2D samp
vec2 mirror_repeat (vec2 point)
 Evaluates mirror repeat for this shader effect.
vec3 palette (float phase)
 Evaluates palette for this shader effect.
vec3 sample_cache (int index, vec2 uv)
 Evaluates sample cache for this shader effect.
float history_fft (int index, float frequency)
 Evaluates history fft for this shader effect.
float ribbons (vec2 point, float bass, float middle, float high)
 Evaluates ribbons for this shader effect.
void main ()
 Executes the fragment shader entry point.

Variables

 ext
const float TAU = 6.28318530718

Detailed Description

Vulkan fragment shader: energy-cache-code-magnetic-ribbons.

Definition in file energy-cache-code-magnetic-ribbons.frag.

Macro Definition Documentation

◆ amp_peak

#define amp_peak   ext.u2.w

Definition at line 17 of file energy-cache-code-magnetic-ribbons.frag.

◆ amp_smooth

#define amp_smooth   ext.u3.w

Definition at line 18 of file energy-cache-code-magnetic-ribbons.frag.

◆ CACHE_HISTORY_LAYER

#define CACHE_HISTORY_LAYER ( index)
Value:
((history_head + (index)) % SIZE)
#define history_head
#define SIZE

Definition at line 35 of file energy-cache-code-magnetic-ribbons.frag.

◆ history_head

#define history_head   int(ext.u3.x)

Definition at line 19 of file energy-cache-code-magnetic-ribbons.frag.

◆ iResolution

#define iResolution   ext.u0.zw

Definition at line 20 of file energy-cache-code-magnetic-ribbons.frag.

◆ SIZE

#define SIZE   8

Definition at line 32 of file energy-cache-code-magnetic-ribbons.frag.

◆ spectrum_history_head

#define spectrum_history_head   int(ext.audio_history.x)

Definition at line 21 of file energy-cache-code-magnetic-ribbons.frag.

◆ SPECTRUM_HISTORY_LAYER

#define SPECTRUM_HISTORY_LAYER ( index)
Value:
#define spectrum_history_head
#define spectrum_history_size

Definition at line 42 of file energy-cache-code-magnetic-ribbons.frag.

◆ spectrum_history_size

#define spectrum_history_size   int(ext.audio_history.y)

Definition at line 22 of file energy-cache-code-magnetic-ribbons.frag.

◆ time_f

#define time_f   ext.u2.y

Definition at line 23 of file energy-cache-code-magnetic-ribbons.frag.

Function Documentation

◆ history_fft()

float history_fft ( int index,
float frequency )

Evaluates history fft for this shader effect.

Parameters
indexInput value for the calculation.
frequencyInput value for the calculation.
Returns
Computed float value.

Definition at line 75 of file energy-cache-code-magnetic-ribbons.frag.

References frequency, history_fft(), SIZE, SPECTRUM_HISTORY_LAYER, and spectrum_history_size.

◆ layout() [1/3]

layout ( location = 0)

References layout().

◆ layout() [2/3]

layout ( set = 0,
binding = 0 )

References layout().

◆ layout() [3/3]

layout ( set = 0,
binding = 1,
std140  )

Definition at line 7 of file energy-cache-code-magnetic-ribbons.frag.

References layout().

◆ main()

void main ( void )

Executes the fragment shader entry point.

Definition at line 99 of file energy-cache-code-magnetic-ribbons.frag.

References amp_peak, amp_smooth, history_fft(), iResolution, main(), mirror_repeat(), palette(), ribbons(), sample_cache(), SIZE, time_f, and warp().

◆ mirror_repeat()

vec2 mirror_repeat ( vec2 point)

Evaluates mirror repeat for this shader effect.

Parameters
pointInput value for the calculation.
Returns
Computed vec2 value.

Definition at line 55 of file energy-cache-code-magnetic-ribbons.frag.

References mirror_repeat().

◆ palette()

vec3 palette ( float phase)

Evaluates palette for this shader effect.

Parameters
phaseInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 61 of file energy-cache-code-magnetic-ribbons.frag.

References palette(), and TAU.

◆ ribbons()

float ribbons ( vec2 point,
float bass,
float middle,
float high )

Evaluates ribbons for this shader effect.

Parameters
pointInput value for the calculation.
bassInput value for the calculation.
middleInput value for the calculation.
highInput value for the calculation.
Returns
Computed float value.

Definition at line 89 of file energy-cache-code-magnetic-ribbons.frag.

References ribbons(), and time_f.

Referenced by effectField(), main(), main(), ribbons(), and ribbons().

◆ sample_cache()

vec3 sample_cache ( int index,
vec2 uv )

Evaluates sample cache for this shader effect.

Parameters
indexInput value for the calculation.
uvInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 68 of file energy-cache-code-magnetic-ribbons.frag.

References CACHE_HISTORY_LAYER, mirror_repeat(), and sample_cache().

Variable Documentation

◆ ext

ext

Definition at line 16 of file energy-cache-code-magnetic-ribbons.frag.

◆ TAU

const float TAU = 6.28318530718

Definition at line 48 of file energy-cache-code-magnetic-ribbons.frag.