opengl - GLSL: Subtract minimal element in vec3 from all elements -
glsl version 430 or higher. want subtract smallest value in vec3 vec3 itself, fast possible. example: using operation on vec3(1.3,0.3,1), should result in vec3(1,0,0.7).
my current solution is: a-=min(min(a.x,a.y),a.z);
this main operation in tight loop, performance benefit helps. there tricks missed?
Comments
Post a Comment