fixed the multiple lights issue

This commit is contained in:
Tim Anema 2014-11-29 19:52:09 -05:00
parent 117d908ad7
commit 410388d423

View File

@ -130,7 +130,10 @@ function light:drawNormalShading(l,t,w,h,s, normalMap, shadowMap, canvas)
self.shadowShader:send("lightAngle", math.pi - self.angle / 2.0) self.shadowShader:send("lightAngle", math.pi - self.angle / 2.0)
self.shadowShader:send("lightDirection", self.direction) self.shadowShader:send("lightDirection", self.direction)
self.shadowShader:send("invert_normal", self.normalInvert == true) self.shadowShader:send("invert_normal", self.normalInvert == true)
util.drawCanvasToCanvas(normalMap, canvas, {shader = self.shadowShader}) util.drawCanvasToCanvas(normalMap, canvas, {
blendmode = 'additive',
shader = self.shadowShader
})
end end
end end