diff --git a/examples/short.lua b/examples/short.lua index c238cba..ada3dc8 100644 --- a/examples/short.lua +++ b/examples/short.lua @@ -18,11 +18,7 @@ function love.load() glow = love.graphics.newImage("examples/gfx/machine2_glow.png") -- create light world - lightWorld = LightWorld({ - ambient = {55,55,55}, - refractionStrength = 32.0, - reflectionVisibility = 0.75, - }) + lightWorld = LightWorld({ambient = {55,55,55}}) -- create light lightMouse = lightWorld:newLight(0, 0, 255, 127, 63, 300) @@ -43,10 +39,6 @@ function love.load() imageTest:setNormalMap(image_normal) imageTest:setGlowMap(glow) imageTest:setOffset(12, -10) - - -- create body object - objectTest = lightWorld:newRefraction(normal, 64, 64, 128, 128) - objectTest:setReflection(true) end function love.keypressed(k) diff --git a/lib/init.lua b/lib/init.lua index 74a1912..09619ac 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -76,7 +76,6 @@ function light_world:refreshScreenSize(w, h) self.glowMap = love.graphics.newCanvas(w, h) self.glowMap2 = love.graphics.newCanvas(w, h) self.refractionMap = love.graphics.newCanvas(w, h) - self.refractionMap2 = love.graphics.newCanvas(w, h) self.reflectionMap = love.graphics.newCanvas(w, h) self.reflectionMap2 = love.graphics.newCanvas(w, h) @@ -220,8 +219,7 @@ function light_world:drawRefraction(l,t,w,h,s) end end) - util.drawCanvasToCanvas(self.render_buffer, self.refractionMap2) - self.refractionShader:send("backBuffer", self.refractionMap2) + self.refractionShader:send("backBuffer", self.render_buffer) self.refractionShader:send("refractionStrength", self.refractionStrength) util.drawCanvasToCanvas(self.refractionMap, self.render_buffer, {shader = self.refractionShader}) end @@ -238,8 +236,7 @@ function light_world:drawReflection(l,t,w,h,s) end end) - util.drawCanvasToCanvas(self.render_buffer, self.reflectionMap2) - self.reflectionShader:send("backBuffer", self.reflectionMap2) + self.reflectionShader:send("backBuffer", self.render_buffer) self.reflectionShader:send("reflectionStrength", self.reflectionStrength) self.reflectionShader:send("reflectionVisibility", self.reflectionVisibility) util.drawCanvasToCanvas(self.reflectionMap, self.render_buffer, {shader = self.reflectionShader})