We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Overall Saturation in the scene

Home Forums General Questions Overall Saturation in the scene

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #80900
    gf3d
    Customer

    Hi Guys,

    is there a way to correct the overall Saturation in a Scene by Puzzles or Coding….

    If so pls. let me know how that can be achieved

    Greets

    Ger

    #80914
    kdv
    Participant

    https://threejs.org/examples/?q=color#webgl_postprocessing_3dlut

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #80915
    gf3d
    Customer

    Thank you kdv……its good to know that its possible….

    But since i´m not a coder…and the solution seems to be coding…..

    Question…..?

    Where to code what in wich File…(I assume its the Visual Logic file)

    Thanks

    Ger

    #80923
    kvdml
    Customer

    Double post, sorry
    `

    • This reply was modified 3 days, 23 hours ago by kvdml. Reason: Double post
    #80924
    kvdml
    Customer

    Found this in an old project I did two years ago:
    Open your verge3d’s project js file (not visual_logic.js but projectname.js)

    1.
    On top, after ‘use strict’: add this

    
    import { LUTPass } from "./modules/LUTPass/LUTPass.js";
    import { LUTCubeLoader } from "./modules/LUTPass/LUTCubeLoader.js";
    import { LUT3dlLoader } from "./modules/LUTPass/LUT3dlLoader.js";
    import GUI from "lil-gui";
    
    const lutsMap = {
        "name_of_your_cube_file.CUBE": null,
    };
    

    2. Further down, in createApp(){}, before loadScene() add this:

    
    Object.keys(lutsMap).forEach((name) => {
            if (/\.cube$/i.test(name)) {
                new LUTCubeLoader().load("luts/" + name, (result) => {
                    fillLutsMap(name, result, true);
                });
            } else {
                new LUT3dlLoader().load("luts/" + name, (result) => {
                    fillLutsMap(name, result, false);
                });
            }
        });
    
        function fillLutsMap(name, result, isCube) {
            delete lutsMap[name];
            if (isCube && result.title == "Untitled") {
                result.title = name.replace(/.cube/i, "");
                const idx = name.indexOf(" ");
                if (idx > 0) result.title = result.title.slice(0, idx);
            } else if (!result.title) result.title = name.replace(".3dl", "");
            lutsMap[result.title] = result;
        }
    

    3. Then towards the end of the file, search runcode(),
    Put this inside the function:
    (I left out the GUI and the webgl2 fallback, if you need the gui, look up the code in the threejs module)

    
        if (!app.postprocessing) app.enablePostprocessing([]);
    
        const params = {
            enabled: false,
            lut: "name_of_your_cube_file",
            intensity: 0,
            use2DLut: false,
        };
    
        const lutPass = new LUTPass();
        app.postprocessing.composer.addPass(lutPass);
    
        setLutPassTexture();
    
        function setLutPassTexture() {
            if (lutsMap[params.lut]) {
                const lut = lutsMap[params.lut];
                lutPass.lut = params.use2DLut ? lut.texture : lut.texture3D;
            }
        }
    

    Files needed:
    Make a directory ‘modules’ in the root, make a LUtPass directory there, add the three js files from the lutfiles modules
    Put your CUBE file in the directory you set in point 2 (‘luts/)

    • This reply was modified 3 days, 23 hours ago by kvdml.
    • This reply was modified 3 days, 23 hours ago by kvdml.
    #80929
    xeon
    Customer

    gf3d…did you happen to test the various Color Management View Transform options to see if that solved the issues you were having…you probably did but just curious.

    Nice LUT solution though.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.