Using shader in Love2D
Posted: Wed Oct 21, 2020 10:12 am
Hi !
For my current project I need to use a "glitch effect" shader. I found a few of them on a website called shadertoy, but I don't understand how to use them in Love2D.
I've used shaders before but they were all designed to work on Love2D in the first place, which is not the case here.
Usually I make a new shader using love.graphics.newShader () and then send a few variable the shader needs with shader:send () but I guess there are a few other things to do in order to make it work when the shader is not specifically designed for Love2D ?
An example of the kind of shader I want to use on my project : https://www.shadertoy.com/view/XtK3W3
(It uses a video but it can use a simple image - which is the way I plan to use it in my project)
Can someone please explain to me what I'm supposed to do in order to make a shader work if it's not designed to be used in Love2D in the first place ?
Maybe share an example of the kind of "conversion" I need to do in order to make it work properly ?
Thanks for your help
For my current project I need to use a "glitch effect" shader. I found a few of them on a website called shadertoy, but I don't understand how to use them in Love2D.
I've used shaders before but they were all designed to work on Love2D in the first place, which is not the case here.
Usually I make a new shader using love.graphics.newShader () and then send a few variable the shader needs with shader:send () but I guess there are a few other things to do in order to make it work when the shader is not specifically designed for Love2D ?
An example of the kind of shader I want to use on my project : https://www.shadertoy.com/view/XtK3W3
(It uses a video but it can use a simple image - which is the way I plan to use it in my project)
Can someone please explain to me what I'm supposed to do in order to make a shader work if it's not designed to be used in Love2D in the first place ?
Maybe share an example of the kind of "conversion" I need to do in order to make it work properly ?
Thanks for your help