2
0

vs_tree.sc 569 B

12345678910111213141516171819202122232425
  1. $input a_position, a_normal, a_texcoord0
  2. $output v_pos, v_view, v_normal, v_texcoord0
  3. /*
  4. * Copyright 2013 Milos Tosic. All rights reserved.
  5. * License: http://www.opensource.org/licenses/BSD-2-Clause
  6. */
  7. #include "../common/common.sh"
  8. uniform float u_time;
  9. void main()
  10. {
  11. vec3 pos = a_position;
  12. vec3 normal = a_normal.xyz*2.0 - 1.0;
  13. gl_Position = mul(u_modelViewProj, vec4(pos, 1.0) );
  14. v_pos = gl_Position.xyz/gl_Position.w;
  15. v_view = mul(u_modelView, vec4(pos, 1.0) ).xyz;
  16. v_normal = mul(u_modelView, vec4(normal, 0.0) ).xyz;
  17. v_texcoord0 = a_texcoord0;
  18. }