Uploaded June 2026 | Updated November 2026, 5 days ago
LET'S CONNECT
✨ Sign up for my newsletter at pattvira.com
✨ Instagram: instagram.com/pattvira
✨ Twitter: twitter.com/pattvira
--
⭐ Watch the entire Shaders Series here: youtube.com/playlist?list=PL0beHPVMklwhYSt_ZNC2HzJKo7qO1-xQJ
Links:
🔗 p5.js editor: editor.p5js.org
🔗 Shaders Series Ep.4 Code: editor.p5js.org/pattvira/sketches/WQXm21NW2
References:
🔗 Cosine-based Palette:
🔗 @InigoQuilez 's article: iquilezles.org/articles/palettes
🔗 @InigoQuilez 's video explanation: youtube.com/shorts/TH3OTy5fTog
🔗 Interactive tool: apps.fenixfox-studios.com/cosine_palette
Timestamps:
0:00 Intro
0:11 Introduce mix() function
02:07 Change the blend ratio using uTime
03:09 Change the blend ratio using position
05:16 Change the blend ratio using shaping functions (step & smoothstep)
06:26 Change the blend ratio using shaping functions (distance functions)
09:28 Introduce cosine-based color palette
11:42 Bonus! Fractal!
LET'S CONNECT
✨ Sign up for my newsletter at pattvira.com
✨ Instagram: instagram.com/pattvira
✨ Twitter: twitter.com/pattvira
--
⭐ Watch the entire Shaders Series here: youtube.com/playlist?list=PL0beHPVMklwhYSt_ZNC2HzJKo7qO1-xQJ
Links:
🔗 p5.js editor: editor.p5js.org
🔗 Shaders Series Ep.4 Code: editor.p5js.org/pattvira/sketches/WQXm21NW2
References:
🔗 Cosine-based Palette:
🔗 @InigoQuilez 's article: iquilezles.org/articles/palettes
🔗 @InigoQuilez 's video explanation: youtube.com/shorts/TH3OTy5fTog
🔗 Interactive tool: apps.fenixfox-studios.com/cosine_palette
Timestamps:
0:00 Intro
0:11 Introduce mix() function
02:07 Change the blend ratio using uTime
03:09 Change the blend ratio using position
05:16 Change the blend ratio using shaping functions (step & smoothstep)
06:26 Change the blend ratio using shaping functions (distance functions)
09:28 Introduce cosine-based color palette
11:42 Bonus! Fractal!

