Guest User

Untitled

a guest
Oct 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #version 150
  2.  
  3. attribute vec3 gpu_Vertex;
  4. attribute vec2 gpu_TexCoord;
  5. attribute vec4 gpu_Color;
  6. uniform mat4 gpu_ModelViewProjectionMatrix;
  7.  
  8. varying vec4 color;
  9. varying vec2 texCoord;
  10.  
  11. void main (void) {
  12.  
  13. color = gpu_Color;
  14. texCoord = vec2 (gpu_TexCoord);
  15.  
  16. gl_Position = gpu_ModelViewProjectionMatrix * vec4 (gpu_Vertex, 1.0);
  17.  
  18. }
  19.  
  20. #version 150
  21.  
  22. varying vec4 color;
  23. varying vec2 texCoord;
  24.  
  25. uniform sampler2D tex;
  26.  
  27. void main (void) {
  28.  
  29. gl_FragColor = texture (tex, texCoord);
  30.  
  31. }
  32.  
  33. #version 150
  34.  
  35. varying vec4 color;
  36. varying vec2 texCoord;
  37. varying float healthFloat;
  38.  
  39. uniform sampler2D tex;
  40. uniform float health;
  41.  
  42. void main (void) {
  43.  
  44. vec4 texColor = texture (tex, texCoord);
  45.  
  46. if (texColor.x <= health) {
  47.  
  48. texColor = vec4 (1.0, 0.0, 0.0, 0.8);
  49.  
  50. } else {
  51.  
  52. texColor = vec4 (0.0, 0.0, 0.0, 0.0);
  53.  
  54. }
  55.  
  56. gl_FragColor = texColor;
  57.  
  58. }
Add Comment
Please, Sign In to add comment