Hi, i'm new to Love2D and so far i'm enjoying it. I'm wanting to apply a textured overlay onto the game, for example making it look like the game sprites are made of fabric. I know I could just do this when I make the texture but i'm wanting to keep the texture static and making it look like the sprites are moving along it while being textured by it.
Is anyone able to point me into the right direction on how I can achieve this?
Maybe i'm misunderstanding what effect you want, but can't you just draw the texture slightly transparently over the whole screen? If you want the texture to only show through, maybe you should look into [wiki]love.graphics.setStencil[/wiki]?
Yea, I think a stencil will work but i've yet to be able to get the effect i'm looking for.
I've made a gif to better explain what i'm trying to do. I'm honestly not sure how to do it.
(My guess is something with stencils and shaders but other than that I don't know how to actually do it)
I basically just have a large "image/texture" drawn over the entire screen.
The texture was converted to black/white and then converted that to black/transparent.
Defender Vex wrote:i'm wanting to keep the texture static and making it look like the sprites are moving along it while being textured by it.
You might be able to get away with just drawing a fabric image (potentially with low opacity) after everything else, making sure it covers the entire screen. If the image is smaller than the screen you could use a [wiki]Quad[/wiki] and the 'repeat' [wiki]WrapMode[/wiki] to make it tile across the screen.
Silly performance question. Do people think it would be quicker to do 2x overdraw, or to draw everything once using a more complex combo blend pixel shader that takes a 'pattern' texture as a parameter? I know it largely depends on device, but I'm still interested.