swizzle.frag 895 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #version 110
  2. uniform float blend;
  3. uniform vec4 u;
  4. uniform bool p;
  5. varying vec2 t;
  6. void main()
  7. {
  8. float blendscale = 1.789;
  9. vec4 w = u;
  10. vec4 w_undef; // test undef
  11. vec4 w_dep = u; // test dependent swizzles
  12. vec4 w_reorder = u; // test reordering
  13. vec4 w2 = u;
  14. vec4 w_flow = u; // test flowControl
  15. w_reorder.z = blendscale;
  16. w.wy = t;
  17. w_reorder.x = blendscale;
  18. w2.xyzw = u.zwxy;
  19. w_reorder.y = blendscale;
  20. w_dep.xy = w2.xz;
  21. w_dep.zw = t;
  22. w_undef.xy = u.zw;
  23. if (p)
  24. w_flow.x = t.x;
  25. else
  26. w_flow.x = t.y;
  27. gl_FragColor = mix(w_reorder, w_undef, w * w2 * w_dep * w_flow);
  28. vec2 c = t;
  29. vec4 rep = vec4(0.0, 0.0, 0.0, 1.0);
  30. if (c.x < 0.0)
  31. c.x *= -1.0;
  32. if (c.x <= 1.0)
  33. rep.x = 3.4;
  34. gl_FragColor += rep;
  35. }