Giter Club home page Giter Club logo

Comments (13)

aqxa1 avatar aqxa1 commented on May 12, 2024 3

Thanks. Just figured out it was the "Tone Curve" setting in DisplayCAL causing the problem, for the record (use Rec. 1886 instead of Gamma 2.2, and manually choose a 2.2 gamma after that).

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on May 12, 2024

So by 3D LUT what file format do you mean? Some sort of .png or these .cube that image manipulation software uses? On an other note that shader you linked uses 2d images internally which seems weird for a 3d LUT.

from vkbasalt.

aqxa1 avatar aqxa1 commented on May 12, 2024

@DadSchoorse PNG files, yes.

I don't have a deep understanding of how it works, but I believe you use several 2D textures but treat them as 3D (presumably R, G, B + Alpha):

See this link:
https://threejsfundamentals.org/threejs/lessons/threejs-post-processing-3dlut.html

WebGL1 doesn't support 3D textures so we'll use 4x2 2D texture and treat it as a 3D texture inside a custom shader where each slice of the cube is spread out horizontally across the texture.

And another example implementation, this time as a slang shader in Retroarch: https://github.com/libretro/slang-shaders/blob/master/crt/shaders/guest/lut/lut.slang

You can also see some example LUTs in that repo, e.g. one that simulates the colours of a Sony Triniton CRT.

And this port from reshade to retroarch. This one looks slightly simpler and doesn't have unrelated options.

It would be nice to support several different sizes for the LUT png (DisplayCAL can export to 16x16x16, 32x32x32, and 64x64x64 colours), although 64x64x64 would be enough to begin with.

Thanks

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on May 12, 2024

I have implemented a 3D LUT shader in the wip-lut branch. It supports PNG like that one and .CUBE files. To use it, set effects = lut and lutFile = /path/to/lut/without/spaces in the config.
Here's a build:
vkBasalt.tar.gz
Testing would be appreciated.

from vkbasalt.

aqxa1 avatar aqxa1 commented on May 12, 2024

Thanks! Just tested, and it works as expected so far (with native Vulkan and D9VK/DXVK). I've only tested DisplayCAL generated LUTs (which are the most important for me) so I'll try and test some others.

from vkbasalt.

aqxa1 avatar aqxa1 commented on May 12, 2024

CUBE LUTs also look to be working well.

The only issue I've had so far was one particular .png LUT causing a strong yellow tint with Rise of the Tomb Raider (and only that particular game). There's a decent chance that the LUT itself is the problem, although I've been using the LUT with ReShade for a while and it's the first time I've had an issue with it. A new CUBE LUT with similar settings doesn't have the issue, for the record.

I'll try and figure out if it's the LUT at fault, rather than your code.

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on May 12, 2024

Can you give me the yellow LUT?

from vkbasalt.

aqxa1 avatar aqxa1 commented on May 12, 2024

@DadSchoorse Sure.

lut-dcip3

It's not hugely noticeable but it should be visible when comparing screenshots. Here's a comparison to show what I mean:

No LUT No LUT

PNG LUT PNG LUT

Cube LUT Cube LUT

These are intended to be run on a wide gamut monitor, but the yellow tint should be noticeable with standard gamut monitors as well. I used different gamma settings on the Cube LUT, so ignore the brightness difference.

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on May 12, 2024

It does not seem to cause a yellow tint in my testing:
489830_20191207101448_1
This is without the LUT:
489830_20191206161544_1

from vkbasalt.

aqxa1 avatar aqxa1 commented on May 12, 2024

I think it's just game specific. I also tested generating a CUBE lut with the same settings as the older PNG and it does exhibit the same problem. It might be those particular settings cause problems in only certain games.

I can most likely just work around it on my end by choosing different settings.

from vkbasalt.

DadSchoorse avatar DadSchoorse commented on May 12, 2024

Okay then I am going to merge the branch and close this issue.

from vkbasalt.

HexHyte avatar HexHyte commented on May 12, 2024

Thanks. Just figured out it was the "Tone Curve" setting in DisplayCAL causing the problem, for the record (use Rec. 1886 instead of Gamma 2.2, and manually choose a 2.2 gamma after that).

Sorry for reviving this old topic but i wanted to ask you if with "use Rec. 1886 instead of Gamma 2.2" you mean to do the calibration with this setting and then changing it to Gamma 2.2 when creating the 3D LUT?

from vkbasalt.

aqxa1 avatar aqxa1 commented on May 12, 2024

@HexHyte Sorry I missed your comment. I wish I'd made more detailed notes, because I'm honestly not sure.
The default setting would be to calibrate with a "Gamma 2.2" tone curve, then map that to a 3D LUT with source colourspace "Rec709" and tone curve "Rec 1886". I'll add that I haven't seen any obvious issues with recent LUTs I've made with close to the default settings, but I haven't looked at Rise of the Tomb Raider recently.

As a side note, the flatpak version as of today doesn't include all available source colourspaces (such as Rec 709 which you want for standard sRGB content). A workaround is to extract the binaries of the latest argyllcms somewhere, and load them with displaycal. See here

EDIT: I may have meant in the 3D LUT tab to use Rec 1886 tone curve but change the gamma from 2.4 to 2.2 (with advanced options enabled). Or you could try gamma 2.2 both in the calibration and 3D LUT which would probably be fine for most content.

from vkbasalt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.