English Amiga Board (http://eab.abime.net/index.php)
-   support.FS-UAE (http://eab.abime.net/forumdisplay.php?f=122)
-   -   Made a new shader for FS-uae. (http://eab.abime.net/showthread.php?t=104864)

 kokoko3k 01 December 2020 18:33

Made a new shader for FS-uae.

First post here, so Hello everyone!.

In latest days i've been playing with glsl and shaders.
I never used them before, nor i wrote any shader before, so probably i did some mistakes/unoptimized code, did something already existed, whatever, i don't know.

Anyway, by inspecting other's people code, i came up with a shader that looks good to me; also is very configurable,and i think it is a nice toy to play with.

It has support for several features:
* non linear scanlines on original coordinates
* non linear screenlines on screen coordinates
* custom rgb masks with(out) offset
* glowing,haloing,blooming
* gamma correction
* saturation correction
* alternate blanking (like uae's feature)
* play nicely with FS-UAE's autoscale function

Also, it is important to know that it is meant to be used with:
* line doubling enabled: line_doubling = 1
* low resolution disabled: low_resolution = 0

I've set the default values to match my real arcade crt monitor as much as i can on a 1080p, you may have much better results tuning it for 4k, of course .

Please, share your impressions, ideas, improvements...

Complete gallery for version v1.35:http://wpage.unina.it/aorefice/share...koko-aio-1.35/

Some Examples:
http://wpage.unina.it/aorefice/share....png.thumb.png http://wpage.unina.it/aorefice/share....png.thumb.png http://wpage.unina.it/aorefice/share....png.thumb.png http://wpage.unina.it/aorefice/share....png.thumb.png http://wpage.unina.it/aorefice/share....png.thumb.png

Latest version is 1.40, not (yet) made any screenshot, you can download it here:
http://wpage.unina.it/aorefice/share...koko-aio-1.40/

In 1.40, files are named with the scheme:
Code:

FeatureX-1.FeatureY-0-....-FeatureZ-string.shader
where 1 and 0 means that that feature is present or not, "string" describes how that feature has been configured.
Eg:
Code:

scanlines-0.glow-1.vmask-full.darklines-offset.halo-1.bloom-0.shader
...means that you get no scanlines, full vertical mask, darklines painted with an offset, halo and not bloom.

Have fun!

 ztronzo 01 December 2020 23:12

Good job! Just curious.. how does it look in -game with Worms DC and Skeleton Krew? These games had a glitch in FS-UAE which made horizontal pixel shifting on the end of some sprites.. (red arrow in Worms DC and while moving current worm)

I will try on first chance

Sent from my SM-G920W8 using Tapatalk

 kokoko3k 02 December 2020 07:11

Didn't try Skeleton Krew, but Worms DC still have that glitch.
I don't think a shader can do much about that...

 ztronzo 02 December 2020 14:29

No worries... Skeleton Krew can be corrected with using the Low Resolution option

Checking your screenshots, I find it strange that I see vertical bands of a greenish shade when the images are at a certain size.. nice effect

Sent from my SM-G920W8 using Tapatalk

 kokoko3k 02 December 2020 14:37

You've to see them at 100% size, or browser scaling makes funky effects :)
I know imgur is not the best hosting site in that regard, it requires you several clicks.
Also, from a smartphone i thinks is not even possible!

 kokoko3k 16 December 2020 09:59

Made a lot of improvements with some presets for 1080p screens available here:
http://wpage.unina.it/aorefice/sharevari/koko-aio/

This is an attempt to mimic crt-royale with its default settings, it notably misses the bloom effect and scanlines are not "precise":
http://wpage.unina.it/aorefice/share...oko-royale.png

 Bladeforce 29 December 2020 12:47

This is fantastic. Just popped on to say thanks its very, very good

 kokoko3k 29 December 2020 16:38

I'm very glad you liked it :)

 kokoko3k 13 January 2021 12:40

Thanks to the pandemic, in the last few days i struggled to add bloom to the shader, and now i managed to do it in a way that could run on my poor Haswell igp.
All of the presets reaches 50fps on an intel i5-4590, but with a discrete card, you can tweak them to make them look nicer (bloom quality is very heavy).

Also, in 1.35, i removed various hacks from the shader, and i don't think there is more left to do, edited the first post with new pictures and updated download link.

Have fun!

 dreadnought 13 January 2021 14:28

I'm not very familiar with UAE emulation. So far I've copied the files from the linked page to Data/Shaders, and put the line doubling/low res lines into the config. But how do I actually "enable" it all?

 kokoko3k 13 January 2021 15:01

I use fs-uae-launcher and in the advanced options, i put something like:
shader = /path/to/my/crt-shader.shader (or shader = c:\path\to\shader on windows).

 RuySan 13 January 2021 16:00

By looking at the screenshots, they look pretty good, but i usually get paralysed with so many options. Do you know which one mostly resembles the image on a Commodore 1084 monitor?

 dreadnought 13 January 2021 16:02

Ok, that helped.

Interesting stuff, the shadowmask looks really good. Overall it's a bit blurry, but that might be down to my setup or different shaders. Do you think it might look different because I'm on a 1440p monitor?

Also, what FS UAE basic video settings should I use to achieve proper aspect ratio and max screen size?

 kokoko3k 13 January 2021 16:22

Quote:
 Originally Posted by RuySan (Post 1453389) By looking at the screenshots, they look pretty good, but i usually get paralysed with so many options. Do you know which one mostly resembles the image on a Commodore 1084 monitor?
I know there are a lot of knobs, that's why i made a lot of presets :-P

From what i remember on my old 1084s, i think you can try the non bloomed version:
http://wpage.unina.it/aorefice/share...ingjackson.png

http://wpage.unina.it/aorefice/share...d.vmask.shader

if there is still some white "bleeding" from the scanline that you don'like, you may try to change halo_h and/or in_glow_h
Code:

"#define halo_h    1.0" (and/or "#define halo_h    1.0") to "#define halo_h    2.0" (and/or "#define halo_h    2.0")  (less is more here)
and/or lowering halo_power:
Code:

#define halo_power 2.0 to #define halo_power 1.5
Anyway, don't change them too much, because they help in keeping the image brighter on "common" lcd backlight levels.

 kokoko3k 13 January 2021 16:27

Quote:
 Originally Posted by dreadnought (Post 1453391) Ok, that helped. Interesting stuff, the shadowmask looks really good. Overall it's a bit blurry, but that might be down to my setup or different shaders. Do you think it might look different because I'm on a 1440p monitor? Also, what FS UAE basic video settings should I use to achieve proper aspect ratio and max screen size?
Did you checked the screenshots related to the presets? do them look different from what you get on screen?
I use a 1080p and no particular settings, apart from the switch i wrote in the first post:
* line doubling enabled: line_doubling = 1
* low resolution disabled: low_resolution = 0

Also, i explicitely wrote the shader to look good with fs-uae autoscale feature (so that if you like scanlines they do not "dephase" too much)

 dreadnought 13 January 2021 16:56

Yeah, when compared to your example games they look the same. I was looking at Defender Of The Crown before, maybe that's why.

Like I said, I have very little experience with UAE emulators. I use them once in blue moon to quickly check something, but not play games, so I have never messed with gfx settings. So, I'm not sure how autoscale works, or how to achieve that proper-AR/maxed-out effect I mentioned (though it's a topic for another thread.)

I asked about 1080p vs 1440p because I think I've heard somewhere that CRT shaders might differ when used in different resolution, in regard to some other emu (Retroarch or MAME, not sure). Could be that I misread it though.

Overall, great job, I will probably use this config (scanlines/vmask one) when checking stuff out from now on, because I can't stomach the raw naked pixel look.

 kokoko3k 13 January 2021 17:40

Yep (nope), in this particular case, the more the pixels, the better results ;)

 FrodeSolheim 27 January 2021 20:05

Related feature request filed by kokoko3k: https://github.com/FrodeSolheim/fs-uae/issues/241

 almeath 13 February 2021 08:37

2 Attachment(s)
I want to thank all the contributors to this thread. These new shaders look great!

I was wondering if anyone could help me convert my favorite DOSBox/PCem shader to the XML format that is used by FS-UAE?

I tried it myself, but my coding skills are just not up to scratch. In fact, I cannot even tell if the functions in these shaders are backwards compatible?

Can anyone point me in the right direction? I would be thrilled to get these working in FS-UAE.

 Photon 18 March 2021 00:09

The only lines I see are vertical, i.e. not what ppl usually mean by scanlines.

There's also some blur and TV mask going on.

Scanlines are actually the pixels, not the space between them. This space is what's left between the glow of the pixel lines above and below the space.

PAL scales perfectly to 1080p by a factor of 4x noninterlaced.

I would love a shader that scales every horizontal Amiga pixel by exactly 4x, leaving 3px room between each scaled line, and then gives control over pixel glow to create the "scanlines". This is a correct shader.

All times are GMT +2. The time now is 16:31.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.

Page generated in 0.04643 seconds with 11 queries