Quads and Shader
Posted: Tue Feb 02, 2016 8:29 pm
A shader applied to a fragment of an image defined by a quad ends up being being applied to the original image, not the fragment.
Is there a way to apply the shader directly to the quad fragment and not to the source image?
Right now, I'm forced to create a canvas from the quad and then apply the shader to the canvas.
In love.update
and in love.draw
This seems very inefficient???
Is there a way to apply the shader directly to the quad fragment and not to the source image?
Right now, I'm forced to create a canvas from the quad and then apply the shader to the canvas.
In love.update
Code: Select all
num=num<#quad and num+1 or 1
love.graphics.setCanvas(canvas)
love.graphics.clear()
love.graphics.draw(image,quad[num])
love.graphics.setCanvas()
Code: Select all
love.graphics.setShader( shade )
love.graphics.draw(canvas,screen.w/2,screen.h/2,0,1,1,canvas:getWigth()/2,canvas:getHeight())
love.graphics.setShader()