shader_type spatial; uniform float saturation : hint_range(0., 1.) = 0.8; uniform float value : hint_range(0., 1.) = 0.8; float random (vec2 st) { return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123); } const vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); vec3 hsv2rgb(vec3 c) { vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); } void vertex() { float hue = random(vec2(float(INSTANCE_ID))); COLOR = vec4(hsv2rgb(vec3(hue, saturation, value)), 1.0); } void fragment() { ALBEDO = COLOR.rgb; }
or share this direct link: