just renaming some things

This commit is contained in:
Tim Anema 2014-11-29 08:54:43 -05:00
parent 993e029a2f
commit aa3675d7ad
3 changed files with 20 additions and 20 deletions

View File

@ -5,7 +5,7 @@ local util = require(_PACKAGE..'/util')
local light = class()
light.shader = love.graphics.newShader(_PACKAGE.."/shaders/poly_shadow.glsl")
light.shineShader = love.graphics.newShader(_PACKAGE.."/shaders/shine.glsl")
light.normalShader = love.graphics.newShader(_PACKAGE.."/shaders/normal.glsl")
function light:init(x, y, r, g, b, range)
@ -142,14 +142,14 @@ function light:drawShadow(l,t,w,h,s,bodies, canvas)
self.shadow:clear()
util.drawto(self.shadow, l, t, s, function()
self.shader:send("lightPosition", {(self.x + l/s) * s, (h/s - (self.y + t/s)) * s, (self.z * 10)/255.0})
self.shader:send("lightRange", self.range*s)
self.shader:send("lightColor", {self.red / 255.0, self.green / 255.0, self.blue / 255.0})
self.shader:send("lightSmooth", self.smooth)
self.shader:send("lightGlow", {1.0 - self.glowSize, self.glowStrength})
self.shader:send("lightAngle", math.pi - self.angle / 2.0)
self.shader:send("lightDirection", self.direction)
love.graphics.setShader(self.shader)
self.shineShader:send("lightPosition", {(self.x + l/s) * s, (h/s - (self.y + t/s)) * s, (self.z * 10)/255.0})
self.shineShader:send("lightRange", self.range*s)
self.shineShader:send("lightColor", {self.red / 255.0, self.green / 255.0, self.blue / 255.0})
self.shineShader:send("lightSmooth", self.smooth)
self.shineShader:send("lightGlow", {1.0 - self.glowSize, self.glowStrength})
self.shineShader:send("lightAngle", math.pi - self.angle / 2.0)
self.shineShader:send("lightDirection", self.direction)
love.graphics.setShader(self.shineShader)
love.graphics.setInvertedStencil(stencils.shadow(shadow_geometry, bodies))
love.graphics.setBlendMode("additive")
love.graphics.rectangle("fill", -l/s,-t/s,w/s,h/s)
@ -187,7 +187,7 @@ function light:drawShine(l,t,w,h,s,bodies,canvas)
--update shine
self.shine:clear(255, 255, 255)
util.drawto(self.shine, l, t, s, function()
love.graphics.setShader(self.shader)
love.graphics.setShader(self.shineShader)
love.graphics.setBlendMode("alpha")
love.graphics.setStencil(stencils.shine(bodies))
love.graphics.rectangle("fill", -l/s,-t/s,w/s,h/s)