Koko-aio shader discussions and updates

Yeah, I think ambilight in koko-aio has some extra settings regarding the blending mode and the alpha channel managment, so maybe the look would not totally be the same without some extra tweaking.

1 Like

It’ll keep me busy this afternoon while my missis watches great British bake off :grinning:

1 Like

Hi m8 great shader! i have the new background image saved as bg_under/over. What is the best way to have the ambi-light go over the background image. Thanks

Since there are multiple ways to approach this with different results, there isn’t really a single “best” one :slightly_smiling_face:

What’s your end goal? Have you had a chance to go through the docs yet?

One of my fav. presets when it comes to ambient lighting is Monitor-Ambilight-immersive:

5 Likes

Shortly, a sort of tweaked halation/global illumination effect will be available as a suboption of the bloom section:

It works by taking a very much blurred version of the original image and apply its brighter tones to the final image, thus colorizing it.

At its maximum strength it looks like this, showing just to make it evident:

But on a normal use, it gives “breathing” and produces nice subtle shades:

To avoid too much brightness, bloom and halation are compared and just the maximum will be used; also the option to apply less bloom to bright areas applies to halation too.

4 Likes

Hi, I’ve analyzed the shots and compared them to my recollection of real CRT appearance and behaviour and this method of enhancement only seems to work for darker colours.

On darker colours it looks like a subtle glow emanating from the phosphor core, however on brights, it just looks like WOLED’s white subpixel washing out the colours of the phosphors.

Maybe it might work better if there were a steep roll-off or cut off where the white is visible because remember none of the phosphors were white as well.

So it looks like a miniLED LCD with white backlight glowing which doesn’t blend well with the original phosphor colours. At white and brighter colours, colour saturation of the phosphor doesn’t decrease as we’re seeing here. On the contrary, it’s supposed to be at its maximum.

If we could get this right, I think that we can finally simulate bloom and glow without sacrificing accuracy.

3 Likes

Yes, what you say sounds totally right to me.

A stronger light from behind the glass should have the precedence over the light scattering in CRT glass and should pass as is.

However, the final effect is not as pleasing (trying it is trivial, but performance wise is heavier):

That way halation flattens the image, while applying globally gives me the impression of added depth.

Also, as a mitigation:

1 Like

All of this is why we need to embrace the hybrid approach of leveraging the brightness advances that have been made in TVs in recent times.

So how long do we have to wait until approaches that don’t wash out the phosphor become more of the norm, rather than the exception?

What would it look like if it took a very much blurred version of the original image after it has been represented by an RGB phosphor mask and applying the brighter tones of the glow to the outsides of each phosphor creating a halo around each phosphor that is in the same colour of each phosphor?

Assuming the rgb mask represents the original image with accuracy, its blurred version will be the same as the blurred original image without the mask.

I don’t think that the halation effect is something one would like as is.

I’m picturing something different in my mind. I’m visualizing soft red, blue and green halos around each phosphor, with no white anywhere, except if viewed from an appropriate distance. In other words each phosphor being blurred individally.

I think it would only look the same if the blurring is at an extreme level but it has the potential to provide an individual glow effect to each phosphor without the washing out effect because the glow would be the same colour as the phosphor it surrounds.

The 2 looking the same might depend on other factors such as display resolution and TVL of the emulated phosphor mask. i.e. it might work better if we have higher display resolution and lower TVL CRT resolution.

Yes, I was talking about halation, which is big.

Blurring as you say is computational expansive; emulating the phosphor glowing is not, or at least there are shortcuts:

https://forums.libretro.com/uploads/default/original/3X/7/4/740148afa097d09b7ea6dac399ffa6d0ce816f49.jpeg

Maybe haloing every single phosphor could be achived with no much load, but imho would be really important only if you stay with your nose into the screen; also you would nead a bunch of free display pixels per triad to show it properly; maybe not even a 4K would be enough.

Edit:

With 2 lines of code and a resolution of 9600*5400 something like that is doable right now to emulate a TVL of 500; it is a steep phosphor with a slight glow:

:

At 5760*3240 you would have this (moirè present already)

At 4k: a disaster:

But really, even if it is fashinating, today it is not yet feasible, so you HAVE to join pixels and averaging them before presenting the final picture to the screen.

PS: Curvature produces moire, but disabling curvature turns moire into a weavy effect, so not much to gain there.

3 Likes

Yes, it does look pretty but the colour mean is exactly what I was referring to in the first case but with some code to exclude it from showing white or any colour that starts washing out the phosphor primaries too much.

So maybe some sort of curve could be implemented where the glow effect tapers as things get closer to white and is more weighted towards the midtones.

How does that sound? I hope you understand what I’m trying to explain.

I think this approach has the potential to take things one step further than what the current Sony Megatron Colour Video Monitor does.

The moire is very heavy even in screenshots. It seems like it’s baked into the Scanline/phosphor calculations rather than an optical illusion created by the way the patterns intersect/interact.

It definitely needs extra brightness to look right. HDR would definitely help and if it’s possible, to get the shapes of the phosphors to make more sense/be more realistic overall.

Thanks for taking the time and making the effort to oblige me. The ability to write code is definitely a gift I admire.

What do you think? @guest.r, @Nesguy, @DariusG, @hunterk, @beans Is any of this useful in the context of improving the accuracy of CRT emulation?

2 Likes

But this means to sacrifice accuracy, right? Take an extra bright display and let him do it with no efforts like Megatron does; just wait for the hardware or accept something that looks convincing from a proper distance; that’s what I think.

2 Likes

What I’m talking about is a better, more accurate bloom/halation that doesn’t wash out/desaturate the phosphor colours especially in the white areas/highlights.

A hybrid approach is plausible where HDR makes it possible to use less effects which sacrifice accuracy for brightness.

I understand what you’re saying but my approach to these things is to build out from the phosphors and scanlines so it scales from the screen to whatever distance you’re sitting at. There are infinite levels and opinions as to which approach is acceptable or not.

I think if you get things right, down to the phosphors and scanlines level, there are tangible benefits which can be obtained.

In terms of the hardware advances contributing to the work, we’re in a time when bright HDR capable displays are more affordable than ever and lower brightness HDR displays can take advantage of thy hybrid approach, which has been available for a while now in RetroArch but I think has been underutilized.

For the rest, continuing to experiment with an test more accurate or efficient ways of doing things keeps things evolving and improving in interesting ways.

Magic Glow is an example of this. Who knows what will be the next big thing in CRT emulation or maybe it could be something small that keeps things moving in the right direction?

It is, indeed; since there are not enough pixels to draw things to, some fall across 2 of them in a repeated/periodic pattern which is easilly spotted by the brain. It is very similar, and I’d say the same principle, as the optical moirè effect.

My only complain with how shaders look even today is the motion induced blur; but for the rest I’m already satisfied when I compare them with my real CRT in the cabinet.

2 Likes

I could test it out and see what it looks like at 1000 nits, I think it could be useful

2 Likes

That would be great. I would love to test shaders based on both ideas as well.

What would happen if you tried something like rendering at a higher resolution then downsampling to get rid of the moire @kokoko3k?

Artifacts gone, probably, but mask too.

I’ll make a test pack with the modified shader and a test preset, but consider that I’m an lcd@1080p user :sweat_smile:

1 Like