Shader Challenge: composite video on a PVM

I took a couple of shots of a screen with NTSC-Adaptive only on both LCD monitor and CRT. None of the SMB shots on the CRT came out satisfactory under present conditions, I used the Streets of Rage 2 screenshot below. Adaptive settings default, except I set to phase 3 (I forgot which is supposed to be used when, but in this case, I didn’t want to have the annoying flicker which you’ll get by default in this example).

Screenshot if you want work with it:

Streets of Rage 2-221205-201600

CRT:

Monitor:

5 Likes

Found a few composite video shots on a JVC PVM - it’s baffling how sharp and clean it looks. Trying to get any NTSC shader to look like this has proven to be quite a challenge!

Look at how sharp the “M” in “Game” is - I spent a few hours playing with the knobs and dials in guest-advanced-ntsc trying to match this before giving up. Is it possible?

(https://ctrl-alt-rees.com/2019-01-26-nintendo-famicom-composite-video-output-mod.html)

2 Likes

I can increase comb filter and erase all color that interferes to luma (eg the rainbow like in white letters)

The sharp image produced by a PVM is a piece of cake to do on a shader and requires just a few cycles to do as LCDs are already sharp and hardware bilinear filter is extremely sharp too - contrary to what people think - when ONLY used horizontally.

3 Likes

Looks good! Settings?

1 Like
shaders = "2"
feedback_pass = "0"
shader0 = "shaders_glsl/ntsc/shaders/ntsc-simple/tiny_ntsc.glsl"
alias0 = ""
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"
shader1 = "shaders_glsl/crt/shaders/CRT-Beam.glsl"
alias1 = ""
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
filter_linear1 = "true"
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
comb = "1.000000"
lpf_w = "0.250000"
c_lpf = "0.200000"
y_lpf = "0.600000"
Scanline = "0.500000"

I run it on a window to keep integer for crt-beam, having written these i know them inside out, i could slot a gaussian falloff scanlines there to scale in whatever resolution perfectly (crt-geom does that).

2 Likes

Ah, I was trying to do this within guest-advanced-ntsc because it does some other things I like. Your shader looks a lot simpler, though, and the result is good. I’ll give it a spin. Thanks!

2 Likes

Yeah i always squeeze them to run on modest hardware lol. So i avoid those fancy exp(), pow(), multiple texture reads and all that. The heaviest i ever did was crt-consumer, go figure.

2 Likes

Has CRT-Beam been ported to Slang?

1 Like

No there was no demand, so i never bothered. I do a lot of experiments on NTSC, and tiny CRT shaders that do a lot more than their weight etc, things that i find interesting and a challenge.

2 Likes

There’s definitely a use for it - I’ve spent hours trying to recreate this particular look in guest-advanced-ntsc.

So I’d definitely use it, lol. I’d love to see your take on a lightweight shader for 4K displays with HDR, as that’s what I’m currently using.

2 Likes

I think it’s highly possible. These are from my Sony Megatron/CRT-Guest-NTSC Hybrid miniLED Preset Pack but prior to releasing that I was matching presets with CRT-Guest Advanced-NTSC. The differences ended up being miniscule. Since making these, I’ve went on to make other NES miniLED Epic presets which actually were a bit redundant because my previous NES shaders employed no smoothing shaders, while my Epic shader stack has a smoothing shader in there. I was able to dial settings down to where the smoothing didn’t have much if any effect.

2 Likes

That’s looking pretty good! I’ll have to give this a try.

Is this achievable within guest-advanced-ntsc by itself?

Edit: Ok, so not using negative adaptive sharpness was really holding me back. That may be the solution to everything :joy:

1 Like

The more you complicate things the harder it gets when the solution is simple lol.

That PVM look is even achievable on 720p and integer scaling. Check crt-potato-bvm on integer 5x, you can do about the same on 3x, add some tiny pixel filter horizontally and call it a day. The trick is that PVM-BVM have crazy high vertical sharpness and resolution, so bright and dark lines have BIG difference in dynamics.

2 Likes

Quick fix for very sharp edges with crt-guest-advanced-ntsc is to lower internal resolution parameter.

Works very nice:

Good thing about it is also that dithering gets resolved.

4 Likes

Here are some photos, since screenshots aren’t real and because RA crashes whenever I try to take a screenshot :stuck_out_tongue:

2 Likes

I admit, I’m more familiar with CRT hardware than the nitty-gritty of shaders. But the waterfall blending in Sonic 1 is mainly a result of the Genesis’ particularly poor composite encoder. In other words, if you play Sonic Jam (Saturn port of Sonic 1) on a composite signal, then you won’t get the blended waterfalls unless it’s an extremely old TV even by CRT standards. So, wouldn’t that mean you couldn’t really have a “one shader fits all” solution? Unless shaders can be programmed to adapt themselves depending on the console.

3 Likes

Correct, a one size fits all solution is impossible.

Each console had it’s own unique composite output, and then each CRT had different comb filters, etc.

@DariusG has at least tackled the console part of the equation. The next step would be emulating the specific characteristics of particular comb filters, but that would be extreme accuracy, and not necessarily the best from the standpoint of pure image quality (it would be cool to see, though).

2 Likes

The Mame HLSL shader (ported to Retroarch) allows this to some degree, though I don’t know if it has quite enough flexibility to cover all the bases. E.g. there’s the “notch filter width” parameter, but nothing about comb filters. I’ve mostly used it to generate artifact colors for computers, others used it for Megadrive/Genesis effects (hence that preset in the NTSC folder).

2 Likes

Do note that there are distinctions among “Shaders”, “Shader Presets” and “Shader Stacks/Pipelines”. Not sure exactly which one you’re referring to.

The current NTSC Adaptive and further evolution of it in CRT-Guest-Advanced-NTSC currently does account for varying console video output scenarios.

It automatically selects 2 phase or 3 phase and merge fields on or off.

Then there’s the interlacing stuff which can also be enabled automagically.

While it may not yet account for all the differences between console output, remember this is an area which is always improving and evolving as more is learned and discovered. We’re seeing some newer developments in @DariusG’s shader at the shader level.

While the current state of development might mean that there’s currently no one-size fits all shader program, you can achieve the same one size fits all setup at the Shader Preset/Front end setup level which would basically do the same thing.

What I mean is that while you can’t yet load one slang shader or preset that does it all, you can have several shader presets which have been tweaked and optimized to take into account these differences we’re speaking about.

Each of these presets can then be saved as Core/Game/Directory presets in RetroArch and this would allow for them to be automatically loaded when you switch systems.

So maybe not one shader or shader stack but definitely one shader preset pack/collection can be designed and adapted to fit all or at least many different scenarios.

This was exactly what I set out to do when creating my “Console Specific” presets. Now every preset I create is console specific. Of course there’s nothing preventing one from using any preset with any Core.

So unless the Saturn Core automatically Triggers 2 phase to be On and Merge Fields to be Off, the rainbow and transparency effects are not going to look like the Sega Genesis Model 1’s poor Composite Video Output.

By the way, you can also accomplish a similar setup using Video Filter presets instead of or in addition to Shaders/Shader Presets.

2 Likes

maybe we need the core to output some info to the shader if the resolution is not enough, info like if it PAL or NTSC (and even SECAM), also it will be better if it tell the sub-type of these like PAL-N and NTSC-J

and console system type (IIRC NES and genesis that has special form of composite signals)

1 Like