From 5432b278f8ed8c9aaeccf1ee7a4da540787f965d Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Thu, 12 May 2016 08:03:57 -0400 Subject: RENDERING --- shaders/new.frag | 6 +++--- shaders/new.vert | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'shaders') diff --git a/shaders/new.frag b/shaders/new.frag index 8812d72..fa8a260 100644 --- a/shaders/new.frag +++ b/shaders/new.frag @@ -1,9 +1,9 @@ uniform sampler2D sampler; varying vec2 texCoord; -varying float join; +varying vec4 color; void main(){ - vec4 color = texture2D(sampler, vec2(texCoord.x, texCoord.y)); - gl_FragColor = color; + vec4 pixelColor = texture2D(sampler, vec2(texCoord.x, texCoord.y)); + gl_FragColor = pixelColor * color; } diff --git a/shaders/new.vert b/shaders/new.vert index 1bedfd3..b2fcba4 100644 --- a/shaders/new.vert +++ b/shaders/new.vert @@ -2,10 +2,13 @@ attribute vec3 coord2d; attribute vec2 tex_coord; uniform mat4 ortho; +uniform vec4 tex_color; varying vec2 texCoord; +varying vec4 color; void main(){ texCoord = tex_coord; + color = tex_color; gl_Position = ortho * vec4(coord2d.xyz, 1.0); } -- cgit v1.2.3