Mega Bezel Reflection Shader! - Feedback and Updates

@HyperspaceMadness Great update and I love having the phosphor blur to play around with. I played around with it last night and I have a few questions:

-The LUT set to 1 looks great but kills the contrast in blues. I have included a screenshot. Is this supposed to happen? Perhaps I don’t understand what a LUT is.

-Pre-CRT Black Level with a positive crushes the image with too much black.

-Negative Crop Brightness, I can’t figure out what it does. I don’t see it changing the image.

Here are examples from the opening level of Alisia Dragon on the Genesis. First is default settings with the HSM venom shader but LUT set to 0. Next is LUT set to 1 and finally pre-CRT black level set to 0.05

Thank you for all your hard work HyperspaceMadness.

1 Like

Productive weekend everyone!

1 Like

I’m not sure it it ends up being more real or not. They are colors from a specific tv model torridgristle created.

To my eye they fix a lot of the blues which look a bit purple.

The lut colors are on, and with my last update this morning the color temperature is dialed to -50 so is a bit cooler.

1 Like

That’s interesting, as I’ve always heard that the red phosphor decays at a much slower rate, and that appears to be corroborated in published rates of decay: the decay rate (to 10% luminance) of the standard blue phosphor (known as P22B) is ~25 microseconds vs green (P22G) at ~60 microseconds and they’re both much, much faster than red (P22R) at a whopping ~850(!) microseconds. (scroll down to table 6-2 for details)

Now, I believe that’s just for the amount of time that it’s luminescing (as these numbers are far too small be visible across multiple frames, even for red), and the real issue is phosphorescence (aka “emission time” or afterglow), and that apparently has more to do with the activator material that the phosphor material is doped with, but in this case, too, the one used in red phosphors (Europium) has a “very long” afterglow vs “short” for silver and “long” for copper used in blue and green phosphors, respectively.

I think this video supports that, with the blue of the sky fading to nothing after just 1 or 2 scanlines, while the green trees hang around a lot longer and the reddish Mario and ground pixels hang out even longer than that.

To be fair, though, red and green are fading out much faster than a full frame in that video, too, so there may be some other effect at play–maybe having to do with responsiveness of rods/cones in the human eye and/or photoreceptors in cameras–but if so, that does lead me to wonder if videos can be reliable. Dunno :man_shrugging:

3 Likes

I have noticed that in many games, especially in arcades. The blue sky in Final Fight for example.

2 Likes

Yeah it’s really hard to know. I based my values on what I saw in some videos of Galaga, and another one of smash tv. Some sort of persistence or after image goes over about 3-4 frames max

Here the arrows are over each visible frame of the end of the rocket

2 Likes

I think you might want to take into consideration the luminance components for the P22 phosphors:

0.4665636420249939 0.25661000609397890 0.005832045804709196

that’s the transformation, the current primaries are:

0.640, 0.282, 0.146

As for these coefficients the red phosphor has almost double the luminance component than green.

2 Likes

Yeah, a LUT is a look up table, which means I take a current color, then look it up in a table of defined colors that it should map to. Exactly how accurate it is I’m not sure. What seems like the case is that a lot of the really deep blues that are in the original before the LUT are applied may not really be the expected color, but in the end it’s hard to know without vintage hardware to check against, and color calibration is a really tricky thing, I’m interested in looking at Dogway’s stuff as it seems like he has gone into all the details.

Here are some examples, I find in general that the LUT is making stuff look more natural.

Afterburner LUT Colors OFF

Afterburner LUT Colors ON

Sonic Title LUT Colors OFF

Sonic Title LUT Colors ON

Sonic - LUT Colors OFF

Sonic - LUT Colors OFF

Super Metroid - LUT Colors OFF

Super Metroid - LUT Colors ON

If you use negative cropping to push the edge of the crt image in from the edge of the tube Negative Crop Brightness adjusts the newly revealed empty area at the edge of the screen so it matches the blacks in the screen image because the blacks in the image won’t be black anymore if the black level is < 0. The Black level < 0 is mostly there so that you can get faint scanlines to appear in the black area.

You are totally right that the pre-crt black level is totally broken when used with values greater than 0. I’ll fix this.

4 Likes

Thanks for pointing this out, how would this be applied in the shader, just keeping in mind that the luminance is different between them?

When you refer to the current primaries, where are you talking about?

2 Likes

I agree the Lut looks more natural but when I see the contrast in blues blurred the OCD part of me cries out that I’m missing some pixels. It’s irrational since it only happens on a small number of games but it still drives me a little nuts.

2 Likes

In playing around with some motionblur shaders, the thing that looks the closest to your shots seems to be just basing the persistence on the luminance value of the pixel. That seems to be more important than the color/material.

2 Likes

But the luminance is based on the emulated primaries. For P22 the red phosphor adds more to the luminance than the green. The eye cone receptors are more sensible to green colors, so you have to subtract the P22 RGB luminance components to the eye’s cone RGB response, which matches those of Rec.709.

R'G'B' P22 (phosphor response)
0.640, 0.352, 0.008
0.282, 0.620, 0.098
0.146, 0.061, 0.793

RGB Rec.709 (cone respone)
0.212655, 0.715158, 0.072187
2 Likes

Right, how you calculate the luminance is going to matter a little bit, but it’s going to be hair-splitting vs trying to base it on phosphor characteristics. That is, even something really naive like max(max(R,G),B) is going to look more “right”, I think, than basing it on phosphor decay/afterglow characteristics.

3 Likes

Sure, if you don’t want to emulate the phosphor characteristics that’s a good and fast approach.

3 Likes

The new Lut definitely feels more natural to me now. Here is Batman on the NES. It makes way more sense he would have been designed to be blue and not purple. This sort of thing drives me so nuts I want to buy a CRT just to check what it was meant to be.

3 Likes

The issue with that would be some manufacturers had different color outputs to an extent from each other (that’s why torridgristle made multiple LUTs because Sony did different stuff with color vs the other manufacturers), the other issue would be that’d you have to make sure the TV was properly setup, calibrated, etc.

So in some color instances (purple for instance, basically any non-primary color that could easily be changed to any two different primary colors) it makes it hard to tell what color something was supposed to be without ripping things from the game to get values for things to figure out what color it was supposed to be.

I do agree blue Batman makes more sense though, I’m just saying getting a CRT may not help you decide about the colors as this can vary a fairly decent amount from understanding between brands and models.

EDIT: Seems he may have been purple. Don’t know accurate this is, though. https://www.spriters-resource.com/nes/batman/sheet/38501/

2 Likes

I decided i don’t want LUT colors as default. But some games do benefit from it, mostly MAME arcade games.

Also, i take back what i said about the color persistence. It looks great on some certain (older) games.

I’d like to start saving different game presets but the fact they will get reset each update holds me back. I’ll wait until the bottom scale/overscan bug is fixed so i can settle once and for all (i think :p)

2 Likes

NES colors are a sticky wicket due to the issue of palette variation, but he was definitely purple on a typical home setup. Easiest way to verify is by looking at these shots from Nintendo Power.

3 Likes

The game being from 1989 I’m assuming all artwork was laboriously coded in pixel by pixel. That means they where looking at it all through a monitor with a color LUT and never seeing the raw sprites like we can today. (As far as I know.) The Joker is a lighter pinkish purple in the game, so I would be surprised if Batman was dark purple. Yet the NES did have a limited color palette…

@hunterk good find. Here is a video of someone playing on a crt. It’s not great quality but to my eye Batman looks a little more bluish than the magazine.

1 Like

I watched a little of the video, it’s either the camera or TV that’s pushing the blue a little harder. I can see some purple-ness to Batman in the video, alot of the colors seem off to be honest. Look at the HUD up at the top, the whole this is basically blue in the video. (Which is most certainly not right, so yeah either his camera or CRT is pushing blue hard.)

I do w/e with the color when I’m playing games anyway. But yeah he “should” be purple in that game, makes more sense too use the LUT and make him blue though, lol.

1 Like