Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

QInoix

3
Posts
A member registered Jun 21, 2024

Recent community posts

(2 edits)

Hi again! I was able to fix this issue with help from github (the issue).

Turns out, on some gpus the bias in texture2D defaults to a bad value. You would need to add u_lod_bias

uniform float u_lod_bias;

to the variables and to the texture2D function:

texture2D(tex0, v_tex_coord,u_lod_bias);

(21 edits)

It's okay, don't rush it, I found a solution for me (mentioned in the edit above, setting color to gl_FragColor). Thanks for your response.
Here is the sprite link, though, as it turned out it doesn't matter really.

I've made a sample project to show it off link. I did it here with a standart sprite from "The Question", which is 500x700, so resolution isn't the problem, I guess.

And sadly no, setting v_tex_coord to a_tex_coord doesn't help. Really, it seems like a problem with renpy? I will open an issue on github some days later if we will not figure out the cause.

I also thought that it maybe show like that only when redacting the game project, but no, it is the same when the game is build, so it is either a problem with the shader (somehow?), renpy or my gpu (probably not, but would be nice to know if it's the same on your pc, there's always a chance, it is AMD by the way).

Update: just asked my friend has an Nvidia 1060 and it looks okay on his pc, I have an RX 6600 and it looks blurry...

Update2: opened an issue on Github link

(3 edits)

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.