vertex.glsl 500 B

123456789101112131415161718192021222324
  1. #version 300 es
  2. in vec4 v_pos_in;
  3. in vec2 v_tex_in;
  4. in vec4 i_pos_in;
  5. in vec4 i_box_in; // offset, size
  6. in vec4 i_tex_in; // offset, size
  7. in vec4 i_color_in;
  8. out vec2 tex_vs;
  9. uniform mat4 mViewProj;
  10. void main() {
  11. tex_vs = i_tex_in.xy + (v_tex_in * i_tex_in.zw);
  12. // HACK: the /8 is due to missing scaling in the generator
  13. vec4 pos = vec4((i_box_in.xy/8.0) + (v_pos_in.xy * i_box_in.zw), v_pos_in.zw);
  14. gl_Position = mViewProj * (pos + i_pos_in);
  15. // gl_Position = mViewProj * (v_pos_in );
  16. }