kokoko3k / koko-aio-slang

Multi purpose crt shader for retroarch
GNU General Public License v3.0
57 stars 2 forks source link

All shaders don't line up correctly with Integer Overscale/Corrupted-looking #11

Closed outlandernwah closed 1 week ago

outlandernwah commented 2 weeks ago

Hi there kokoko! These shaders are awesome! I have noticed however that the scanlines don't line up correctly with Oversccale set. It seems fine on Integer Scaling set to on but then the window size is extremely small. When putting Overscale on, the shader ends up looking highly corrupted.

I'm on a 1080p screen on an Odin 2.

Please let me know if you have any ideas.

kokoko3k commented 2 weeks ago

Hi there! Thank you for reporting, I need some info: What version of the shader? What core and what preset are you using? Can you paste it here?

outlandernwah commented 2 weeks ago

Hi there!

What core and what preset are you using? Can you paste it here?

This happens with every preset and every core. But for instance, SwanStation, SNES9x, Flycast, Genesis Plus GX are a few I use day to day!

kokoko3k commented 2 weeks ago

So you just load the preset and activate integer overscaling?

What koko aio version?

outlandernwah commented 2 weeks ago

So you just load the preset and activate integer overscaling?

What koko aio version?

Yep. That's exactly right. I've tried it with the ones that come with Retroarch after updating Shaders, and the latest you have on GitHub (1.9?). I even tried 3.5 and it's the same deal.

kokoko3k commented 2 weeks ago

Since integer scaling requires the lines to snap perfectly to the screen lines, there are a few settings that interfree with integer scaling (and overcaling):

Luminosity tied zoom: (auto turned off in the very latest dev version) It zooms the image depending on the image luminance, so it have to be turned off.

Autocrop (auto turned off in the very latest dev version): Again, it zooms the image to crop black borders.

Curvature: If the image is curved, it cannot snap.

Can you please try with them off?

If even doing that doesn't solve the issue, I'd really need a screenshot (not a photo) and the preset you're using.

outlandernwah commented 1 week ago

Since integer scaling requires the lines to snap perfectly to the screen lines, there are a few settings that interfree with integer scaling (and overcaling):

Luminosity tied zoom: (auto turned off in the very latest dev version) It zooms the image depending on the image luminance, so it have to be turned off.

Autocrop (auto turned off in the very latest dev version): Again, it zooms the image to crop black borders.

Curvature: If the image is curved, it cannot snap.

Can you please try with them off?

If even doing that doesn't solve the issue, I'd really need a screenshot (not a photo) and the preset you're using.

Hi there! So I tested the latest dev version and the one that comes with RA with those features off and this is what it looks like with int. scaling and overscale on: Screenshot_20241001-170523

Edit* that's what it looks like on every preset I've tried. I must have gone thru all of them lol

kokoko3k commented 1 week ago

Looks like scanlines snaps correctly, but something weird is happening to the mask instead; the diagonal line smells like a classic rounding error and I'd really like to reproduce this;

Does it happen with all cores?

What is the core used on the screenshot?

Is integer scaling parameter set to 1 or 2?

Can you please try do alter "sharp hack through offset" parameter to something higher than 0 and see if it solves the issue? is near/down integer scaling option.

outlandernwah commented 1 week ago

Looks like scanlines snaps correctly, but something weird is happening to the mask instead; the diagonal line smells like a classic rounding error and I'd really like to reproduce this;

Does it happen with all cores?

What is the core used on the screenshot?

Is integer scaling parameter set to 1 or 2?

Can you please try do alter "sharp hack through offset" parameter to something higher than 0 and see if it solves the issue? is near/down integer scaling option.

I am using SNES9x on that screenshot. Integer Scale is set to 0 in the shader settings (under Override comment geom...) Setting it to 1 or 2 doesn't change anything to my eyes. Sharp hack setting to 1, 50, and 100 also no difference.

This does seem to happen on most cores. I just did some testing.

It happens with Genesis Plus GX for Genesis, but it does not happen with that core with lower resolution consoles (Game Gear, Master System).

It also occurs on PS1 with SwanStation.

Maybe that can be of help to you.

Also, thanks again for working with me here!

Edit* Also it seems to work fine with 2600 using Stella. It looks like the lower res systems are okay. Just a guess tho.

kokoko3k commented 1 week ago

Wait, integer overscale is supposed to work WITH integer scaling set to 1 or 2.

Is your snes9x set to upscale the image?

It would be really help helpful if you could save the modified preset and paste it to me.

outlandernwah commented 1 week ago

Wait, integer overscale is supposed to work WITH integer scaling set to 1 or 2.

Where is that setting exactly? Maybe I missed it.

kokoko3k commented 1 week ago

Just read you already tried it; i've updated my comment, requesting more infos.

outlandernwah commented 1 week ago

Just read you already tried it; i've updated my comment, requesting more infos.

Ah. I see. Yeah this happens with a fresh preset as well. I should have mentioned that. I tried one from 1.9.30>Presets 4.1>monitor bloom bezel wider

The image is not being upscaled to my knowledge.

kokoko3k commented 1 week ago

does it work on pc?

odin2 is android, rigjt?

outlandernwah commented 1 week ago

does it work on pc?

odin2 is android, rigjt?

Odin 2 is Android, yeah. Android 13 to be exact! I have not tested on PC yet tho I was going to but thought maybe it was a known issue so came here to see what was up first lol

kokoko3k commented 1 week ago

not at all, unfortinately...

kokoko3k commented 1 week ago

I understand it is not easy with android, but if you could send me a complete frontend and core log with level set to "debug" (not info like in the screenshot), I can inspect it.

Screenshot_20241002-070012_KetroArkk

edit

just to be clear, the title topic is wrong, in the sense that overscaling or not, the issue is present?

Or you tried to set overscale without integer scaling?

...or even vanilla presets look like that?

I'm starting to be a bit lost.

outlandernwah commented 1 week ago

I understand it is not easy with android, but if you could send me a complete frontend and core log with level set to "debug" (not info like in the screenshot), I can inspect it.

Screenshot_20241002-070012_KetroArkk

edit

just to be clear, the title topic is wrong, in the sense that overscaling or not, the issue is present?

This only happens with both Overscale (and integer scaling) set to on at the same time under Settings>Video>Scaling.

I can def. send you a log sometime tomorrow!

Things look mostly fine without Overscale. The reason I was testing this out is I was trying to get rid of moire patterns which I figured that would do as they don't show up with just Integer Scaling on. But then everything is too small lol

Edit* Overscale without setting Integer Scale to On has no effect on anything in general.

kokoko3k commented 1 week ago

This only happens with both Overscale (and integer scaling) set to on at the same time under Settings>Video>Scaling.

I am using SNES9x on that screenshot. Integer Scale is set to 0 in the shader settings (under Override comment geom...) Setting it to 1 or 2 doesn't change anything to my eyes. Sharp hack setting to 1, 50, and 100 also no difference.

Ah. I see. Yeah this happens with a fresh preset as well. I should have mentioned that.

Could you please make a sense on that statements? I find them in contraddiction!

Could it be a language barrier or me early in the morning, but just to be sure, if you could send me a problematic preset (load the preset, tweak if needed to reproduce the problem, save it, send it) alongside the logs, it would be better ;)

edit2 also, somehow the game screenshot you posted is not centered on the screen

edit3

are we talking aboutnshader settings when it comes to integer scale/overscale, not retroarch settings, right?

kokoko3k commented 1 week ago

Sanity check because your image looked shifted:

Does your retroarch settings look like this (aspect ratio set to full, not custom)?

Screenshot_20241002_080103

outlandernwah commented 1 week ago

Sanity check because your image looked shifted:

Does your retroarch settings look like this (aspect ratio set to full, not custom)?

Screenshot_20241002_080103

Good eye!!! Yep. When setting Overscale to on the picture gets slightly shifted to the right. When it off, it's fine and centered. Weird. I have it set to Full btw like the ReadMe file says :)

And yeah, sorry it's late here (NYC). I will try and provide you more tomorrow.

outlandernwah commented 1 week ago

Hi there! So this looks like it may be a bug in RA itself. When setting Overscale on, the picture shifts to the right. (Good catch once again!) However, this can be fixed by setting Viewport Archor Bias X and Viewport Anchor Bias Y to 1.00. By default it's at .50

Hopefully that helps you out! Also, is there any way to get rid of the moire patterns? I thought Overscale would fix it but I still see them on most presets, especially anything that uses scanlines horizontally.

kokoko3k commented 1 week ago

Indeed moire should be gone.

I think there is something weird going on on your setup; I'd trywith a vanilla config, from scratch (you can backup first)

outlandernwah commented 1 week ago

Indeed moire should be gone.

I think there is something weird going on on your setup; I'd trywith a vanilla config, from scratch (you can backup first)

So, interesting results. I installed RA on my phone (Google Pixel 7) from scratch as a test and Overscale works there with no moire! However, I deleted Retroarch completely from my Odin 2 and started from scratch and set it up just the same as my phone and yeah, the moire pattern is still there even with the same exact settings as my phone. So I'm not sure what's up.

I'm thinking it's because my Pixel 7 has a 1080 x 2400 screen and the Odin 2 is 1920 x 1080. What do you think?

kokoko3k commented 1 week ago

If scanlines snaps to screen pixel, no moire will be observed, but moire happens when the screen is curved, usually. Which as said, is not compatible with integer scaling.

If you observe moire without curvature, integer scaling is not working, that's for sure, this does NOT depend on resolution.

Higher resolutions mitigates moire when integer scaling does not work tho.

outlandernwah commented 1 week ago

If scanlines snaps to screen pixel, no moire will be observed, but moire happens when the screen is curved, usually. Which as said, is not compatible with integer scaling.

If you observe moire without curvature, integer scaling is not working, that's for sure, this does NOT depend on resolution.

Higher resolutions mitigates moire when integer scaling does not work tho.

I see. So something is definitely up with Integer Scaling/Overscale with Odin 2. Thank you for the help.

outlandernwah commented 1 week ago

Anyway, it looks like my setup was maybe messed up a tad somehow. So I think your shaders are fine but for whatever reason they just don't work well on the Odin 2. I checked some under the Shaders>crts presets and they also don't snap well even with Curvature off. It's pretty obvious the scanlines don't line up well (some are bigger than others, etc) This is on a clean install now. Anything I can do?

I guess you can close this. Sorry for the bother btw

kokoko3k commented 1 week ago

If you observe the same on a clean retroarch configuration, then I'd search for help in Odin support/communities.

Unfortunately I don't own it, but I think something is altering screen coordinates. Some resolution/scaling settings maybe.