Hi! Thank you very much for your shaders, they've been very helpful.
For some reason SimulatedLighting looks pixelated on my sprite ( link ). I've done some digging and it seems like
vec4 color = texture2D(tex0, uv);
is the problem. If I just set the gl_FragColor to color (literally gl_FragColor = color; ) it still is pixelated, just without the shader effect (obviously).
I am not sure what is the problem, but my sprites have quite a large resolution (though, changing it from 2000x1000 to 1000x500 didn't really help), so maybe resolution is the problem??? Renpy sometimes works in strange ways when sprites are too big. Or maybe (probably) it's something else, I don't know.
Well, anyway, I've found a solution. the color variable is only used in calculating the final color, so I just replaced the final line in the fragment shader to this:
gl_FragColor.rgb += fill_light_contribution + back_light_contribution + key_light_contribution;
And it looks ok ( link ), though, there are no alpha channel in it, but it works for me I guess ¯\_(ツ)_/¯.
Just wanted to leave it here in case anyone else has any similar problems, thanks again.
UPD: Just found an even better way to fix it!
Just change the color definition to:
vec4 color = gl_FragColor;
and it seems to work! Suprisingly simple, I guess, renpy doesn't like texture2D function? Anyway, it should (haven't checked) even work with the alpha channel now. Good luck.