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.

scatman2513

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: Geometry Buffers cleanup #59874
    scatman2513
    Participant

    Thank you a lot @kdv. The issue is fixed now. After calling the render function nearly 100 times I always get the same numbers now in the performance info and the fps-drops have stopped now. Fantastic! Made my day = )

    in reply to: Geometry Buffers cleanup #59823
    scatman2513
    Participant

    This worked perfect. Thanks. Now I can duplicate and delete objects and “Geometry Buffers” isn’t growing anymore.

    However, in my application (not the demo project I shared above) I still have performance issues and a look into the performance info shows me that “Textures & Render Buffers” is still growing. I also have these “N/A Textures” calculating up.

    I tried to change your code to delete materials first but it had no effect..

    VARS.allDupedObjects.forEach(function(name){
       const object = app.scene.getObjectByName(name);
       if (object && object.isMesh){
           object.material.dispose();
           object.geometry.dispose();
       }
    });
    

    Do you know what’s the problem here?
    If you need a demo application I could create one end of the week.

    best regards

    Attachments:
    You must be logged in to view attached files.
    in reply to: Geometry Buffers cleanup #59611
    scatman2513
    Participant

    It took me a moment to create a demonstration application for my problem. I’ve attached the .zip into my post. I have to say that I’m working with a plugin from gliftek to duplicate my objects.
    The logic is built into the puzzle. If you take a look into the console output, then you can see how Gemoetry Buffers is growing while objects stay the same.

    Attachments:
    You must be logged in to view attached files.
    scatman2513
    Participant

    sure, you can do this using this puzzle: https://www.soft8soft.com/docs/manual/en/puzzles/HTML.html#query_selector

    Doesnt it only return the first found element or is it possible to select all elements from a class?

    in reply to: Add additional function to scroll #55393
    scatman2513
    Participant

    Thank you @kdv77kdv for your fast reply.

    I created a new Verge project with the cube and pasted the code into the runCode(app) function, but the zoom function behaves differently than before. When I zoom out the background also changes and not only the cube which gets smaller.

    Did I do something wrong?
    Here is how I inserted it:

    
    function runCode(app) {
        var obj = app.scene.getObjectByName('persp1'); //scene camera
        app.controls.enableZoom = false;
        let zoom = obj.zoom;
        const elem = document.getElementById('v3d-container');
        elem.addEventListener('wheel', function() {
            event.preventDefault();
            zoom = obj.zoom - event.deltaY * 0.00075;
            obj.zoom = v3d.MathUtils.clamp(zoom, 0.1, 10);
            obj.updateProjectionMatrix();
        }, false);
    }
    

    (sorry for other account, using this one for the office and had no access at home)

    Edit:
    I have now tested the zoom function on my real project. Since I have no details in the background but only a color gradient it is not that noticeable and I can already work with it.

    scatman2513
    Participant

    You should also read and transmit the position of orbitTarget while panning.

    That solved my issue. Now its working for all movements with orbitTarget. Thanks a lot!

    scatman2513
    Participant

    Yeah, I mean you can see that the x/y/z position of the scene camera is being transmitted without any problems. This has nothing to do with SocketIO.

    I can even simulate this without sockets.io :

    1. Log x/y/z position of scene camera without moving it (default position). I get the values 4.05/3.03/4.05

    2. hold the middle mouse button (mouse wheel) and drag the object out of my view.

    3. Log x/y/z position of scene camera. I get the values 0.64 / 2.75 / 7.67

    4. Now create a puzzle and set the position of the scene camera to 0.64 / 2.75 / 7.67 after 5 seconds.

    5. See the result. The Cube is still in the middle of the window and is not out of the window as it should be.

    scatman2513
    Participant

    @kdv77kdv

    The problem is that the panning (holding middle / right mouse button and move the mouse) isnt transmitted to the other clients.

    The second code block to catch the mouse button is just a temporary code block, you can ignore it. It shouldnt be relevant to the problem itself.

    scatman2513
    Participant

    Thats what im trying to do right now.

    First im binding the object ‘persp1’ to a variable
    var obj = app.scene.getObjectByName('persp1');

    On Movement i’m sending the position data (XYZ) of the scene camera to the server
    var x = obj.position.x;

    The server sends it to all clients and the client will use these position data for the scene camera
    obj.position.x = pos.x;

    Edit:
    Cant attach my project because its 4.95MB as compressed archive.

    Edit2:
    7zip did the job. Just open the same room like i.e. http://localhost:3000/?room=test (nodeJS required)

    scatman2513
    Participant

    Is there a way to give the information about the panning position to other players? Panning is kind of required for my project. I thought ‘persp1’ is the scene camera.

    scatman2513
    Participant

    Hi Yuri, thanks for your fast reply.

    You’re right, with the procedures I can then add & bind the event-listeners once I’ve reloaded the content with Ajax. Now its working.

    Thanks a lot!

Viewing 11 posts - 1 through 11 (of 11 total)