Yet, another CRT Shader

Hi,

This is a filter I was working long ago. Its in development yet. Its a crt shader ( a new one):

https://anonfiles.com/file/e0b748e9c3b5 … 24b5abc41c

I wont put ut at common-shaders until I think its good enough. My goal here is picture quality, so I won`t put things that degrades the image just for accuracy. So, if you want accuracy, look for it on other options already available for Retroarch.

edit: Forgot to mention, use nearest filter and integer scaling.

A second version:

  • Twice as fast;
  • Smoother.

Here (save as .cg): http://pastebin.com/8pmuVL28

Common-shaders updated with the last version.

Hi, i’m interested in CRT shaders. Yours is quite classic but it’s really nice and soft. Will you continue to work on it ? Sometimes i do some testings with photoshop with interessing results. I don’t know anything at programming but i presume that shaders programming is very difficult. Is it difficult to reproduce dynamic beam width ? Thickier on bright colors and thinner on darker ones ?

Yes, I’ll continue.

The dynamic beam width is something I’ve already tried in my tests, though I couldn’t reach something good.

The problem is that the image becomes too dark when you do that. Today flat panels lack in brightness compared to a real CRT, and then it’s too hard to compensate the brightness lost when you narrow the beam, even when you try to saturate to extreme values the thin beam. This is the real chalenge. I doubt we can reach that with nowaday panels.

I have a real CRT and can see how it narrow the beam according to the pixel luminance. Even in thin beam lines, the brightness stays high and the image doesn’t get darker. It’s impressive!

Yes I agree, CRT is pure light magic for that ! And a lot of people throw them like a piece of junk even tough they’re still functional. :frowning: Maybe in the future with oled and 4k we can reproduce it better…

This is my latest test of a crt with variable beam width. Try this with SNES9x (DKC, DKC2 and DKC3):

http://pastebin.com/DhsxTLiU

As you can see, the beam is variable, though the screen gets a bit too dark. There are some glitches too. But, well, it’s a first tentative.

Just a note: you can only see the variable beam at 5x scale or higher! And use Integer Scale.

EDIT2: Changed a bit some params and fixed a small bug. Here’s a second test version: http://pastebin.com/HCkkyy1j

Looks promising… I like the way it has a big range of dynamic. Still a bit dark. Maybe you can cheat a bit with oversaturation and “halation”… Good work anyway I’ll use it !

You can bright it a bit more changing this:

color = clamp(color*d*1.2, 0.0, 1.0);

to this:

color = clamp(color*d*1.4, 0.0, 1.0);

Sorry, I forgot to use constants instead the very values to represent the color_boost.

Third version: http://pastebin.com/65nvA08S

A bit better during pixel transitions, and better colors.

v4: http://pastebin.com/jnykhPaK

  • Add some tricks to get brightness up.

v4b: http://pastebin.com/R0JSuhNS

I’d like opinions about v4 and v4b. The v4b beam format is almost identical to the output of my Sony CRT Trinitron, except the color quality and brightness.

V4 is darker but great scanlines because bright tones tend to merge each other. My crt renders like this and I like that !

V4b Better brightness and colors but scanlines too marked. I know some screens do that but it’s less interesting for me. :stuck_out_tongue:

Ok, I like v4b more. :stuck_out_tongue:

Here’s a V5: http://pastebin.com/bB2vMwNt

Better brightness and colors.

I like v5 very much :slight_smile:

I think it’s bugged, see screenshot:

That ringing effect. I also liked how v4 had better bloom on highlights and the vertical-horizontal scanlines balance.

I don’t get this bug here, though. Maybe a card driver incompatibility? I’ll have to investigate.

Yeah! It’s getting there! :wink:

Be sure you’re on nearest and not linear.

@Hillyan: The shader is one pixel down and one pixel on the left, slightly out-centred. Easier to see with “n” and “m” keys to switch between shaders.

Yes, thanks, I knew about that. I was so busy fixing other things that I forgot about this little issue.