Koko-aio shader discussions and updates

Here’s my take on a Virtual Boy preset based on closeup photos, and “technical details” of the real thing; to the best of my ability / knowledge. I also tweaked the ambilight feature to look good in a balanced way between bright vs dim scenes:


Refrences (resourcess and camera shots online are a mess):


I made a PR request if koko finds it suitable.

Here’s the preset, save it as VirtualBoy.slangp and copy it into “koko-aio/Presets_Handhelds-ng”.

VirtualBoy.slangp
#reference "../koko-aio-ng.slangp"

IN_GLOW_GAMMA = "2.20"

DO_CCORRECTION = "1.000000"
	TEMPERATURE = "7200.000000"

RESSWITCH_SYNC_SPEED = "1.000000"

DO_IN_GLOW = "1.000000"
	IN_GLOW_BIAS = "0.000000"
	IN_GLOW_SPREAD = "1.500000"
	IN_GLOW_SPREAD_SHARPNESS = "1.750000"
	IN_GLOW_W = "-1.050000"
	IN_GLOW_H = "-1.050000"
	IN_GLOW_WARPSHARP_X = "0.400000"

TATE = "2.000000"

MIN_LINES_INTERLACED = "0.000000"

DO_PIXELGRID = "1.000000"
	DO_PIXELGRID_H = "0.150000"
	DO_PIXELGRID_W = "0.000000"
	PIXELGRID_H_PRST = "2.000000"
	PIXELGRID_Y_MASK = "0.000000"

DO_HALO = "1.0"
	HALO_POWER = "0.500000"
	HALO_SHARPNESS = "3.999999"
	HALO_GAMMA_OUT = "1.150000"
	HALO_VS_SCAN = "1.000000"

DO_BLOOM = "1.000000"
	BLOOM_MIX = "0.360000"
	BLOOM_SIZE = "1.000000"
	BLOOM_GAMMA = "5.000000"
	BLOOM_OVER_WHITE = "0.000000"

DO_CURVATURE = "1.0"
	GEOM_WARP_X = "0.000000"
	GEOM_WARP_Y = "0.000000"
	GEOM_CORNER_SMOOTH = "800.000000"

DO_GLOBAL_SHZO = "1.000000"
	GLOBAL_OFFX = "0.0"
	GLOBAL_OFFY = "0.0"
	GLOBAL_ZOOM = "0.829000"

DO_AMBILIGHT = "1.0"
	AMBI_FALLOFF = "2.000000"
	AMBI_POWER = "0.150000"
	AMBI_SMP_INT_OFFSET = "0.100000"
	AMBI_STRETCH = "1.000000"
	AMBI_STRETCH_VERTICAL = "0.500000"
	AMBI_GAMMA = "2.500000"

DO_VIGNETTE = "1.000000"
	V_SIZE = "1.000000"
	V_POWER = "1.00"
	V_SHAPE = "1.000000"
	UNIFORMITY = "1.000000"

DO_SPOT = "0.000000"

ASPECT_X = "12.0"	
ASPECT_Y = "7.0"

DO_DYNZOOM = "0.0"
1 Like

Looks good! I’ll check it asap, but I think you made the PR to your own repo by mistake.

Do not bother with that, I’ll add it to the main repo.

Handhelds category or… what? lol.

1 Like

Oh my bad!

Lol. The Virtual Boy is indeed a different beast. But let’s go with handhelds as it leans more towards portability (with neck problems).

1 Like

They are colorized by the content as well :wink:

Also, I think (if my memory serves me well) they are also driven by the specularity parameter in the bezel section, so you can fade them away.

I tweaked my old Game Boy palette parameters to be more “accurate” instead of blind vibes. These look nice with Duimon’s default room lighting:

Game Boy DMG screen
DO_CCORRECTION = "1.000000"
IN_GLOW_POWER = "0.450000"
CONTRAST = "-0.250000"
BRIGHTNESS = "0.030000"
COLOR_MONO_COLORIZE = "1.000000"
COLOR_MONO_HUE1 = "0.100000"
COLOR_MONO_HUE2 = "0.270000"
COLOR_MONO_HUE_BIAS = "0.450000"
GAMMA_OUT = "0.500000"
SATURATION = "0.800000"
GAMMA_OUT = "0.500000"
ADAPTIVE_BLACK = "0.0"

Game Boy LIGHT screen
DO_CCORRECTION = "1.000000"
IN_GLOW_POWER = "1.899999"
CONTRAST = "-0.320000"
BRIGHTNESS = "0.000000"
COLOR_MONO_COLORIZE = "1.000000"
COLOR_MONO_HUE1 = "0.550000"
COLOR_MONO_HUE2 = "0.420000"
COLOR_MONO_HUE_BIAS = "0.700000"
GAMMA_OUT = "0.500000"
SATURATION = "0.500000"
GAMMA_OUT = "0.500000"
ADAPTIVE_BLACK = "0.0"
8 Likes

Hi @kokoko3k could you please add an option that makes the backdrop image follow the global shift / zoom instead of its independent shift / zoom?

This would simplify / unify things across presets with varied global shift / zoom levels.

Thanks for the great shaders. I’m looking for a solution to something but I haven’t been able to find it maybe because I’m dumb. For some reason when I enable persistence of phosphors, the screen will turn black when theres a ‘scene’ change in some games. Mostly NES titles. This doesn’t happen in the version bundled with retroarch, only the latest release 1.9.85. For now I just keep it disabled but it would be nice to be able to use in the future. Everything else runs nicely though!

You know how I see those kind of things, shader would process that flag for every pixel in each frame, where a copy/paste per preset does the same job; I’m afraid it’s a no :frowning:

Latest release is the same as retroarch, maybe you didn’t updated the slang shaders (don’t do lol, or make abackup first).

Could you please tell me a method to reproduce the issue? Maybe an intro of a game?

I forgot to mention I’m using the steam version of Retroarch. I just found out I can replace the exe to renable updating within Retroarch. With that said, I have confirmed that this happens only in the latest koko release and not the outdated one I had that came with Retroarch. The black screen happens with every NES game I’ve tried which includes Ninja Gaiden, Megaman 2 and Dr. Mario. It also happens with some Genesis games, namely Contra Hard Corps. The black screen can occur by simply booting up with the shader loaded. I’m using the immersive preset. I can hear the game and even the bezels are working. Reloading the shader returns the screen to normal visibility and function. When selecting and moving on to a new ‘screen’ or ‘scene’ for instance going from the start menu into a level, or from one level to another level, screen turns black again. Reloading the shader fixes the problem again. I can also load the game perfectly fine without the shader, then load the shader and said screen change will trigger the bug again. All of this only occurs while persistence of phosphors is enabled.

If it’s too much on the code side then understandable.

But know that this is not an easy copy-paste job on the setup side, because if I want a specific backdrop image to look consistent across the many presets and packs available now or in the future, then I have to edit those entire packs. And since some packs are not my work (or any regular user’s) then I can’t fix the backdrop shift / zoom and forget it. The packs will get updated and whatnot. So I usually resort to making semi-custom versions of presets I modified, for example in Duimon’s pack there’s “Presets” and my “Presets_custom” etc…

With Arcade backdrops this is not a big issue, a few custom arcade specific fixes or presets is fine, but with something like a global reflection or diffuse or scratches, it sounds like a nightmare unless I make a compromise on the image file side so it looks neutral or good enough with any shift/zoom.

In my opinion, the backdrop did not need a dedicated shift zoom to begin with, since we can (and should) design the original backdrop image to fit a specific aspect ratio beforehand, like 4:3 for arcade games.

I used to play with those dedicated shift zoom params but I found it better to setup things in Photoshop before hand to keep them consistent across koko-aio and Mega Bezel too.

Btw, if someone is converting mame lay artworks to shader presets I have a Photoshop script that can assemble the lay for you like it would appear in mame. So you can easily know what goes where.

If I understood well, you asked for a flag to use some parameters values in place of others -> copying values from a parameter to another is what you’d need to do for each the preset, so something that translates:

PAR1 = VAL1
PAR2 = VAL2
PAR3 = VAL3

To

PAR1 = VAL1
PAR2 = VAL2
PAR3 = VAL3

PAR4 = VAL1
PAR5 = VAL2
PAR6 = VAL3

How many presets are we talking about?

While it still doesn’t look like a shader task, a python script would do the trick nicely; would be ok?

1 Like

Oky, before I start to dig into this, could you please check the very latest development version?

https://github.com/kokoko3k/koko-aio-slang/archive/refs/heads/main.zip

-edit-

I tried with the latest dev version and with the one shipped by the latest retroarch, but I couldn’t reproduce the issue.

Tried on Linux with: intel igp, nvidia 4060, vulkan, GLCore but never been able to reproduce.

What’s your gpu? What Retroarch video driver? Vulkan? GLCore? Please avoid D3D10,11,12.

No problem koko, I’m figuring this out right now and making workarounds. I also discovered that for the backdrop Y & X I need a mirrored value of the global Y & X.

For example if the global y = 0.5 Then the backdrop y must be set to = -0.5

Also, the backdrop does not tilt, it seems.

Oh, I forgot that rotated games will need a swap between x /y, instead of mirroring the global x/y. So we take the global x as it is, and give it to backdrop y, and vice versa.

That image is aimed to reflections or cabs with mirrored trick, so rotations, tilts won’t apply.

the documentation is indeed misleading, i’ll need to correct that.

1 Like

@Starman99x @kokoko3k This is the sort of thing I made presetgen for:

It lets you decouple parameters from shader chains and also split up chains into different ‘pipelines’. This makes updating presets much easier because I don’t have to copy and paste a value on like forty presets just because I want to change one thing around.

It is in need of some updates (like being able to override a parameter directly in an input file as a one-off) but it works well enough for me. If you have any questions you can feel free to ask in that thread.

3 Likes

I finally got it to work! I ended up using Retroarch standalone and updating from within there. Any manual attempts to update the shaders did not work.

For recordkeeping I’m on W11, AMD Ryzen 7 5700X3d, nvidia 4070, vulkan. For me, GLcore is completely unstable and flickering mess. Can’t even navigate the home retroarch menu with nothing loaded. The latest dev version you linked always showed a black screen, even if I reloaded the shader. I tried putting koko in its own folder in the slang shader directory separate from the bezel folder. I also tried using Retroarch standalone and manually copying and pasting the latest shaders. Only the online updater from standalone worked. One thing I noticed is the older working shader bundled with retroarch did not have red or green decay multiplier options under the persistence of phosphors. Not sure if that might be relevant. Anyways thank you for your time and effort.

1 Like

That’s problematic, because it will be released at one point and it works fine here.

I’ll need to try with a windows machine and nvidia.

The updated version from standalone has the rgb separate decay times btw, do you confirm?

The updated version from standalone has the rgb separate decay times btw, do you confirm?

Yep, confirmed. I even tried different values on them to check that I wasn’t going crazy or getting things mixed up. Indeed they worked, and no black screen when the scene changed.

I tried with the very latest dev version on a Win10 machine running the latest retroarch, ninja-gaiden and Mesen core, with Vulkan and GLCore output drivers on an nvidia-1660 and everything worked flawlessly, so I’m officially out of ideas.