Skip to content

Instantly share code, notes, and snippets.

@Kerollmops
Created May 26, 2015 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kerollmops/cbb13f9f48a25dd07c68 to your computer and use it in GitHub Desktop.
Save Kerollmops/cbb13f9f48a25dd07c68 to your computer and use it in GitHub Desktop.
vecteur texture
vec3 vec111 = normalize(vec3(1, 1, 1));
vec3 dist = vec3( abs(vert_normal_model.x - vec111.x),
abs(vert_normal_model.y - vec111.y),
abs(vert_normal_model.z - vec111.z));
if (dist.z < dist.x && dist.z < dist.y) {
uv = vec2(vp_model.x, vp_model.y);
}
else if (dist.y < dist.x && dist.y < dist.z) {
uv = vec2(vp_model.x, vp_model.z);
}
else {
uv = vec2(vp_model.y, vp_model.z);
}
uv *= scale_ratio;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment