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?
- Thanks
Applying a textured overlay
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- DeltaF1
- Citizen
- Posts: 64
- Joined: Mon Apr 27, 2015 4:12 pm
- Location: The Bottom of the Stack
- Contact:
Re: Applying a textured overlay
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]?
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Applying a textured overlay
You can also use a shader to give the look you want.
-
- Prole
- Posts: 2
- Joined: Tue Oct 20, 2015 8:45 pm
Re: Applying a textured overlay
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'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)
Re: Applying a textured overlay
I did something like this for my ludum dare 32
http://evine.itch.io/iamtrojanhorse
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.
http://evine.itch.io/iamtrojanhorse
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.
Artal, A .PSD loader: https://github.com/EvineDev/Artal
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Applying a textured overlay
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.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.
Re: Applying a textured overlay
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.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 7 guests