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.

kvdml

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • in reply to: Overall Saturation in the scene #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 4 days, 16 hours ago by kvdml.
    • This reply was modified 4 days, 16 hours ago by kvdml.
    in reply to: Overall Saturation in the scene #80923
    kvdml
    Customer

    Double post, sorry
    `

    • This reply was modified 4 days, 16 hours ago by kvdml. Reason: Double post
    in reply to: Hide iframe link from users #80888
    kvdml
    Customer

    your iframe needs a src attribute. You can obfusciate it a bit with javascript, but in the end, the iframe will still end up in the resources pane of the console. It’s not rocket science, everyone with a little bit of knowledge will find your iframe url in 10 seconds.

    kvdml
    Customer

    looked at one of cylindo’s demo’s: basically, it are prerendered turntables. It’s not realtime 3D, but rendered bitmaps. Cheaper for a few objects, expensive if you have a lot of objects and variable materials. They prob. have a custom pipeline to make it less labor intensive.
    I did two such 2.5 configurators a couple of years ago, we basically rendered every configurable object to a transparent png and did imagestacking and -coloring serverside.
    The second project was too large to do serverside and we needed more accurate coloring
    control, so I wrote a photoshop plugin and workflow for that, it generated 3600 image combinations per hour (we needed like 300.000 final images). We ran it on one desktop with 3 additional Virtual Machines, and generated like 14.000 images per hour.

    • This reply was modified 5 days, 18 hours ago by kvdml.
    in reply to: clone materials #80366
    kvdml
    Customer

    just saw it on LinkedIn. Thx!

    in reply to: Is there a way to name children of clones #78617
    kvdml
    Customer

    this is my clone object before and after the rename function

    [‘panel2’, ‘panel_frame’, ‘panel_glass’]
    [‘panel2’, ‘panel_frame2’, ‘panel_glass2’]

    [‘panel3’, ‘panel_frame’, ‘panel_glass’]
    [‘panel3’, ‘panel_frame3’, ‘panel_glass3’]

    in reply to: Is there a way to name children of clones #78616
    kvdml
    Customer

    thx,
    had to rework it a bit, but I got it working like this:

    function renameChildrenOfClone(clonedObjectName) {
    // Retrieve the cloned object from the scene using its name
    const clonedObject = app.scene.getObjectByName(clonedObjectName);

    // Extract the index number from the parent object’s name
    const indexMatch = clonedObjectName.match(/\d+$/);
    const index = indexMatch ? indexMatch[0] : ”;

    for (let i = 0; i < clonedObject.children.length; i++) {
    const child = clonedObject.children;

    if (child.name.startsWith(‘panel_frame’)) {
    child.name = panel_frame${index};
    } else if (child.name.startsWith(‘panel_glass’)) {
    child.name = panel_glass${index};
    }
    }
    }

    • This reply was modified 4 months, 2 weeks ago by kvdml.
    in reply to: materials: has this changed in 4.6? #75681
    kvdml
    Customer

    I removed the world shader node of my object in Blender, v3d gltf size dropped to 946kb ‘(from 1.2Mb). xz-compression dropped it to 364 kb, which is not a huge difference with the xz-compression of the object with world-shader node (385 kb).
    It would be nice if in future versions we could decide ourselves what mesh attrs could be optimized: the optimized mesh attr. version is comparable with a plain glb in filesize (696kb uncompressed, 219 kb with xz compression). Too bad it’s not compatible with v3d pbr shaders with maps.
    Thanks for the info though, Alexander.

    kvdml
    Customer

    A lot of our customers don’t really know how many unique products they actually can create and think these configurators are expensive. At that point, we take a calculator and do the math for them: one bed in our configurator costs less than 0.0001 eurocent

    in reply to: materials: has this changed in 4.6? #75635
    kvdml
    Customer

    just did a quick test: the imported object does not get the pbr material assigned when it’s a standard glb. A v3d glb version works.
    This was not a problem in version 4.2
    Also, the Verge .glb is almost double the size in kb 1.2 mb for the Verge version, 680 kb for the standard glb.
    After XZ compression, this goes to 385kb vs 184kb

    in reply to: materials: has this changed in 4.6? #75634
    kvdml
    Customer

    thanks, disabling the ‘optimize mesh attr.’ worked for the cubes in the masterscene. Not for the appended geo that worked in a v3d 4.2 project. I’ll have a look at it this weekend.

    in reply to: materials: has this changed in 4.6? #75627
    kvdml
    Customer

    fixed the errors, no change

    in reply to: materials: has this changed in 4.6? #75626
    kvdml
    Customer

    found the error by logging the xhtml-request:
    Fetch failed loading: GET “http://localhost:8668/applications/Shapeshift_tester/cobblestone_floor_04_diff_1k.ktx2&#8221;.
    Fetch failed loading: GET “http://localhost:8668/applications/Shapeshift_tester/basis_transcoder.wasm
    Both files are there though

    in reply to: Color difference in Chrome vs other browsers #67121
    kvdml
    Customer

    For those with the same problem: it’s ONLY Chrome on MacOS that has this behavior. Probably their webgl metal implementation is not 100% yet, as even MS Edge doesn’t have this problem.
    I fixed it like this (no puzzles, I code directly into the visual_logic.js) : since all our materials are swappable, we’ve made a second albedo map colorcorrected for Chrome

    let userAgent = window.navigator.userAgent;
            let os = "Unknown OS";
    
            if (userAgent.indexOf("Win") != -1) os = "Windows";
            if (userAgent.indexOf("Mac") != -1) os = "MacOS";
            if (userAgent.indexOf("X11") != -1) os = "UNIX";
            if (userAgent.indexOf("Linux") != -1) os = "Linux";
            os = os.toLowerCase()
            // alert(os)
    
            var browser = (function (agent) {
                switch (true) {
                    case agent.indexOf("edge") > -1: return "edge";
                    case agent.indexOf("edg/") > -1: return "chromiumedge"; // Match also / to avoid matching for the older Edge
                    case agent.indexOf("opr") > -1 && !!window.opr: return "opera";
                    case agent.indexOf("chrome") > -1 && !!window.chrome: return "chrome";
                    case agent.indexOf("trident") > -1: return "ie";
                    case agent.indexOf("firefox") > -1: return "firefox";
                    case agent.indexOf("safari") > -1: return "safari";
                    default: return "other";
                }
            })(window.navigator.userAgent.toLowerCase());
            // alert(browser);
    
            var browserextention = ''
            if(os == 'macos' && browser=='chrome'){
                browserextention = '-chrome'
            }

    Materialswapping then goes like this where applicable :

    replaceTexture(
                    "matFabric",
                    "dummie_albedo_fabric.jpg",
                    "assets/3d/maps/fabric_" + myFabric + "_albedo"+browserextention+".jpg",
                    function () {}
                );
    in reply to: Color difference in Chrome vs other browsers #67051
    kvdml
    Customer

    should have been more explicit: the problem is Chrome on macOS (mac M1 chip)

Viewing 15 posts - 1 through 15 (of 21 total)