1D LUT for ReShade

Home Forums Help and Support 1D LUT for ReShade

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #3996

    Pneumatic
    Participant
    • Offline

    Hello

    I would like to make a simple 1D gamma correction LUT with a custom white point, and use it in ReShade.   Is it possible?

    The reason I do not want to make a full 3D LUT is because my colourimeter is not accurate enough for it (i1d2) and it ends up looking worse.

    I have found that the best result from the i1d2 comes if I pick a custom white point that looks neutral to my eyes, and then calibrate a 1D LUT to that white point.

    Thank you!

    #3999

    Florian Höch
    Administrator
    • Offline

    Hi,

    I would like to make a simple 1D gamma correction LUT with a custom white point, and use it in ReShade. Is it possible?

    With a small roundtrip to the command line, yes.

    1. If you do not already have a calibration, calibrate & profile in DisplayCAL like you’d normally do (do not use ReShade preset).
    2. Download the following linear 1D LUT: CFX_lut_linear_0-255.tif
    3. Open a command prompt.
    4. Run C:\Users\Your_Username\Downloads\Argyll_V1.8.3\bin\cctiff C:\Users\Your_Username\AppData\Roaming\DisplayCAL\storage\Name_of_profile\Name_of_profile.cal C:\Users\Your_Username\Downloads\CFX_lut_linear_0-255.tif C:\Users\Your_Username\Downloads\CFX_lut.tif (adjust paths as necessary). This will apply the calibration to the linear 1D LUT and save it as CFX_lut.tif
    5. Save CFX_lut.tif as PNG to the ReShade\CustomFX\textures folder, overwriting the existing file. You can use MS Paint for this.
    6. Enable “LUT – CustomFX” under “Pipeline” in the Mediator.
    #4001

    Pneumatic
    Participant
    • Offline

    Thank you so much!

    #4040

    Pneumatic
    Participant
    • Offline

    Sadly the shader does not use dithering and there is lots of banding 🙁

    In fact the banding is much worse than at the desktop!  (Nvidia GPU).

    It can be mitigated back to regular levels of banding by using the -p option with cctiff (generates the .tiff with extra precision).

    Here is a DX9 grey ramp test pattern you can use to check your banding with ReShade, just run ramp.bat.

    https://www.mediafire.com/?nw37afqg6s52lrv

    There is an interesting shader called Deband – CustomFX,  but it doesn’t actually improve things in the right way.   The dithering needs to be implemented differently, maybe if I can get my head around how AMD is doing it I might be able to implement it myself.

    #4042

    Pneumatic
    Participant
    • Offline

    It may just be that Deband needs different threshold settings.   The fact that it’s being applied before the 1D LUT in the pipeline order seems to be  correct

    • This reply was modified 7 years, 7 months ago by Pneumatic.
    #4045

    Florian Höch
    Administrator
    • Offline

    Sadly the shader does not use dithering and there is lots of banding

    The main problem with most game engines is the limited bitdepth processing.

    It can be mitigated back to regular levels of banding by using the -p option with cctiff (generates the .tiff with extra precision).

    Yes, that option should generally be used (I forgot).

    The fact that it’s being applied before the 1D LUT in the pipeline order seems to be correct

    Hmm, that seems backwards – it should be applied afterwards.

    #4047

    Florian Höch
    Administrator
    • Offline

    Here is a DX9 grey ramp test pattern you can use to check your banding with ReShade, just run ramp.bat.

    Btw, the video card gamma table is active while using this fullscreen test program – make sure to reset it during testing.

    #4048

    Pneumatic
    Participant
    • Offline

    With DEBAND_RADIUS 256 I am getting a very good result, almost like AMD quality dithering, but it eats about 10% GPU on a GTX1070.

    #4049

    Pneumatic
    Participant
    • Offline

    Here is a DX9 grey ramp test pattern you can use to check your banding with ReShade, just run ramp.bat.

    Btw, the video card gamma table is active while using this fullscreen test program – make sure to reset it during testing.

    Yep I made a autohotkey script for that in the General forum!

    #4050

    Pneumatic
    Participant
    • Offline

    Hmm, that seems backwards – it should be applied afterwards.

    That’s what I thought at first, but if you remove colours first with the 8-bit LUT, then the algorithm has less colours to look at in its  search radius.

    If we take the full unaltered 256 shade ramp and dither that into a much higher depth ,  and THEN to those dithered pixel patterns start duplicating some of those pixels which are already in a dither pattern,  the effect should be less.

    • This reply was modified 7 years, 7 months ago by Pneumatic.
    #4055

    Pneumatic
    Participant
    • Offline

    To get really high quality smooth ramps I need to use settings which eat 20% GPU on my 1070  – maybe this is why Nvidia don’t offer it and AMD with its higher shader cores count can afford it.

    #4056

    Pneumatic
    Participant
    • Offline

    These are the settings btw

    //>Deband Settings<\\
    #define DEBAND_RADIUS 256 //[0.0:1024.0] //-Sampling radius, higher values will reduce further banding but might also reduce details
    #define DEBAND_THRESHOLD 0.017 //[0.000:0.100] //-Threshold, higher values will reduce further banding but might also reduce details and increase noise
    #define DEBAND_SAMPLE_COUNT 8 //[1:8] //-Sample count, higher values are better
    #define DEBAND_OFFSET_MODE 3 //[1:3] //-1 = cross (axis aligned, fast), 2 = diagonal (45 degrees, slower), 3 = box (fully random, much slower)
    #define DEBAND_DITHERING 0 //[0:3] //-Additional dithering options to smoothen the output. 0 = No dithering 1 = Ordered dithering, 2 = Random dithering, 3 = Iestyn’s RGB dither (Valve)

    #4058

    Florian Höch
    Administrator
    • Offline

    If we take the full unaltered 256 shade ramp and dither that into a much higher depth , and THEN to those dithered pixel patterns start duplicating some of those pixels which are already in a dither pattern, the effect should be less.

    Alright, that makes sense.

    #4059

    Florian Höch
    Administrator
    • Offline

    To get really high quality smooth ramps I need to use settings which eat 20% GPU on my 1070 – maybe this is why Nvidia don’t offer it and AMD with its higher shader cores count can afford it.

    I doubt the shader is as optimized as a hardware dithering implementation, so I suspect this would have a significant performance hit on AMD cards as well.

    With DEBAND_RADIUS 256 I am getting a very good result

    Hmm, DEBAND_RADIUS 256 on my GTX 1070 (connected over HDMI to a Philips TV) looks closer to no effect at all, and the default setting of 32 looks much smoother (but with DEBAND_DITHERING 1).

    #4062

    Pneumatic
    Participant
    • Offline

    I think we must be using different versions because mine was set to 7 by default.

    Also these are the settings I settled on which give  a very smooth result and only 4% GPU usage.

    //>Deband Settings<\\
    #define DEBAND_RADIUS 256 //[0.0:1024.0] //-Sampling radius, higher values will reduce further banding but might also reduce details
    #define DEBAND_THRESHOLD 0.033 //[0.000:0.100] //-Threshold, higher values will reduce further banding but might also reduce details and increase noise
    #define DEBAND_SAMPLE_COUNT 2 //[1:8] //-Sample count, higher values are better
    #define DEBAND_OFFSET_MODE 3 //[1:3] //-1 = cross (axis aligned, fast), 2 = diagonal (45 degrees, slower), 3 = box (fully random, much slower)
    #define DEBAND_DITHERING 0 //[0:3] //-Additional dithering options to smoothen the output. 0 = No dithering 1 = Ordered dithering, 2 = Random dithering, 3 = Iestyn’s RGB dither (Valve)

    Remember to zero your 1D lut before viewing.

    I notice there is an artefact down the right hand side of the image in the dithered one.   It is to do with the DEBAND_SAMPLE_COUNT setting.    But if I set it higher then I am back up at 20% GPU usage 🙁

    Also the dithering pattern looks less noisy when actually running , because it randomises the pattern every frame.

    • This reply was modified 7 years, 7 months ago by Pneumatic.
    • This reply was modified 7 years, 7 months ago by Pneumatic.
Viewing 15 posts - 1 through 15 (of 25 total)

You must be logged in to reply to this topic.

Log in or Register

Display Calibration and Characterization powered by ArgyllCMS