ACMX Vulkan Shader Library
GLSL 4.50 shader effects for ACMX's Vulkan renderer
Loading...
Searching...
No Matches
inversion_code_cache_resonance_cavity.frag File Reference

Vulkan fragment shader: inversion code cache resonance cavity. 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 iTime   ext.u0.y
#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
float clockTime ()
 Evaluates clockTime for this shader effect.
float hash21 (vec2 p)
 Evaluates hash21 for this shader effect.
vec2 hash22 (vec2 p)
 Evaluates hash22 for this shader effect.
float noise21 (vec2 p)
 Evaluates noise21 for this shader effect.
float fbm (vec2 p)
 Evaluates fbm for this shader effect.
vec2 rotate2 (vec2 p, float angle)
 Evaluates rotate2 for this shader effect.
float segmentDistance (vec2 p, vec2 a, vec2 b)
 Evaluates segmentDistance for this shader effect.
vec2 mirrorUV (vec2 uv)
 Evaluates mirrorUV for this shader effect.
vec3 palette (float phase)
 Evaluates palette for this shader effect.
vec3 toneMap (vec3 value)
 Evaluates toneMap for this shader effect.
vec4 cacheFrame (int index, vec2 uv)
 Evaluates cacheFrame for this shader effect.
float spectrumHistory (int index, float frequency)
 Evaluates spectrumHistory for this shader effect.
vec4 historyBands (int index)
 Evaluates historyBands for this shader effect.
vec3 energyField (vec2 p, float age, vec4 band)
 Evaluates energyField for this shader effect.
void main (void)
 Executes the fragment shader entry point.

Variables

 ext
const float PI = 3.14159265359
const float TAU = 6.28318530718
const float HUE_OFFSET = 0.67

Detailed Description

Vulkan fragment shader: inversion code cache resonance cavity.

Definition in file inversion_code_cache_resonance_cavity.frag.

Macro Definition Documentation

◆ amp_peak

#define amp_peak   ext.u2.w

Definition at line 17 of file inversion_code_cache_resonance_cavity.frag.

◆ amp_smooth

#define amp_smooth   ext.u3.w

Definition at line 18 of file inversion_code_cache_resonance_cavity.frag.

◆ CACHE_HISTORY_LAYER

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

Definition at line 37 of file inversion_code_cache_resonance_cavity.frag.

◆ history_head

#define history_head   int(ext.u3.x)

Definition at line 19 of file inversion_code_cache_resonance_cavity.frag.

◆ iResolution

#define iResolution   ext.u0.zw

Definition at line 20 of file inversion_code_cache_resonance_cavity.frag.

◆ iTime

#define iTime   ext.u0.y

Definition at line 21 of file inversion_code_cache_resonance_cavity.frag.

◆ SIZE

#define SIZE   8

Definition at line 34 of file inversion_code_cache_resonance_cavity.frag.

◆ spectrum_history_head

#define spectrum_history_head   int(ext.audio_history.x)

Definition at line 22 of file inversion_code_cache_resonance_cavity.frag.

◆ SPECTRUM_HISTORY_LAYER

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

Definition at line 44 of file inversion_code_cache_resonance_cavity.frag.

◆ spectrum_history_size

#define spectrum_history_size   int(ext.audio_history.y)

Definition at line 23 of file inversion_code_cache_resonance_cavity.frag.

◆ time_f

#define time_f   ext.u2.y

Definition at line 24 of file inversion_code_cache_resonance_cavity.frag.

Function Documentation

◆ cacheFrame()

vec4 cacheFrame ( int index,
vec2 uv )

Evaluates cacheFrame for this shader effect.

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

Definition at line 173 of file inversion_code_cache_resonance_cavity.frag.

References CACHE_HISTORY_LAYER, and cacheFrame().

◆ clockTime()

float clockTime ( )

Evaluates clockTime for this shader effect.

Returns
Computed float value.

Definition at line 60 of file inversion_code_cache_resonance_cavity.frag.

References clockTime(), iTime, and time_f.

◆ energyField()

vec3 energyField ( vec2 p,
float age,
vec4 band )

Evaluates energyField for this shader effect.

Parameters
pInput value for the calculation.
ageInput value for the calculation.
bandInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 232 of file inversion_code_cache_resonance_cavity.frag.

References clockTime(), energy(), energyField(), harmonic(), and PI.

◆ fbm()

float fbm ( vec2 p)

Evaluates fbm for this shader effect.

Parameters
pInput value for the calculation.
Returns
Computed float value.

Definition at line 100 of file inversion_code_cache_resonance_cavity.frag.

References fbm(), and noise21().

◆ hash21()

float hash21 ( vec2 p)

Evaluates hash21 for this shader effect.

Parameters
pInput value for the calculation.
Returns
Computed float value.

Definition at line 69 of file inversion_code_cache_resonance_cavity.frag.

References hash21().

◆ hash22()

vec2 hash22 ( vec2 p)

Evaluates hash22 for this shader effect.

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

Definition at line 78 of file inversion_code_cache_resonance_cavity.frag.

References hash22().

◆ historyBands()

vec4 historyBands ( int index)

Evaluates historyBands for this shader effect.

Parameters
indexInput value for the calculation.
Returns
Computed vec4 value.

Definition at line 220 of file inversion_code_cache_resonance_cavity.frag.

References historyBands(), and spectrumHistory().

◆ 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 inversion_code_cache_resonance_cavity.frag.

References layout().

◆ main()

void main ( void )

◆ mirrorUV()

vec2 mirrorUV ( vec2 uv)

Evaluates mirrorUV for this shader effect.

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

Definition at line 142 of file inversion_code_cache_resonance_cavity.frag.

References mirrorUV().

◆ noise21()

float noise21 ( vec2 p)

Evaluates noise21 for this shader effect.

Parameters
pInput value for the calculation.
Returns
Computed float value.

Definition at line 87 of file inversion_code_cache_resonance_cavity.frag.

References cell(), hash21(), and noise21().

◆ palette()

vec3 palette ( float phase)

Evaluates palette for this shader effect.

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

Definition at line 151 of file inversion_code_cache_resonance_cavity.frag.

References HUE_OFFSET, palette(), and TAU.

◆ rotate2()

vec2 rotate2 ( vec2 p,
float angle )

Evaluates rotate2 for this shader effect.

Parameters
pInput value for the calculation.
angleInput value for the calculation.
Returns
Computed vec2 value.

Definition at line 118 of file inversion_code_cache_resonance_cavity.frag.

References rotate2().

◆ segmentDistance()

float segmentDistance ( vec2 p,
vec2 a,
vec2 b )

Evaluates segmentDistance for this shader effect.

Parameters
pInput value for the calculation.
aInput value for the calculation.
bInput value for the calculation.
Returns
Computed float value.

Definition at line 131 of file inversion_code_cache_resonance_cavity.frag.

References segmentDistance().

◆ spectrumHistory()

float spectrumHistory ( int index,
float frequency )

Evaluates spectrumHistory for this shader effect.

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

Definition at line 197 of file inversion_code_cache_resonance_cavity.frag.

References frequency, SPECTRUM_HISTORY_LAYER, and spectrumHistory().

◆ toneMap()

vec3 toneMap ( vec3 value)

Evaluates toneMap for this shader effect.

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

Definition at line 161 of file inversion_code_cache_resonance_cavity.frag.

References toneMap().

Variable Documentation

◆ ext

ext

Definition at line 16 of file inversion_code_cache_resonance_cavity.frag.

◆ HUE_OFFSET

const float HUE_OFFSET = 0.67

Definition at line 54 of file inversion_code_cache_resonance_cavity.frag.

◆ PI

const float PI = 3.14159265359

Definition at line 52 of file inversion_code_cache_resonance_cavity.frag.

◆ TAU

const float TAU = 6.28318530718

Definition at line 53 of file inversion_code_cache_resonance_cavity.frag.