Looking for a color changing based on LUT textures shader

Hi, I’m looking for a color changing based on LUT textures and chromatic aberration shaders Perhaps it already exist but I don’t found any one in the shaders directory

I would mainly use LUTs for black & white handhelds systems and for slightly adjust colors on any system in fact :slight_smile:

I have good results with the Reshade shaders but i would like to use Retroarch ones so I could easily make differents CGPs with differents configurations

Thanks !

By the way, Reshade has pretty cool shaders that would be nice to be converted. For example it has “Magic bloom” which is a dynamic bloom. The intensity varies according to the luminosity of the picture so a dark image will be heavily bloomed and a bright one won’t be !

The image-adjustment and color-mangler shaders in the misc directory should do anything you need with colors, but I guess you’re looking for a tonemapping shader instead?

Thank you for your quick answer color mangler and image adjusment are great but I’m looking for changing colors with a lut texture so I can do my (more or less complex) simulations with a photo editor software and have nearly the same results with the shader.

It is also easier to colorize black and white games with this technique. Here’s an example with Klonoa on Wonderswan

and another with samurai shodown ! on neogeo pocket using a custom overlay

It’s also an interesting way to change the “not so great” colors of certain games

okay, how are the LUTs generated? Is there any reference code for what you’re wanting to do (e.g., from ReShade or whatever)?

What I tipically do for creating LUTs is using photoshop or krita (others can do the job of course) I open a RA vanilla screenshot then i adjust my settings with adjustment layers ( curves, gradient map etc…) When it’s ok I copy these layers or settings to the lut texture. It’s that simple.

I know that this shader is more memory and gpu intensive but the results are really great

the lut texture can be found here : https://github.com/crosire/reshade-shaders/blob/master/Textures/lut.png

and the reshade shader is here :

Ok, that should be doable. Do you have a LUT and a screenshot that I can use for reference? to make sure it works correctly? The more obvious the better.

EDIT: nvm, I think I got something going. Check out reshade/lut. I have slang and GLSL versions and will probably do a Cg version tomorrow. It’s pretty flexible in that it works with 16x16x16 LUTs by default, but there’s a runtime parameter to change that to anything between 16 and 64 (higher numbers mean bigger LUTs and higher precision; this should be automatic but the LUT size isn’t getting passed to the shader properly for some reason…). There are “passthrough” LUTs (that is, little or no change) for 16 and 32 that you can work from to make your own LUTs and a fun 17x17x17 “schindler’s list” effect I found online (be sure to tick the runtime parameter up to 17 once you load it).

Sorry for the delay but while I was doing my tests for you I realized that pure black doesn’t work well and I wanted to know why. I’ve found that this bug occurs with the OLG driver but not d3d

here’s my custom lut

here’s the reference picture : Tetris and LOZ Oracle of Seasons intro using Gambatte core without color correction The original, what I expected and what I get.

Whoops, looks like the 32x32x32 base LUT was malformed. I replaced it with one that seems to work as expected, along with a 64x64x64 LUT for very high precision.

Let me know if the new one gives you trouble, too.

1 Like

Wow ! Thank you ! I was previously talking about my results with reshade. I didn’t see you’ve edited your last post and that the convertion was already done. I’m so grateful. Everything seems to work fine but I will continue to test with different confifurations. I hope I’ll can do more that just have fun with it. :slight_smile: All this possibilities in just one pass !

It’s not exactly the same as the reshade one (I found some code elsewhere that worked similarly but made more sense to me), so existing reshade LUTs may or may not work.

Here’s one for CMYK colorspace, in case someone wants to make fake magazine photos :slight_smile:

1 Like

There was another Cg shader that changed colors based on a LUT, but the texture for that was really big (4096x4096 PNG).

Yeah, the size of the LUTs made that one unwieldy. These LUTs are just a few kb at most, as apposed to ~15MB each.

Here’s some LUTs to colorize B&W games. I’ll post other ones if people are interested.

@hunterk Do you plan to do a CG version ? A lot of GLSL shaders doesn’t work for me like borders and overlays. I’d like to add special matrix and lightning effects Thanks again for what you have done

Cg version is done, let me know if you have any issues with it.

What problems do you have with the borders in GLSL?

Sorry for the delay, I never tested on another computer but In GLSL, shaders in the “borders” directory don’t work. the picture is zoomed and truncated and no borders are displayed. I never tested all of them but each time I try that doesn’t work,

The CG version seems to work well. On both CG and GLSL I have to set the shader scale to 1 manualy.

However i don’t manage to combine a border then your lut shader… :frowning:

Finally i managed to do it, (obviously it was my fault)

I achieved this using a custom gambatte palette, an overlay with inner shadow and matrix grid using the border shader then the LUT shader for levels and color adjustments. I also added some reshade shaders Chromatic aberration, blur ( a bit ) and magic bloom. I’ll test with other palettes, this one is cool but it makes me feel nauseous ! :slight_smile:

2 Likes

looks good! that metroid pic looks especially nice.

1 Like