Best way to detect if vec3 is between vec3(x) and vec3(y) in glsl
- by elect
As titled
I am sampling from a texture and if the color is somehow gray [vec3(.8), vec3(.9)] and an uniform is 1 I need to substitute that color with another one
I am not a glsl veteran but I am pretty sure there is a more elegant and compact (without mentioning faster) way than this:
vec3 textureColor = texture(texture0, oUV);
if(settings.w == 1 && textureColor.r > .8 && textureColor.r < .9
&& textureColor.g > .8 && textureColor.g < .9
&& textureColor.b > .8 && textureColor.b < .9)