Sony Megatron Colour Video Monitor

I’ve been doing all my tests in the 240p test suite “White & RGB Screen”, below is from the White screen.

I’ve made a GPU screenshot using glcore and it is showing the mask, I magnified a cutout below a number of times.

The main difference between the two is when the output that I see on screen in macro mode is good (clean subpixel RGB output) then the mask snapshot is saturated like below:

mask-good

When the output I see on screen is with “messed up” subpixel layout, then the GPU screenshot show me a desaturated mask snapshot like below.

mask-wrong

The monitor output of the two snaps above correlates to the pictures I showed earlier:

2 Likes

Great stuff - can you lower the gamma out to 2.2 for me when dci-p3 is selected and do another screen grab.

I’ll take a look at the desaturated one for colour values - I’m looking for non pure magenta green values i.e they should be just red and blue with 0 green in the first channel and green with red and blue channels being 0 in the second channel.

1 Like

@rafan just tested it and I’m wrong in that it’s further down stream - there’s definitely something wrong in the shader. I’ll investigate further. Looks to be mangling the blue channel

3 Likes

Brilliant found the problem! I’d copied the XYZ_To_DCIP3 from the Kronos group without transposing it as you need to. Simply transposing the matrix solves the issues I’m seeing with DCI-P3.

I’ll submit this fix right away and see where we get to. Again thanks for preservering with this Rafan it’s greatly appreciated.

It may seem I’m ignoring people at times it’s just I’ve got very small amounts of time I can devote towards this and so have to rely on others to try things out. Many thanks again.

3 Likes

Just created a pull request for Sony Megatron 3.7 with fixed DCI-P3 colour space. Contrary to what I just said above it wasn’t the transpose issue (I have no idea how I fooled myself into thinking it was but anyway). Instead it was simply the DCI-P3 to linear incorrectly applying the gamma - it basically created a new channel because it was writing out a vector with a 1 at the end (I think anyway).

Regardless its now fixed as far as I’ve tested. Thanks again to @rafan for identifying this problem.

1 Like

Family comes first! No pressure!

I’ve been following this and I’m looking forward to redoing my OLED Mask tests to see if there’s an improvement after the fix.

Remember us OLED users have been getting similar strange colour anomalies when HDR is enabled but things look pretty clean in SDR mode.

Thanks @rafan, @GPDP1 and @MajorPainTheCactus!

Keep up the great work!

1 Like

Thanks for your kind words @Cyber

So one thing to bear in mind with this issue was that it was visible in the screen grab’s I did (and we’re also yet to confirm whether it fixes @rafan’s issue). What I’m trying to say is that I think we proved the OLED issue was with the TV rather than the shader as it wasn’t apparent in any of the screen grabs we did. Am I right in saying that? If I’m wrong in saying that we can certainly take another look at it as I’d be keen to resolve any bugs.

2 Likes

Thanks @MajorPainTheCactus for further investigations.

Unfortunately the issue with the masks in DCI-P3 is not fixed.

Below is an extended testcase that dives into the interaction between color gamut mapping and mask quality. I’m sure this will convince you there’s an issue in the color gamut mapping and interaction with the masks.

The essence is that colour gamut mapping of 709 (or any smaller gamut than DCI-P3) to a wide gamut like DCI-P3 or 2020 is not doing any “true” primary conversion, but instead is just scaling the RGB values. This is the intended way color gamut mapping works I think, but for our use or because of the current shader (mask?) implementation it is having an adverse effect on mask quality unfortunately.

In fact I’m quite sure ANY color mapping of a less saturated space into a more saturated (i.e. wide gamut) space is negatively affecting mask quality in the current shader, which would include the HDR shaders, as mapping 709 to 2020 is their default.

I’ll let the results below speak for themselves. The essence of space “A” and “B” are that they’re the same as DCI-P3, except for the green primary: they are less saturated as pictured below. That way we can single out issues by only having to focus on the green channel.

To replicate my results please add the following three color matrices to “gamma_correct.h”:

// DCI-P3
const mat3 kDCIP3_to_XYZ = mat3(  
0.4865709486f,	0.2656676932f,	0.1982172852f,
0.2289745641f,	0.6917385218f,	0.0792869141f,
0.0000000000f,	0.0451133819f,	1.0439443689f);
    
// DCI-P3 "A" -- Green primary changed to Gx=0.28, Gy=0.50
const mat3 kDCIP3A_to_XYZ = mat3(   
0.3795617857f,	0.4279562091f,	0.1429379323f,
0.1786173109f,	0.7642075162f,	0.0571751729f,
0.0000000000f,	0.3362513071f,	0.7528064436f);
 
 // DCI-P3 "B" -- Green primary changed to Gx=0.30, Gy=0.40
const mat3 kDCIP3B_to_XYZ = mat3(
0.2190998562f,	0.6475197396f,	0.0838363312f,
0.1031058147f,	0.8633596528f,	0.0335345325f,
0.0000000000f,	0.6475197396f,	0.4415380111f);

and replace the “else” for the DCI-P3 conversion by this:

  else
  {
     //const vec3 dcip3_colour = (scanline_colour * k709_to_XYZ) * kXYZ_to_DCIP3;
     //const vec3 dcip3_colour = (scanline_colour * kDCIP3_to_XYZ) * kXYZ_to_DCIP3;
     //const vec3 dcip3_colour = (scanline_colour * kDCIP3A_to_XYZ) * kXYZ_to_DCIP3;
     const vec3 dcip3_colour = (scanline_colour * kDCIP3B_to_XYZ) * kXYZ_to_DCIP3;      
     gamma_out = LinearToDCIP3(dcip3_colour);

As for the preset, I’ve used your default 2730-sdr preset and changed nothing EXCEPT for

  • colour space to DCI-P3
  • colour system to “0” (709), as the NTSC-J mapping is also causing adverse effect on mask output, although less noticable.

I’ve attached the preset with these two changes at the end.

So below are three results, first DCIP3 to DCIP3, then DCIP3A to DCIP3 and then DCIP3B to DCIP3.

DCIP3 to DCIP3ALL OK since there’s no color scaling happening

 //const vec3 dcip3_colour = (scanline_colour * k709_to_XYZ) * kXYZ_to_DCIP3;
 const vec3 dcip3_colour = (scanline_colour * kDCIP3_to_XYZ) * kXYZ_to_DCIP3;
 //const vec3 dcip3_colour = (scanline_colour * kDCIP3A_to_XYZ) * kXYZ_to_DCIP3;
 //const vec3 dcip3_colour = (scanline_colour * kDCIP3B_to_XYZ) * kXYZ_to_DCIP3;  

240p WHITE test screen

0dcip3todcip3_white

240p GREEN test screen

0dcip3todcip3_green

GPU snapshot of mask, note green is (0,255,0)

0dcip3todcip3_mask

DCIP3A to DCIP3 - ISSUE, red and blue subpixels light up left and right of the green subpixel.

 //const vec3 dcip3_colour = (scanline_colour * k709_to_XYZ) * kXYZ_to_DCIP3;
 //const vec3 dcip3_colour = (scanline_colour * kDCIP3_to_XYZ) * kXYZ_to_DCIP3;
 const vec3 dcip3_colour = (scanline_colour * kDCIP3A_to_XYZ) * kXYZ_to_DCIP3;
 //const vec3 dcip3_colour = (scanline_colour * kDCIP3B_to_XYZ) * kXYZ_to_DCIP3;  

240p WHITE test screen

0dcip3todcip3A_white

240p GREEN test screen

0dcip3todcip3A_green

GPU snapshot of mask, note green has become less saturated (142,255,56)

0dcip3todcip3A_mask_(142,255,156)

DCIP3B to DCIP3 - ISSUE gets worse, red and blue subpixels light up brighter left and right of the green subpixel.

 //const vec3 dcip3_colour = (scanline_colour * k709_to_XYZ) * kXYZ_to_DCIP3;
 //const vec3 dcip3_colour = (scanline_colour * kDCIP3_to_XYZ) * kXYZ_to_DCIP3;
 //const vec3 dcip3_colour = (scanline_colour * kDCIP3A_to_XYZ) * kXYZ_to_DCIP3;
 const vec3 dcip3_colour = (scanline_colour * kDCIP3B_to_XYZ) * kXYZ_to_DCIP3;  

240p WHITE test screen

0dcip3todcip3B_white

240p GREEN test screen

0dcip3todcip3B_green

GPU snapshot of mask, note green has become even less saturated (203,255,206)

0dcip3todcip3B_mask_(203,255,206)

Preset used for testing:

hcrt_hdr = "0.000000"
hcrt_colour_space = "2.000000"
hcrt_colour_system = "0.000000"
hcrt_brightness = "0.150000"
hcrt_gamma_in = "2.000000"
hcrt_red_vertical_convergence = "-0.140000"
hcrt_red_scanline_min = "0.550000"
hcrt_red_scanline_max = "0.820000"
hcrt_red_scanline_attack = "0.650000"
hcrt_green_scanline_min = "0.550000"
hcrt_green_scanline_max = "0.900000"
hcrt_green_scanline_attack = "0.130000"
hcrt_blue_scanline_min = "0.720000"
hcrt_blue_scanline_attack = "0.650000"
hcrt_red_beam_attack = "0.720000"
hcrt_green_beam_sharpness = "1.600000"
hcrt_green_beam_attack = "0.800000"
hcrt_blue_beam_sharpness = "1.900000"
hcrt_blue_beam_attack = "0.450000"
3 Likes

Hi @rafan, so I’m yet to fully digest the above but from my tests of the green screen I’m definitely seeing another issue. I see the red channel appearing in all colour systems:

I’m going to investigate where this is coming from as I wouldn’t expect it. Maybe I just need to move this all before the mask and scanlines but not sure yet.

4 Likes

Yes the red channel appearing is also related to gamut mapping.

If you change Colour System from NTSC-J to r709 then the red hue disappears.

3 Likes

Ah actually the red channel is probably right as this is a RGBX mask. The NTSC-J is applied before and shifts the image to a warmer temperature which is correct.

1 Like

I’m not sure I understand you. NTSC-J (9300K) is actually cooler than 709 (6500K), so how would going to NTSC-J shift the image to a warmer temperature?

1 Like

Yes the slightly tipsy topsy world of colour temperature got the better of me where a hotter temp of 9300 Kelvin vs a cooler 6500 Kelvin results in a bluer image than a redder one which just trips me up sometimes. The maths is correct in respect - when you select NTSC-J it is a bluer image.

So going back to the red appearing it isn’t because of the colour temp as I had suspected. I’ll investigate further where that red is coming from but now I suspect the transform from Rec.601 space to XYZ rather than from rec.709 to XYZ.

2 Likes

Ah I see, yeah so we’re talking color temp.

With regards to the matrices, I would not be surprised if that’s all fine.

Could you possibly take me shortly through how the magenta-green mask application works, how/when does a subpixel get masked and does the magenta and green in the mask need to be fully saturated to work properly?

2 Likes

Hello,

Sorry if this problem has already been mentioned but I’m trying to use your shaders with my new Dell G3223D monitor and the latest stable version of Retroarch. The problem is that I have totally washed out colors with all your hdr shaders. Is this a known problem and if so do you have any idea of its origin?

Thanks for your help.

1 Like

Hi yoZe that’s probably that you’ve not turned on HDR in Windows and/or RA (Settings->Video->HDR). Also try the SDR version see if that makes things better for you.

2 Likes

@rafan I tried moving the color space conversion to before the scanline and mask generation and have had some success. There’s a problem with HDR as the values are out of whack but I’m hoping I can fix this. This’ll definitely fix the issues you’re seeing.

4 Likes

Sony Megatron V4.0

Just submitted the fix for the primary colour transforms breaking the mask and muddying the colours in HDR and DCI-P3 modes.

Hopefully this should address @rafan issues and hopefully @cyber and @Wilch issues on OLEDs although this would have affected all TVs but maybe it was just more apparent on OLEDs.

I think this has brightened the image somewhat as possibly whites are a bit more white but not sure.

Anyway let me know what you think.

Thanks to @rafan (and hopefully @cyber) for his attention to detail in this as it’s really helped and is greatly appreciated.

Anyway before I jump the gun let’s see if it fixes a few things!

LCD Photos: OnePlus 8 Pro Camera: Pro Mode, ISO 200, WB 6500K, Aperture Speed 1/60, Auto Focus, 48MPixel JPEG.

5 Likes

Excellent!

Looking forward to testing this!

You’re most welcome!

Wow! Those “phosphors” look like phosphors!

2 Likes

CRT-Sony-Megatron-Sony-PVM-2730-HDR

HDR On in RetroArch/Windows, HDR On in Preset

RWGB (OLED) Subpixel Layout, 300TVL, NTSC-U

Note: the dark grey horizontal line is from the shader parameters menu.

RWGB OLED Photos: Samsung Galaxy A71 Camera: Pro Mode, ISO 100, WB 5000K, Aperture Speed 1/60, Manual Focus.

Oh yeah, it’s fixed alright!

Next stop, verifying if the Slot Mask presets work fine with OLED and if not designing one that does?

2 Likes