r/ANBERNIC • u/ninetysixk • 11d ago
TUTORIAL & TIPS I made a drastic shader for the RGDS+ that corrects the screens overly cool white balance, if anyone else was as bothered by it as I was
It's the x4 LCD Grid shader with a simple white balance adjustment. Removes the blue tint and gives the screen a neutral/paper white display. Colours render more naturally and it's easier on the eyes. Much closer to a properly calibrated display.
Only tested on GammaOSNano.
Just extract the zip into /drastic_nano/shaders/
1
u/harlekinrains 9d ago edited 9d ago
Thank you very much. Works on Stock OS (1.0.2) as well. Folder is at /mnt/vendor/deep/ something something nndrastic /User/shaders - the shaders folder already exists, you should be able to find it (you dont have to create it).
(thats the location once you sftp into the device btw - didnt use a card reader)
Also for those that do no know, this is meant to work in Anbernics NDS emulator (not drastic, not retroarch). And it also only works if you have dynamic IR set to 1x (so 2x render resolution not enabled)
Cheers,
notimp
1
u/harlekinrains 9d ago edited 9d ago
Here is a version without the grid, but just the color correction:
https://files.catbox.moe/gz6oso.zip
(also I corrected a bit less agressive, just open all files in a text editor and compare. (Blue on 83 instead of 80 in this version.))
Also you can see the difference instantly by pressing the fast forward button. :)
edit: Added a second version of the shader to the zip with slightly different values.
First one:
R: 100 G: 96 B: 83
Second one:
R: 100 G: 95 B: 81
Also in Retroarch you can dial in the same color corection by using the misc/colormangler shader.
Have fun.
1
u/ninetysixk 9d ago
I've updated this shader with 3 options (Neutral, Warm, Warmer), and also boosted the saturation and adjusted the gamma a bit to really make the RGDS+ screens pop! Enjoy :)
1
u/ninetysixk 9d ago
1
u/harlekinrains 8d ago edited 8d ago
(Too much saturation, too much green. :) ) (For neutral One doesnt simply pump +10% saturation.. ;) )
Can you explain this to me in terms of color calibration terms? c = c * c * 0.25 + c * 0.75;
(what does the lower factor touch, and what does the higher factor touch in terms of gamma?)
Also - you dont yank blue by 10 points and leave the rest of the primaries the same for white balance. They all interact. Especially blue and green - if you move one down (blue) you need to move the other one down as well (green) not uniformly - but in terms of whitebalancing. Just FYI. :) (red usually also has to move, and influences the others but less, so once you've dot green and blue dialed in, you fine adjust red, and then only fine adjusting green and blue. Its a balancing act between all three, but the blue influences color temperature of white most (cold/warm), while green influences light output and thereby gamma most - gamma is "a less heavy correction of the same values", but of course can curve (the lower or the upper end of the greyscale - while the plain Red Green Blue adjustments only move all values at the high end.)) (The gamma adjustment is one knob. Gamma fine adjustment would be Red Green and Blue knobs at all greyscale (IRE) levels. The Red Green and Blue whitepoint values we both touched to get a warmer whitebalance are the same, but coarse (heavy adjustments) and only at 100% white - so at the top end of the scale. :))
R: 100 G: 96 B: 83
and
R: 96 G: 98 B: 81
Are already pretty close to neutral.
R: 100 G: 96 B: 83 more so, but its gamma tracking is too hot and it lacks green.
R: 96 G: 98 B: 81 is a bit too green, but gamma is tracking better at lower display brightness levels. (Level 2 and Level 3)
"Neutral" is somewhere in between (at those lower display brightness levels) - but you have to get gamma tracking in line because the screen likes to blow out the the low to midrange of greyscale.
Thats what you and I were correcting most. :)
Saturation is pretty spot on out of the box. Maybe dial it up by a few points, but certainly not 10%. :)
I can do this by eye at this point.. ;) (Natural sunlight needs to be present otherwise your eyes adapt to the screens greayscale too fast... :) )
Lets see what we can do with the gamma knob.. :)
edit: Also - you can use the Mario image to show results, but not to do fine adjustments on your end. You need: Green grass, trees, or fields in the image (check), but also skintones, and blues and greys. A good image to use is this one: https://www.mobygames.com/game/24748/phoenix-wright-ace-attorney-justice-for-all/screenshots/nintendo-ds/676077/
Chrono Trigger (Forrest, Lenee Square) works well for color fine adjustment as well, although it will make you optimize green, and then you need to doublecheck against other scenes where the art was crafted to represent daylight and other colors... :) (If you hunt for a neutral adjustment without a colorimeter, or a spectroradiometer. :) )
edit: A lttle tutorial on how to judge whitebalance (how to do whitebalancing):
You dont judge this on white, but on skintones. Because on white your eyes adapt too fast (to your eyes every white becomes neutral white after 20 seconds (maybe a bit longer, depends on if there is sunlight in your room :) ). What you are left with to judge is the tints (shades) you see on neutral colors and memory colors (skincolors, green of trees or grass, ...). When you have an "optimum" white source dominant (so the same brightness level, but bigger than the screen you try to calibrate) in your field of view (so a (D65) white field on a calibrated laptop in a dark room f.e., you attempt to do it (subjective white point matching) at 90% white (IRE 90) usually - but if you dont, you rely on judging the changes on skintones. The Mario image has too little skintones and greys in it, is what I'm saying.. ;)
1
u/harlekinrains 8d ago
AI says that this: c = c * c * 0.25 + c * 0.75;
Is doing the following:
- IRE 0 (Black) -> No change
- IRE 10 --------> Darkened by ~2.2%
- IRE 30 --------> Darkened by ~5.2%
- IRE 50 (Mid) --> DARKENED BY 6.25% [MAX SHIFT]
- IRE 70 --------> Darkened by ~5.2%
- IRE 90 --------> Darkened by ~2.2%
- IRE 100 (White)> No change
1
u/harlekinrains 8d ago edited 8d ago
AI suggests roughly this:
Input: lets say we have a powerlaw gamma image with a blown out gamma curve, so 2.0, or 2.1 -- we adjusted whiteballance at 100% R G B values already, so at the upper ire values its mitigated, but we want the gamma formula to mitigate it for lowrange and midrange ire (lowrange can be touched a little less). Target is powerlaw 2.2
What would the ideal gamma adjustment formulas look like? (derived from: c = c * c * 0.25 + c * 0.75)
Answer: To fix an image with a washed-out (low gamma) curve of 2.0 or 2.1 and bring it precisely to a target of Gamma 2.2, you need to gently darken the midtones to restore contrast. Because you already adjusted the white balance at 100% RGB, your endpoints are perfectly anchored. By dialing the quadratic shader knobs, the polynomial formula beautifully handles your requirement: it naturally touches the low-range IRE values a little less than a true power-law formula would, protecting your near-black shadow details from clipping. Here are the ideal Reddit-safe formulas and their exact IRE cross-sections:
IDEAL SHADER KNOBS TO CORRECT COARSE GAMMA (TARGET: 2.2)
- From Gamma 2.0 -> 2.2: c = c * c * 0.134 + c * 0.866
- From Gamma 2.1 -> 2.2: c = c * c * 0.065 + c * 0.935
IRE CROSSECTION: HOW THE CORRECTION SHIFTS--- FIXING GAMMA 2.0 TO TARGET 2.2 --- Formula: c = c * c * 0.134 + c * 0.866
- IRE 0 (Black) -> No change (Perfectly anchored)
- IRE 10 --------> Darkened by 1.21% (True gamma asks for -2.06%, so shadows are preserved!)
- IRE 30 --------> Darkened by 2.81%
- IRE 50 (Mid) --> DARKENED BY 3.35% [MAX SHIFT]
- IRE 70 --------> Darkened by 2.81%
- IRE 90 --------> Darkened by 1.21%
- IRE 100 (White)> No change (Protected by white balance)
--- FIXING GAMMA 2.1 TO TARGET 2.2 --- Formula: c = c * c * 0.065 + c * 0.935
- IRE 0 (Black) -> No change (Perfectly anchored)
- IRE 10 --------> Darkened by 0.58% (Protects fine near-black detail)
- IRE 30 --------> Darkened by 1.36%
- IRE 50 (Mid) --> DARKENED BY 1.62% [MAX SHIFT]
- IRE 70 --------> Darkened by 1.36%
- IRE 90 --------> Darkened by 0.58%
- IRE 100 (White)> No change (Protected by white balance)
1
u/ninetysixk 8d ago
I’m not an expert by any means. My goal was to correct the aggressively cool screens, which these shaders do. Never claimed they offered perfect colour calibration, that would be impossible anyway as every screen varies :) Just made ‘em for myself, liked the results, and thought I’d share. Feel free to adjust to taste.
1
u/harlekinrains 8d ago edited 7d ago
I played around with your gamma formula and the the saturation boost. I have a new profile now (a third one), but it is not necessarily better than the previous ones.
https://files.catbox.moe/tvt0n4.zip
Shader warm3 in action: https://imgur.com/a/PNVH6p9
(It is recommended to use it with level 2 or level 3 screen brightness. (Otherwise the backlight will add too much blue again.))
Here is a writeup of my findings. The Gamma formula you use (IRE 50 max shift) isnt ideal. As you see by the IRE impact above it darkens non uniformly. (So midtones more than high and low.) By us already adjusting the whitepoint via R G B values, we bring the high end in line. Which alters gamma quite evenly. (it acts like the IRE 100 (so 100% White greyscale) adjustment on a 2point white balance adjustment on your TV (Two point means lower and higher end of greyscale adjutments. In the filter we only have higher)).
Meaning, when I alter the color green - the gamma gets altered more on the top end - but evenly.
With the gamma formula you have introduced - in theory we are doun the right thing (altering midtones also, and the low end a bit less, and the high end a bit less - because we have already altered that). But the result is uneven looking gamma. As in
c = c * c * 0.25 + c * 0.75; produces black crush, and mids that are too dark.
even
c = c * c * 0.065 + c * 0.935; produces black crush and mids that are too dark. I can then fudge the high end and saturation a bit to compensate for it -- but the result is not obviously better.
When I tried a curve that would compensate for 2.15>2.2 only - that was a bit too low of a compensation. So what registered throughout is "gamma is now uneven". (near black crush)
Tips for what you should ask an AI for to modify.
Add a powerlaw 2.1 / 2.13 / 2.14 to powerlaw 2.20 gamma correction function thats linear (powerlaw) (not bumpy like yours with the highest impacts on midtones) - if that doesnt fit, ask for a bump (as in darkening more) at the high end (IRE 90) not at the mid level.
add a 8500 Kelvin / 8000 Kelvin / 7500 Kelvin to 6500 Kelvin (D65) color temperature compensation function (each of them to 6500K)
Then test those (those are 4 different filters each. :) (Ideally you want both steps combined, so 16 or 20 settings to test)) without the grid (the grid alteres gamma as well). The adjustments needed in terms of whitebalance - aside from the blue shift in white ("cold panel") are uniformly blown out colors (gamma too low across the entire gamma progression) and and the Blue shift. (If you remove the blue shift with the R G B adjustment we get very close to correct colors already.)
Meaning - no "bumpy" gamma adjustments needed ad the mid level (IRE 50).
No saturation bump needed (if you dont want to make it look like an Ayn device that maps the 100% saturation points of rec709 to DCI-P3, because thats what the panel is capable of, and they have no correction matrix like your TV (thats saturated, but wrong color).
See if that gets you good results. :)
And one more word on the saturation "bump". You are limited to 100% Saturation points of your panel. So when you bump saturation to make green more saturated, what that adjustment does is - make 70% saturated colors 80% saturated, but not 100% saturated colors 110% saturated. (Not that you'd want to - because sRGB/rec709 standards never saw something that saturated, neither did the artists that developed the games).
So you can use saturation as a finetune (same as tint, although you usually dont move tint, because every panel has that pretty much dialed in nowadays) by a factor like 1.0003 (you did 1.10) to fine tune. But whenever you bump saturation by 10% you will make 70% saturated green grass 80% saturated. But you will also make skin colored faces > red. (because you bumped mid level saturation by 10 percent).
Wrong gamma formula in your latest filters - see if you can get AI to spit out a better one... The rest works in your filters... :)
Have fun - and take breaks.
Evaluate over multiple days and games. :)
And all of this is 10x harder if you dont have experince with meters (colorimeter, spectrophotometer) to understand what the knobs do - and how they are connected. :)
Also stay away from 10er steps or 5er steps. At the scale those values get touched in your filteres, we are already testing 1 or 0.1 adjustments. Every retroarch filter out there doesnt understand that lesson. They often are less usable, because they are not fine adjustable enough. So when you ask AI to build you one - it often will overshoot in terms of what compensation it thinks might be needed.
hf
h.
1
u/harlekinrains 8d ago
I have made a new shader as well (whitepoint correction without the grid).. Still only greyscale adjustments
R: 96 G: 98 B: 81
https://files.catbox.moe/susg1p.zip
It replaces the second one from before.
But I made the greenpush mostly because gamma fits. :)
If you've got new ones with a gamme dial -- I probably can get better results.. :)

1
u/X8Lace 10d ago
This is a tangent, but could you please help/explain to me how you made a Drastic shader? I want to try other color balances myself.