runnable fragment

SHKDynamicGrayNoise

shaderkit generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform float u_time;
varying vec2 v_tex_coord;
varying vec4 v_color_mix;
vec4 SKDefaultShading(){ return vec4(1.0); }
//
// Creates moving grayscale noise.
//
// This works using a simple (but brilliant!) and well-known trick: if you
// calculate the dot product of a texture coordinate with a vec2 containing
// two numbers that are unlikely to repeat, then calculate the sine of that
// and multiply it by a large number, you'll end up with what looks more or
// less like random numbers in the fraction digits – i.e., everything after
// the decimal place.
runnable fragment

SHKDynamicRainbowNoise

shaderkit material glsl runnable fragment MIT
code snippet
precision mediump float;
uniform float u_time;
varying vec2 v_tex_coord;
varying vec4 v_color_mix;
vec4 SKDefaultShading(){ return vec4(1.0); }
//
// Creates moving multi-colored noise.
//
// This works using a simple (but brilliant!) and well-known trick: if you
// calculate the dot product of a texture coordinate with a vec2 containing
// two numbers that are unlikely to repeat, then calculate the sine of that
// and multiply it by a large number, you'll end up with what looks more or
// less like random numbers in the fraction digits – i.e., everything after
// the decimal place.
runnable fragment

SHKStaticGrayNoise

shaderkit generative glsl runnable fragment MIT
code snippet
precision mediump float;
varying vec2 v_tex_coord;
varying vec4 v_color_mix;
vec4 SKDefaultShading(){ return vec4(1.0); }
//
// Creates fixed grayscale noise.
//
// This works using a simple (but brilliant!) and well-known trick: if you
// calculate the dot product of a texture coordinate with a vec2 containing
// two numbers that are unlikely to repeat, then calculate the sine of that
// and multiply it by a large number, you'll end up with what looks more or
// less like random numbers in the fraction digits – i.e., everything after
// the decimal place.
//
runnable fragment

SHKStaticRainbowNoise

shaderkit material glsl runnable fragment MIT
code snippet
precision mediump float;
varying vec2 v_tex_coord;
varying vec4 v_color_mix;
vec4 SKDefaultShading(){ return vec4(1.0); }
//
// Creates fixed multi-colored noise.
//
// This works using a simple (but brilliant!) and well-known trick: if you
// calculate the dot product of a texture coordinate with a vec2 containing
// two numbers that are unlikely to repeat, then calculate the sine of that
// and multiply it by a large number, you'll end up with what looks more or
// less like random numbers in the fraction digits – i.e., everything after
// the decimal place.
//
runnable fragment

SHKWater

shaderkit material glsl runnable fragment MIT
code snippet
precision mediump float;
uniform float u_time;
uniform sampler2D u_texture;
varying vec2 v_tex_coord;
varying vec4 v_color_mix;
//
// Warps a textured node to create a water rippling effect.
// NOTE: This must be applied to something that has a texture.
// Uniform: u_speed, how many fast to make the water ripple. Ranges from 0.5 to 10 work best; try starting with 3.
// Uniform: u_strength, how pronounced the rippling effect should be. Ranges from 1 to 5 work best; try starting with 3.
// Uniform: u_frequency, how often ripples should be created. Ranges from 5 to 25 work best; try starting with 10.
//
// This works by using a nearby pixel color rather than the original pixel color. Which neighbour is
// chosen depends on the algorithm: we pass the original coordinate, speed, and frequency