This post by Nikolaos Papadopoulos explains how to create a custom Three.js shader that simulates the iridescent, sparkling effect of foil stickers. Commonly seen on collectible stickers and premium packaging, this effect combines angle-dependent iridescence and metallic foil flakes rendered in real time in the browser. Iridescence: The shimmering rainbow colors arise in nature from thin-film interference, where light waves reinforce or cancel based on viewing angle. The shader approximates this by mapping view angle to hue, causing smooth color shifts as the surface tilts relative to the camera, giving a dynamic “alive” look. Foil flakes: Metallic foil surfaces contain tiny reflective particles that create random glimmering highlights. The shader uses procedural noise to generate random bright patches on the surface, which when lit, appear as sparkling flakes. This adds tactile realism without costly rendering techniques. Implementation details: The effect is achieved with vertex and fragment shaders in Three.js. The vertex shader applies peel geometry deformation using Rodrigues’ rotation formula, simulating the sticker being peeled at an angle. It calculates ambient occlusion-like shading based on vertex displacement. The fragment shader combines multiple effects: - Alpha cutoff for transparency - Back-face shading to render the sticker’s rear side - Procedural foil flakes generated using noise and perturbed normals - Iridescence simulated with sine waves affecting hue based on view angle - Environment map reflections modulated by Fresnel terms - Final color blend including diffuse base color, reflections, iridescence, and foil flakes A live demo is embedded for users to interactively adjust parameters and observe the shader’s response to rotation and lighting. Code licensing: The shader code is available under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0). Non-commercial sharing and adaptation is encouraged with attribution; commercial use requires contacting the author for licensing. The post includes full vertex and fragment shader GLSL source code with detailed explanations of uniforms, variables, and mathematical formulas such as Rodrigues’ rotation and environment sampling. The author invites support via GitHub Sponsors to continue creating tutorials and open-source experiments.