/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl

https://bitbucket.org/lindenlab/viewer-beta/ · GLSL · 50 lines · 20 code · 6 blank · 24 comment · 0 complexity · 5cc103ec13f5abae259b25a092b1ad39 MD5 · raw file

  1. /**
  2. * @file pickAvatarV.glsl
  3. *
  4. * $LicenseInfo:firstyear=2007&license=viewerlgpl$
  5. * Second Life Viewer Source Code
  6. * Copyright (C) 2007, Linden Research, Inc.
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation;
  11. * version 2.1 of the License only.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  23. * $/LicenseInfo$
  24. */
  25. uniform mat4 projection_matrix;
  26. ATTRIBUTE vec3 position;
  27. ATTRIBUTE vec4 diffuse_color;
  28. ATTRIBUTE vec2 texcoord0;
  29. VARYING vec4 vertex_color;
  30. VARYING vec2 vary_texcoord0;
  31. mat4 getSkinnedTransform();
  32. void main()
  33. {
  34. vec4 pos;
  35. vec4 pos_in = vec4(position, 1.0);
  36. mat4 trans = getSkinnedTransform();
  37. pos.x = dot(trans[0], pos_in);
  38. pos.y = dot(trans[1], pos_in);
  39. pos.z = dot(trans[2], pos_in);
  40. pos.w = 1.0;
  41. vertex_color = diffuse_color;
  42. vary_texcoord0 = texcoord0;
  43. gl_Position = projection_matrix * pos;
  44. }