LUT Resolution is Causing Problems

More
3 months 3 weeks ago - 3 months 3 weeks ago #1 by canceralp
LUT Resolution is Causing Problems was created by canceralp
I noticed something strange. When I use any LUT shader with a higher than 50x50x50 resolution, contrast slightly changes. I tried all the neutral LUT pngs from Textures folder and also tried creating various sized LUTs with Lightroom's LUT creator. I'm using GIMP to only cut and export LUT files as PNGs and apply no compression. I also save it in RGB8 and retain Gamma and Color values. Here is what I found so far:

LUT sizes from 16x16x16 to 50x50x50   =  Pass throught works perfectly, no color or coantrast change.
LUT sizes from 51x51x51 to 60x60x60   =  Pass Through is slightly different, colors are same but contrast is very slightly higher
LUT sizes from 61x61x61 to 64x64x64   =  There are artefacts where it should be black, it is dark brown-red-ish color.

I have created 16, 24, 32, 40, 48, 50, 51, 52, 56, 60, 61, 64, 128(this one crashed the game) sized LUTs with Lightroom shader, and also tried the prebuilt LUTs from the Textures folder, including the 512x512 one from pd80.

Intrestingly, my screen is 2560x1440. That means, 50x50x50 LUT should be 2500x50. This is the biggest LUT which fits into the screen boundries without stretching. 51x51x51 is slightly bigger and this is where the problems start. I tried to increase the resolution to 5K with AMD VSR and Reshade sees the resolution but the results were the same.

edit: typo
Last edit: 3 months 3 weeks ago by canceralp.

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #2 by canceralp
Replied by canceralp on topic LUT Resolution is Causing Problems
Here is an example of the problem:
imgur.com/i1jLdzD

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #3 by canceralp
Replied by canceralp on topic LUT Resolution is Causing Problems
I have found the problem and solution. I downloaded a base 512x512 LUT file from "This site" and converted it into a 64x4096 file with GIMP. I repeated every step and this one works.

I don't know why or how but;
1) Any LUT generated with Lightroom, which is greater than 51x51x51 is slightly different
2) Any LUT generated with Prod80_02_LUT_Generator shader is also slightly different
3) An external LUT file from the page I have given the link above is pixel perfect!

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #4 by canceralp
Replied by canceralp on topic LUT Resolution is Causing Problems
edit: yesterday I thought I found the solution by downloading another base LUT from another site but I noticed the problem is still there, only less visible.


I started to believe that, double interpolation due to scaling is to blame. LUTs are not covering all the possible colors by their nature (that would take a 256x256x256 or 4096x4096 LUT PNG) and all values between two LUT pixels have to be calculated by interpolation. Once the LUT file size is greater than the screen resolution, it is interpolated first to fit the screen, then is read. So, the interval values are calculated twice. I believe this causes the problems and what we need is a 3D LUT file at the shape of a square. Maybe a 512x512 one like Photoshop or even a flexable file that can go up to 4096x4096.

Please Log in or Create an account to join the conversation.