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

Vulkan fragment shader: liquid code iridescent whirlpool. More...

Go to the source code of this file.

Macros

#define amp_high   ext.audio_bands.z
#define amp_low   ext.audio_bands.x
#define amp_mid   ext.audio_bands.y
#define amp_peak   ext.u2.w
#define amp_smooth   ext.u3.w
#define iResolution   ext.u0.zw
#define time_f   ext.u2.y

Functions

 layout (set=0, binding=1, std140) uniform SpriteExtended
 layout (location=0) in vec2 tc
 layout (set=0, binding=0) uniform sampler2D samp
float hash21 (vec2 p)
 Evaluates hash21 for this shader effect.
float noise21 (vec2 p)
 Evaluates noise21 for this shader effect.
float turbulentFbm (vec2 p)
 Evaluates turbulentFbm for this shader effect.
vec2 rotate2 (vec2 p, float angle)
 Evaluates rotate2 for this shader effect.
vec2 mirrorUV (vec2 uv)
 Evaluates mirrorUV for this shader effect.
vec3 interference (float phase, float thickness)
 Evaluates interference for this shader effect.
float whirlpoolHeight (vec2 p)
 Evaluates whirlpoolHeight for this shader effect.
vec3 whirlpoolNormal (vec2 p, float e)
 Evaluates whirlpoolNormal for this shader effect.
vec3 refractedTexture (vec2 uv, vec2 tangent, vec2 normalFlow, float split)
 Evaluates refractedTexture for this shader effect.
float anisotropicSpecular (vec3 n, vec3 v, vec3 l, vec3 tangent, float roughness)
 Evaluates anisotropicSpecular for this shader effect.
vec3 iridescentMetal (vec3 base, vec3 n, vec2 p, float thickness, float roughness)
 Evaluates iridescentMetal for this shader effect.
vec3 toneMap (vec3 value)
 Evaluates toneMap 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

Detailed Description

Vulkan fragment shader: liquid code iridescent whirlpool.

Definition in file liquid_code_iridescent_whirlpool.frag.

Macro Definition Documentation

◆ amp_high

#define amp_high   ext.audio_bands.z

Definition at line 17 of file liquid_code_iridescent_whirlpool.frag.

◆ amp_low

#define amp_low   ext.audio_bands.x

Definition at line 18 of file liquid_code_iridescent_whirlpool.frag.

◆ amp_mid

#define amp_mid   ext.audio_bands.y

Definition at line 19 of file liquid_code_iridescent_whirlpool.frag.

◆ amp_peak

#define amp_peak   ext.u2.w

Definition at line 20 of file liquid_code_iridescent_whirlpool.frag.

◆ amp_smooth

#define amp_smooth   ext.u3.w

Definition at line 21 of file liquid_code_iridescent_whirlpool.frag.

◆ iResolution

#define iResolution   ext.u0.zw

Definition at line 22 of file liquid_code_iridescent_whirlpool.frag.

◆ time_f

#define time_f   ext.u2.y

Definition at line 23 of file liquid_code_iridescent_whirlpool.frag.

Function Documentation

◆ anisotropicSpecular()

float anisotropicSpecular ( vec3 n,
vec3 v,
vec3 l,
vec3 tangent,
float roughness )

Evaluates anisotropicSpecular for this shader effect.

Parameters
nInput value for the calculation.
vInput value for the calculation.
lInput value for the calculation.
tangentInput value for the calculation.
roughnessInput value for the calculation.
Returns
Computed float value.

Definition at line 181 of file liquid_code_iridescent_whirlpool.frag.

References anisotropicSpecular(), n(), and PI.

Referenced by anisotropicSpecular(), and iridescentMetal().

◆ hash21()

float hash21 ( vec2 p)

Evaluates hash21 for this shader effect.

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

Definition at line 44 of file liquid_code_iridescent_whirlpool.frag.

References hash21().

◆ interference()

vec3 interference ( float phase,
float thickness )

Evaluates interference for this shader effect.

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

Definition at line 105 of file liquid_code_iridescent_whirlpool.frag.

References interference(), and TAU.

Referenced by effectField(), interference(), iridescentMetal(), main(), main(), and xenolith().

◆ iridescentMetal()

vec3 iridescentMetal ( vec3 base,
vec3 n,
vec2 p,
float thickness,
float roughness )

Evaluates iridescentMetal for this shader effect.

Parameters
baseInput value for the calculation.
nInput value for the calculation.
pInput value for the calculation.
thicknessInput value for the calculation.
roughnessInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 200 of file liquid_code_iridescent_whirlpool.frag.

References anisotropicSpecular(), film(), interference(), iridescentMetal(), n(), and time_f.

Referenced by iridescentMetal(), and main().

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

References layout().

◆ main()

◆ mirrorUV()

vec2 mirrorUV ( vec2 uv)

Evaluates mirrorUV for this shader effect.

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

Definition at line 95 of file liquid_code_iridescent_whirlpool.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 53 of file liquid_code_iridescent_whirlpool.frag.

References hash21(), and noise21().

◆ refractedTexture()

vec3 refractedTexture ( vec2 uv,
vec2 tangent,
vec2 normalFlow,
float split )

Evaluates refractedTexture for this shader effect.

Parameters
uvInput value for the calculation.
tangentInput value for the calculation.
normalFlowInput value for the calculation.
splitInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 159 of file liquid_code_iridescent_whirlpool.frag.

References mirrorUV(), and refractedTexture().

◆ 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 84 of file liquid_code_iridescent_whirlpool.frag.

References rotate2().

◆ toneMap()

vec3 toneMap ( vec3 value)

Evaluates toneMap for this shader effect.

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

Definition at line 231 of file liquid_code_iridescent_whirlpool.frag.

References toneMap().

◆ turbulentFbm()

float turbulentFbm ( vec2 p)

Evaluates turbulentFbm for this shader effect.

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

Definition at line 66 of file liquid_code_iridescent_whirlpool.frag.

References noise21(), rotation(), and turbulentFbm().

Referenced by main(), turbulentFbm(), and whirlpoolHeight().

◆ whirlpoolHeight()

float whirlpoolHeight ( vec2 p)

Evaluates whirlpoolHeight for this shader effect.

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

Definition at line 117 of file liquid_code_iridescent_whirlpool.frag.

References amp_mid, rotate2(), time_f, turbulentFbm(), warp(), and whirlpoolHeight().

Referenced by main(), whirlpoolHeight(), and whirlpoolNormal().

◆ whirlpoolNormal()

vec3 whirlpoolNormal ( vec2 p,
float e )

Evaluates whirlpoolNormal for this shader effect.

Parameters
pInput value for the calculation.
eInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 142 of file liquid_code_iridescent_whirlpool.frag.

References whirlpoolHeight(), and whirlpoolNormal().

Referenced by main(), and whirlpoolNormal().

Variable Documentation

◆ ext

ext

Definition at line 16 of file liquid_code_iridescent_whirlpool.frag.

◆ PI

const float PI = 3.14159265359

Definition at line 36 of file liquid_code_iridescent_whirlpool.frag.

◆ TAU

const float TAU = 6.28318530718

Definition at line 37 of file liquid_code_iridescent_whirlpool.frag.