diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2016-05-13 12:48:11 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2016-05-13 12:48:11 -0400 |
commit | 23f3b1471b2bbfe92252456f32c9ae55a9d1f213 (patch) | |
tree | 97f520b944aaa699854b745e182911615ce10c02 /shaders | |
parent | 0e24afb4cd060701348398b16f2b1d89b8935b81 (diff) |
Things flash red when hit
Diffstat (limited to 'shaders')
-rw-r--r-- | shaders/world.frag | 7 | ||||
-rw-r--r-- | shaders/world.vert | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/shaders/world.frag b/shaders/world.frag index c45b4a0..80af175 100644 --- a/shaders/world.frag +++ b/shaders/world.frag @@ -1,10 +1,11 @@ uniform sampler2D sampler; varying vec2 texCoord; +varying vec4 color; void main(){ - vec4 color = texture2D(sampler, vec2(texCoord.x, 1-texCoord.y)); - if(color.a <= .1) + vec4 pixTex = texture2D(sampler, vec2(texCoord.x, 1-texCoord.y)); + if(pixTex.a <= .1) discard; - gl_FragColor = color; + gl_FragColor = pixTex * color; } diff --git a/shaders/world.vert b/shaders/world.vert index 1bedfd3..ce7fa5a 100644 --- a/shaders/world.vert +++ b/shaders/world.vert @@ -1,11 +1,14 @@ attribute vec3 coord2d; attribute vec2 tex_coord; +uniform vec4 tex_color; uniform mat4 ortho; varying vec2 texCoord; +varying vec4 color; void main(){ + color = tex_color; texCoord = tex_coord; gl_Position = ortho * vec4(coord2d.xyz, 1.0); } |