Page 1 of 1

[Solved] Help with shaders in 11.3

Posted: Sun Apr 19, 2020 9:25 pm
by alberto_lara
Hi guys, it's been a while since I used LÖVE and I know that for recent versions some changes affected, among other things, how shaders work/are used but I've been looking at this section of the forum, looking at the docs and even googling for solutions, with no luck so far on finding the trick to make this work.

I'm getting this error:
Image

when using this shader

I know this shader works because I used it with a game I was creating for 0.10.2 (and never finished it)

Thanks in advance.

Re: Help with shaders in 11.3

Posted: Tue Apr 21, 2020 10:14 pm
by pgimeno
_tex0_ seems to be an internal uniform variable that is now gone. No idea what it meant, but the shader credits slime so maybe he knows.

Re: Help with shaders in 11.3

Posted: Thu Apr 23, 2020 9:11 am
by nameless tee
Looks like the name of _tex0_ changed. Adding the following line did the trick:

Code: Select all

uniform vec2 inputSize;
uniform vec2 outputSize;
uniform vec2 textureSize;

#define _tex0_ MainTex // <-

#define SCANLINES
I just took a guess at what inputs the shader needs to get something to show up on the screen, so the way I'm using the shader is probably not correct.
screenshot.png
screenshot.png (621.97 KiB) Viewed 2855 times
EDIT: Forgot to mention that the use of "extern" is deprecated. That's why I changed it to "uniform".

Re: Help with shaders in 11.3

Posted: Sat Apr 25, 2020 1:22 am
by alberto_lara

Code: Select all

#define _tex0_ MainTex
did the trick, thanks a lot!