Haloing phosphors, test shader

This is just a proof of concept, as I think there is no screen that provides enough resolution to do what follows.


To continue the discussion started here, I just finished implementing it (roughly, but working).

The tweaked shader can be downloaded here.

Inside the archive, the test preset to be used is named koko-aio-slang/presets-test/test0.slangp
The preset is very simple; almost nothing is active and curvature is even disabled, but don’t expect this to magically clear artifacts; moirè morphs into a funky rainbow look on low resolution viewports:

Given it enough resolution, you can expect something like this; clicking will bring you to a video showing how the shadee reacts to a a black to white temporal fade:

Screenshot_20250925_132316

The involved parameters are:

The first modulates how much the halo can grow as a factor of the phosphor size (so 1.0 means nothing) , the second one is self explanatory.

  • zooming:
    If you cannot target a low enough TVL at 4k, you can try to enable the global zoom and set Zoom to a value that clears the artifacts, not very useful, but at least you can play with something; this is how i recorded the video on my poor 1080p monitor.

The test shader keeps the phosphors very slim to make room for the halo, but if you’re brave enough and want to test something more accurate like this:

Screenshot_20250925_134906

Then you can tweak the test shader parameter values as follows (basically you increase the phosphor width and reduce the halo width multiplier:

@Cyber @Nesguy

3 Likes

Yeah so far it’s just rainbows galore, lol. I’ll keep playing with it, though.

1 Like

I’ve gotten rid of the rainbows. Here are my notes from testing so far.

No moiré, different TVLs Core Resolution:

320 (good, blue phosphor enlarged in dark areas)

360 (good, blue phosphor enlarged in dark areas)

480 (very dark, blue phosphor enlarged in dark areas)

640 (good)

720 (good)

960 (good, brightest)

Phosphor halo width factor 4.20 - 5.00 seems to be useful.

Phosphor halo visibility 0.10 - 0.15 seems to be useful.

Phosphor width min–>max gamma 3.20 - 4.20 seems to be useful.

Everything has been extra dark so I had to increase my Peak and Paperwhite Luminance Settings to 1,680 each and my Contrast to 5.70.

These are my Scaling settings:

Integer Scale - On

Integer Scale Axis - Y + X

Integer Scale Scaling - Smart

Aspect Ratio - Custom

Custom Aspect Ratio (Width) - 3072 (12x)

Custom Aspect Ratio (Height) - 2160 (9x)

I briefly tested Custom Aspect Ratio (Width) 3x and it looked marvelous.

By the way, you can get away with Curvature in the Y axis without moiré using these settings. The problem with the excessive moiré seems to stem from the fact that the mask is curved as well when curvature is applied to the X axis.

Best viewed in fullscreen or zoomed in, in HDR mode or on a screen with bright settings for the full effect. You can download the .jxr files as well for proper HDR viewing.

.jxr image file with HDR image as well as SDR image with HDR to SDR tonemapping

CyberLab Kokoaio-Phosphor-Halo Test.slangp

#reference "shaders_slang/koko-aio-slang-phposphor-halo/presets-test/test0.slangp"
IN_GLOW_GAMMA = "2.000000"
GAMMA_OUT = "0.330000"
IN_GLOW_POWER = "1.000000"
SATURATION = "0.820000"
DO_PIXELGRID_H = "1.000000"
PIXELGRID_MIN_H = "0.100000"
PIXELGRID_MAX_H = "0.350000"
PIXELGRID_GAMMA_H = "4.200000"
PIXELGRID_TVL_X = "720.000000"
PIXELGRID_H_PRST = "5.000000"
PHOSPHOR_HALO = "4.999998"
PHOSPHOR_HALO_STR = "0.100000"
PIXELGRID_GAMMA_W = "3.700000"

CyberLab Kokoaio-Phosphor-Halo Test Reflections.slangp

#reference "CyberLab Kokoaio-Phosphor-Halo Test.slangp"
PIXELGRID_TVL_X = "640.000000"
GEOM_WARP_X = "0.000000"
GEOM_WARP_Y = "0.000000"
DO_BEZEL = "1.000000"
BEZEL_REFL_STRENGTH = "0.300000"
BEZEL_ROUGHNESS = "5.000000"
BEZEL_RFL_CONTRAST = "2.000000"
BEZEL_DIFFUSION_STR = "1.000000"
BEZEL_SPCL_STRENGTH = "0.250000"
3 Likes

Nice. Which core did you test? Getting some different results with SNES9x

1 Like

Thanks, I used Mesen for NES.

Ok I get it now- rainbows/moire gone.

Yeah, it’s pretty dark though, lol.

1 Like

Playing around with the scaling settings yields some interesting results.

Leaving CAR(H) at 9x and lowering CAR(W) from 12x to 10x looked nice and evenly distributed.

Lowering CAR(H) to 6x incresed the brightness significantly, while leaving the Mask and Scanlines very tight!

With that scaling setting I’m sure I can reduce my Peak and Paperwhite Luminance closer to what I’m used to…but not before playing around with BFI for a bit.

*.jxr links below

https://mega.nz/file/JMAhRarY#YDpimxIgslA74Va8GGGydN9I8Yu5w3YV5HGlY9RazkM https://mega.nz/file/sEwDyZTT#d7QVkHXA2gBAgocdKVu0eg4BO3y8XoN9briiD3FhY0A https://mega.nz/file/cYJRnTyD#8aDfy6Ydm-BWveyw8grAQ6eUPruOET1HOctschoVZfc https://mega.nz/file/dMgHiI7a#cHTR_0m7kSCI_B4RqVa2VfOKORZF50h9FAi_oODLscE

2 Likes