glsl-color
GLSL Color Operations
HSV ↔ RGB
// RGB to HSV
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
More from devallibus/shaderbase-skills
glsl-sdf
GLSL signed distance fields — 2D/3D primitives, boolean operations, ray marching. Use when creating geometric shapes, text effects, procedural geometry, or ray-marched scenes.
1glsl-noise
GLSL noise functions — hash, value, simplex, FBM, Voronoi, Worley. Use when generating procedural textures, terrain, organic patterns, or animated effects.
1glsl-math
GLSL math utilities — remap, smoothstep, easing, smoothmin, complex numbers, anti-aliasing helpers, constants. Use for interpolation, animation curves, or mathematical operations in shaders.
1glsl-coordinates
GLSL space transformations — rotation, polar/spherical, tiling, domain repetition. Use when manipulating coordinate spaces, creating patterns, or transforming geometry.
1shaderbase-manifest
Writing shader.json manifests for the ShaderBase registry — schema reference, capability profiles, uniforms, provenance tracking. Use when creating or editing ShaderBase shader packages.
1shaderbase-recipes
Writing Three.js and React Three Fiber integration recipes for ShaderBase shaders — factory functions, component patterns, placeholders, requirements. Use when creating shader integration code for the ShaderBase registry.
1