ccShader_PositionColorLengthTexture.vert 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Copyright (c) 2012 Scott Lembcke and Howling Moon Software
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to deal
  5. * in the Software without restriction, including without limitation the rights
  6. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. * copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in
  11. * all copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  19. * SOFTWARE.
  20. */
  21. const char* ccPositionColorLengthTexture_vert = R"(
  22. #ifdef GL_ES
  23. precision lowp float;
  24. #endif
  25. #ifdef GL_ES
  26. attribute mediump vec4 a_position;
  27. attribute mediump vec2 a_texcoord;
  28. attribute mediump vec4 a_color;
  29. varying mediump vec4 v_color;
  30. varying mediump vec2 v_texcoord;
  31. #else
  32. attribute vec4 a_position;
  33. attribute vec2 a_texcoord;
  34. attribute vec4 a_color;
  35. varying vec4 v_color;
  36. varying vec2 v_texcoord;
  37. #endif
  38. uniform float u_alpha;
  39. void main()
  40. {
  41. v_color = vec4(a_color.rgb * a_color.a * u_alpha, a_color.a * u_alpha);
  42. v_texcoord = a_texcoord;
  43. gl_Position = CC_MVPMatrix * a_position;
  44. }
  45. )";