Skip to content

Instantly share code, notes, and snippets.

@XProger
Created November 27, 2015 08:59
Show Gist options
  • Select an option

  • Save XProger/8fcb51149a04bf6e7f26 to your computer and use it in GitHub Desktop.

Select an option

Save XProger/8fcb51149a04bf6e7f26 to your computer and use it in GitHub Desktop.
sort 3 floats
vec3 cuteSort(vec3 n) {
float a = min(min(n.x, n.y), n.z);
float b = max(max(n.x, n.y), n.z);
return vec3(a, n.x + n.y + n.z - a - b, b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment