Color Palette
code:iq_color_cosine.glsl
// From IQ
// cosine based palette, 4 vec3 params
vec3 palette( in float t, in vec3 a, in vec3 b, in vec3 c, in vec3 d )
{
return a + b*cos( 6.28318*(c*t+d) );
}
https://scrapbox.io/files/655f2e9e44b6ec001cd089b1.png
code:simplified_color_cosine.glsl
// Simplified version of iq that generate basic rainbow
// Easy to tweak in livecoding situation by either hadcoding coefficient or adding new variable to slowly look like original iq code.
vec3 palette(float t){
return .5+.5*cos(6.28*(1.*t+vec3(.0,.3,.7)));
}
https://scrapbox.io/files/655f2e5a853895001b4d6907.png
Resource