Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version 150
- attribute vec3 gpu_Vertex;
- attribute vec2 gpu_TexCoord;
- attribute vec4 gpu_Color;
- uniform mat4 gpu_ModelViewProjectionMatrix;
- varying vec4 color;
- varying vec2 texCoord;
- void main (void) {
- color = gpu_Color;
- texCoord = vec2 (gpu_TexCoord);
- gl_Position = gpu_ModelViewProjectionMatrix * vec4 (gpu_Vertex, 1.0);
- }
- #version 150
- varying vec4 color;
- varying vec2 texCoord;
- uniform sampler2D tex;
- void main (void) {
- gl_FragColor = texture (tex, texCoord);
- }
- #version 150
- varying vec4 color;
- varying vec2 texCoord;
- varying float healthFloat;
- uniform sampler2D tex;
- uniform float health;
- void main (void) {
- vec4 texColor = texture (tex, texCoord);
- if (texColor.x <= health) {
- texColor = vec4 (1.0, 0.0, 0.0, 0.8);
- } else {
- texColor = vec4 (0.0, 0.0, 0.0, 0.0);
- }
- gl_FragColor = texColor;
- }
Add Comment
Please, Sign In to add comment