Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. attribute vec4 a_position;
  2. attribute int a_color;
  3. attribute vec2 a_texCoord0;
  4. uniform mat4 u_projTrans;
  5. varying vec4 v_color;
  6. varying vec2 v_texCoords;
  7.  
  8. void main()
  9. {
  10.    int ir, ig, ib, ia;
  11.    ir = mod(a_color, 16);
  12.    ig = mod((a_color / 16), 16);
  13.    ib = mod((a_color / (16 * 16)), 16);
  14.    ia = mod((a_color / (16 * 16 * 16)), 16);
  15.    v_color = vec4(float(ir)/15.0, float(ig)/15.0, float(ib)/15.0, 1.0);
  16.    v_color.a = v_color.a * (16.0/15.0);
  17.    v_texCoords = a_texCoord0;
  18.    gl_Position =  u_projTrans * a_position;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement