Real GBA and DS-Phat colors

So with your shader, I could go with this for the gba:


parameters = "display_gamma;target_gamma;overscan_percent_x;overscan_percent_y;sat;lum;contrast;r;g;b;rg;rb;gr;gb;br;bg;blr;blg;blb"
display_gamma = "1.400000"
target_gamma = "2.200000"
overscan_percent_x = "0.000000"
overscan_percent_y = "0.000000"
sat = "1.010000"
lum = "1.000000"
contrast = "1.000000"
r = "0.740000"
g = "0.680000"
b = "0.680000"
rg = "0.085000"
rb = "0.085000"
gr = "0.245000"
gb = "0.245000"
br = "0.000000"
bg = "0.245000"
blr = "0.000000"
blg = "0.000000"
blb = "0.000000"

This one is for nds:


parameters = "display_gamma;target_gamma;overscan_percent_x;overscan_percent_y;sat;lum;contrast;r;g;b;rg;rb;gr;gb;br;bg;blr;blg;blb"
display_gamma = "1.800000"
target_gamma = "2.200000"
overscan_percent_x = "0.000000"
overscan_percent_y = "0.000000"
sat = "1.040000"
lum = "1.000000"
contrast = "1.000000"
r = "0.750000"
g = "0.690000"
b = "0.800000"
rg = "0.060000"
rb = "0.060000"
gr = "0.220000"
gb = "0.100000"
br = "0.000000"
bg = "0.245000"
blr = "0.000000"
blg = "0.000000"
blb = "0.000000"

So far, this extended image adjustment shader is good. It can reduce the white overlap limit and does the gamma better than what other gamma shaders could do.

Edit: I got some news related to the real GBA hardware. If you put it at direct sunlight, it looks near to nds shader while being slightly darker, and took photos and videos of it. I have to put a pic of it. Everyone saying about the blue-purple and yellow-green on some shades is somewhat true when put on direct sunlight. Maybe games like castlevania looks better on sunlight. Itā€™s just a non modded GBA screen.

Iā€™m not sure I have applied them correctly, but your accurate colors with lcd-grid make for a hell-of-a-beast screen emulation. What I find strange though, is that lcd-cgwg (https://github.com/libretro/common-shaders/blob/master/handheld/lcd_cgwg/lcd-cgwg.cgp) is expecting motionblur-simple to be ran alongside. I find that strange as it is said the original GBA does not suffer from motion blur.

I might have applied it wrongly, though, as the textures with motionblur-simple become blurry without movement using ā€œdonā€™t careā€ for scale, but not using ā€œ5xā€.

Still, I love the effect of lcd-grid, and I couldnā€™t go without these accurate colors. Iā€™m left wondering if this and lcd-grid on top mimic the real thing (quite close enough), and about the possible superflousness of motionblur-simple.

The GBA screen definitely suffered from ghosting resulting from the poor response time. It also seems to have used some sort of looks-like-interlacing trick (darkening every other scanline on every other frame, according to a thread on nesdev) to lessen the impact.

OTOH, itā€™s an undesirable effect, and if itā€™s not required for functionality in any games, you can probably let it go without losing too much authenticity.

These statements make sense.

For reference, here are the combinations and their results:

But if in between them the motionblur is added (also set to ā€œdonā€™t careā€), it gets somewhat washed out: http://i.imgur.com/JY4eOto.png

And if the ā€œscaleā€ setting of that 4th pass (being motionblur) is set to ā€œ4xā€ (although integer fullscreen on the 1080p ā€“ here ā€“ scales 6x), the wash out diminishes and everything becomes nicer: http://i.imgur.com/dKGH0Fx.png

EDIT: I donā€™t know if itā€™s just the way Iā€™ve configured it, but the motion-blur shader gave me motion sickness ā€“ and, Iā€™m not normally prone to that. If thatā€™s the way it is, Iā€™m not recommending it.

Great work Pokefan, you must be getting tired of doing those settings again with every method possible. :slight_smile:

I updated the pack with the border/lcd-grid/2x to 6x. You have LUT and no LUT method (with Hunterk image adjustment shader).

I reduced the LUT version contrast a bit to make it similar to the noLUT version (and because many games donā€™t need the high contrast I used before). You can change it anyway in the shader options.

For the noLUT shader I added a second image adjustment pass after the lcd-grid to push the luminance (canā€™t do all with just 1, did some tests and it was bad).

Getting those results:

GBA colors (shader method) / noLUT LCD / LUT LCD

The noLUT has greener blue (you can adjust it though) a bit more imprecise gradient, is a bit harder to adjust depending of games (if you want to push/lower the contrast). That said itā€™s probably the closest to the original GBA screen from what I could see (people making decent videos on youtube, they are few! and itā€™s hard with this poor screen).

I still prefer the LUT as an ā€œideal screenā€ rendering. Youā€™re free to disagree. :stuck_out_tongue:

The difference gets bigger sometimes:

GBA colors (shader method) / noLUT LCD / LUT LCD

Well, youā€™re always free to spend hours tweaking with all the options we have now.

Newer version here

I just uploaded the new version only with hunterkā€™s extended image adjustment, modified by me to apply the color matrix. Added gba-shader-high.cg to replicate how the gba looks like when put on sunlight like how I mentioned last post. Will post pics comparing it with real hardware soon. Also included the .cgp lcd variants too.

I also kept my old LUT package incase if people want to use it for better dark contrast. I will keep the link for it because of advance reasons on contrast on certain games, like what Tatsuya79 stated.

As for the new shader, i want to thank hunterk for finding an advanced image shader, which help me create the LCD shaders for both, gba and nds.

My pleasure :slight_smile:

Youā€™re doing great stuff here. Iā€™m glad I could help.

Tried the GBA ā€œhigh versionā€. Itā€™s getting a bit of that fluorescent tint of the unprocessed picture. I think thatā€™s a bit too much.

The DS shader is awesome, an improvement over the LUT: more contrast, deeper colors, really good settings. Great work.

[QUOTE=Tatsuya79;22877]I still prefer the LUT as an ā€œideal screenā€ rendering. Youā€™re free to disagree. :stuck_out_tongue:

The difference gets bigger sometimes:

GBA colors (shader method) / noLUT LCD / LUT LCD

[/QUOTE]

I probably am the farthest thing away from an expert on this, but doesnā€™t it just looks like over-luminance in the LUT-less shot?

EDIT: although I am thoroughly happy with the results ā€“ Iā€™m not even feeling like using the image-adjustment pass here, strangely!

[QUOTE=twipley;22901]I probably am the farthest thing away from an expert on this, but doesnā€™t it just looks like over-luminance in the LUT-less shot?

EDIT: although I am thoroughly happy with the results ā€“ Iā€™m not even feeling like using the image-adjustment pass here, strangely![/QUOTE]

The ā€œGBA colorsā€ shot is just Pokefan settings, I didnā€™t push the luminance there. You can see in the noLUT shot, where I pushed the luminance to make up for the LCD pass loss, it is quite similar in the end.

This kind of low contrast feeling is just how the real GBA screen was, a cheap LCD. Itā€™s hard to make a strong contrast from that, the LUT does it a bit: it regains a bit of deeper colors here and there, but still leaves some parts a bit washed-out, with variations from games to games depending of what their makers did.

[QUOTE=Tatsuya79;22902]The ā€œGBA colorsā€ shot is just Pokefan settings, I didnā€™t push the luminance there. You can see in the noLUT shot, where I pushed the luminance to make up for the LCD pass loss, it is quite similar in the end.[/QUOTE] Hmm. I was actually comparing both LCD versions. Iā€™m not informed enough on these matters to distinguish between contrast and luminance.

Oh well. Nice stuff!

I updated the package for gba and gba-high to adjust it a little. I made some comparison of the hardware with the lcd shaders. However, the camera is somewhat challenging to capture, but in vision, the output looks more identical to the right when put in direct sunlight. The last snapshot was from a youtube video, and I had to color correct it to try to match.

http://imgur.com/GvXMITt (Left - gba-shader / Mid - capture / Right - gbahigh-shader) https://www.youtube.com/watch?v=pC1HNYNg04I

Iā€™d just keep both shaders and the LUT for your preference on display. Sometimes, the hardware looks like the left depending on the lighting and probably gba-sp.

The new ā€œhighā€ is better. Itā€™s like the standard shader at 1.6 gamma, but it keeps the colors from turning pale. Great for Castlevania 1, Metroid, etc.

It can be a bit aggressive on the lighter tones though.

but old is gold

I should point out that I made a revised LCD shader, which I posted on the old byuu forums before they were wiped. Iā€™ve converted it to Cg for RetroArch and posted it here.

It includes parameters for specifying the three primary colours, a toggle for BGR layout, and a four-parameter tone curve:

f(x) = (gain * x + blacklevel)^gamma + ambient

which is admittedly more realistic for a CRT, but is still fairly flexible.

If one were serious about simulating the colours on a particular model of GBA or DS, the ideal way would be to measure the primary colours and their tone curves using a colour meter.

[QUOTE=cgwg;23020]I should point out that I made a revised LCD shader, which I posted on the old byuu forums before they were wiped. Iā€™ve converted it to Cg for RetroArch and posted it here.

It includes parameters for specifying the three primary colours, a toggle for BGR layout, and a four-parameter tone curve:

f(x) = (gain * x + blacklevel)^gamma + ambient

which is admittedly more realistic for a CRT, but is still fairly flexible.

If one were serious about simulating the colours on a particular model of GBA or DS, the ideal way would be to measure the primary colours and their tone curves using a colour meter.[/QUOTE]

Awesome, thanks for posting it. Donā€™t hesitate to mention any new shader you make on this forum, I really like what you do.

I see it fixes an issue I noticed with the old version (or the conversion perhaps) where youā€™ll sometimes get a thin black vertical bar on the left of the screen, depending of the resolution / multiplier you use. It lost the Grid setting though, not that I changed it a lot anywayā€¦

Gonna check it moreā€¦ :slight_smile:

Woah, looks nice!

Suppose one just wants to pair up pokefanā€™s accurate colors with cgwgā€™s (welcomed!) revision (lcd_cgwg_2.cg),

would the following cgp-file code be right?

shaders = "2" 
shader0 = "gba-shader.cg" 
filter_linear0 = "false" 
scale_type_x0 = "source" 
scale_x0 = "1.000000" 
scale_type_y0 = "source" 
scale_y0 = "1.000000" 
shader1 = "lcd_cgwg_2.cg" 
filter_linear1 = false 
scale_type1 = "viewport" 
scale1 = "1" 

[QUOTE=twipley;23024]Woah, looks nice!

Suppose one just wants to pair up pokefanā€™s accurate colors with cgwgā€™s (welcomed!) revision (lcd_cgwg_2.cg),

would the following cgp-file code be right?

shaders = "2" 
shader0 = "gba-shader.cg" 
filter_linear0 = "false" 
scale_type_x0 = "source" 
scale_x0 = "1.000000" 
scale_type_y0 = "source" 
scale_y0 = "1.000000" 
shader1 = "lcd_cgwg_2.cg" 
filter_linear1 = false 
scale_type1 = "viewport" 
 

[/QUOTE] I would remove the scale1 line (as in the quote). Just let it scale automatically, works OK usually.

thanks! :slight_smile:

please lengthen your message to at least 10 characters.

The new LCD is great. Itā€™s a lot crisper. Each pixel is a lot more separated from every other, the grid is thicker. It makes for a slightly darken image but with the gain option that doesnā€™t matter much.

The non integer scaling is perhaps a bit better? Iā€™m not sure. In this scenario a gain above 1.2 makes it obvious though, you donā€™t want to go there.

I played a bit with the RGB settings and they are quite different from the image adjustment pass as they change the sub-pixels and not the whole image I guess. Are you trying to use them Pokefan? (just asking as in that case Iā€™d better wait to update my cgps if you release something different soon)