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

Vulkan fragment shader: Light Rainbow Swirl. More...

Go to the source code of this file.

Macros

#define iMouse   ext.mouse
#define iResolution   ext.u0.zw
#define time_f   ext.u2.y

Functions

 layout (set=0, binding=1, std140) uniform SpriteExtended
 layout (location=0) out vec4 color
 layout (set=0, binding=0) uniform sampler2D samp
vec3 rainbow (float t)
 Evaluates rainbow for this shader effect.
vec3 adjustBrightness (vec3 col, float b)
 Evaluates adjustBrightness for this shader effect.
vec3 adjustContrast (vec3 col, float c)
 Evaluates adjustContrast for this shader effect.
vec3 adjustSaturation (vec3 col, float s)
 Evaluates adjustSaturation for this shader effect.
vec2 wrapUV (vec2 tc)
 Evaluates wrapUV for this shader effect.
vec4 mxTexture (sampler2D tex, vec2 tc)
 Evaluates mxTexture for this shader effect.
vec2 rotate2D (vec2 p, float a)
 Evaluates rotate2D for this shader effect.
float hash (vec2 p)
 Evaluates hash for this shader effect.
float noise (vec2 p)
 Evaluates noise for this shader effect.
float fbm (vec2 p)
 Evaluates fbm for this shader effect.
vec3 sampleMergedLiquid (vec2 uv, float t, float strength, vec2 center, vec2 res)
 Evaluates sampleMergedLiquid for this shader effect.
void main ()
 Executes the fragment shader entry point.

Variables

 ext
const float iAmplitude = 1.0
const float iFrequency = 1.0
const float iBrightness = 1.0
const float iContrast = 1.1
const float iSaturation = 1.3
const float iZoom = 1.0
const float iRotation = 0.0
const float PI = 3.14159

Detailed Description

Vulkan fragment shader: Light Rainbow Swirl.

Definition in file Light_Rainbow_Swirl.frag.

Macro Definition Documentation

◆ iMouse

#define iMouse   ext.mouse

Definition at line 17 of file Light_Rainbow_Swirl.frag.

◆ iResolution

#define iResolution   ext.u0.zw

Definition at line 18 of file Light_Rainbow_Swirl.frag.

◆ time_f

#define time_f   ext.u2.y

Definition at line 19 of file Light_Rainbow_Swirl.frag.

Function Documentation

◆ adjustBrightness()

vec3 adjustBrightness ( vec3 col,
float b )

Evaluates adjustBrightness for this shader effect.

Parameters
colInput value for the calculation.
bInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 60 of file Light_Rainbow_Swirl.frag.

References adjustBrightness().

◆ adjustContrast()

vec3 adjustContrast ( vec3 col,
float c )

Evaluates adjustContrast for this shader effect.

Parameters
colInput value for the calculation.
cInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 67 of file Light_Rainbow_Swirl.frag.

References adjustContrast().

◆ adjustSaturation()

vec3 adjustSaturation ( vec3 col,
float s )

Evaluates adjustSaturation for this shader effect.

Parameters
colInput value for the calculation.
sInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 74 of file Light_Rainbow_Swirl.frag.

References adjustSaturation().

◆ fbm()

float fbm ( vec2 p)

Evaluates fbm for this shader effect.

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

Definition at line 141 of file Light_Rainbow_Swirl.frag.

References fbm(), noise(), and rot().

◆ hash()

float hash ( vec2 p)

Evaluates hash for this shader effect.

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

Definition at line 119 of file Light_Rainbow_Swirl.frag.

References hash().

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

References layout().

◆ main()

void main ( void )

◆ mxTexture()

vec4 mxTexture ( sampler2D tex,
vec2 tc )

Evaluates mxTexture for this shader effect.

Parameters
texInput value for the calculation.
tcInput value for the calculation.
Returns
Computed vec4 value.

Definition at line 94 of file Light_Rainbow_Swirl.frag.

References mxTexture(), and wrapUV().

◆ noise()

float noise ( vec2 p)

Evaluates noise for this shader effect.

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

Definition at line 128 of file Light_Rainbow_Swirl.frag.

References hash(), and noise().

◆ rainbow()

vec3 rainbow ( float t)

Evaluates rainbow for this shader effect.

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

Definition at line 44 of file Light_Rainbow_Swirl.frag.

References rainbow().

◆ rotate2D()

vec2 rotate2D ( vec2 p,
float a )

Evaluates rotate2D for this shader effect.

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

Definition at line 108 of file Light_Rainbow_Swirl.frag.

References rotate2D().

◆ sampleMergedLiquid()

vec3 sampleMergedLiquid ( vec2 uv,
float t,
float strength,
vec2 center,
vec2 res )

Evaluates sampleMergedLiquid for this shader effect.

Parameters
uvInput value for the calculation.
tInput value for the calculation.
strengthInput value for the calculation.
centerInput value for the calculation.
resInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 164 of file Light_Rainbow_Swirl.frag.

References fbm(), iAmplitude, iRotation, iZoom, mxTexture(), PI, rainbow(), rotate2D(), sampleMergedLiquid(), spiralTwist(), and strength.

Referenced by main(), and sampleMergedLiquid().

◆ wrapUV()

vec2 wrapUV ( vec2 tc)

Evaluates wrapUV for this shader effect.

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

Definition at line 84 of file Light_Rainbow_Swirl.frag.

References wrapUV().

Variable Documentation

◆ ext

ext

Definition at line 16 of file Light_Rainbow_Swirl.frag.

◆ iAmplitude

const float iAmplitude = 1.0

Definition at line 29 of file Light_Rainbow_Swirl.frag.

◆ iBrightness

const float iBrightness = 1.0

Definition at line 31 of file Light_Rainbow_Swirl.frag.

◆ iContrast

const float iContrast = 1.1

Definition at line 32 of file Light_Rainbow_Swirl.frag.

◆ iFrequency

const float iFrequency = 1.0

Definition at line 30 of file Light_Rainbow_Swirl.frag.

◆ iRotation

const float iRotation = 0.0

Definition at line 35 of file Light_Rainbow_Swirl.frag.

◆ iSaturation

const float iSaturation = 1.3

Definition at line 33 of file Light_Rainbow_Swirl.frag.

◆ iZoom

const float iZoom = 1.0

Definition at line 34 of file Light_Rainbow_Swirl.frag.

◆ PI

const float PI = 3.14159

Definition at line 36 of file Light_Rainbow_Swirl.frag.