V2: Feedback render sluggish on GTX1070

  • @hrgdavor here is video showing how I expect rotate to work
    versus how it works on xyz

    http://hrg.hr/tmp/bandicam 2020-10-16 16-52-05-763.mp4

    I have also created a pull request. But this is not real pull request, just wanted to somehow share the code I hacked quickly to get rotation to work.

    If the pull request has any potential, I welcome your input so I can make this my first code contribution 🙂

  • @hrgdavor I am playing with viewer.js
    and was able to remove the nasty effect I dont like with rotation on V2 by setting:

    controls.drag = 1;

    and changed how events are throttled

        var delta = [0,0];
        var timer;
        // rotate
          .forEach((data) => {
            const ev = data.originalEvents[0]
            const shiftKey = (ev.shiftKey === true) || (ev.touches && ev.touches.length > 2)
            if (!shiftKey) {
              delta[0] -= data.delta.x;
              delta[1] -= data.delta.y;
              timer = requestAnimationFrame(doRotate);
        function doRotate(){
          const updated = orbitControls.rotate({ controls, camera, speed: rotateSpeed }, delta)
          delta = [0,0];
          controls = { ...controls, ...updated.controls }

    this way changes will acumulate if animationframe is not executed

  • @z3dev I think you are still missing the point. It is not the rate of refresh or amount of rotation that is the issue here. It is inertia. When I move mouse and stop moving, the rotation continues. Can you not see the difference with V1 where rotation follows the mouse and when mouse stops rotation stops imemdiatelly. In V2 it looks like some intentional elastic motion that does not match mouse position at all. If I move mouse faster it is like it gets more momentum and then takes longer to slow down and stop. it should stop the moment I stop moving my mouse ... pls, why dont u understand what I am saying 😞 😞 😞 😞 😞 😞

  • @hrgdavor you need to play with those settings some more.

    I suggest that you crank up the rates, which drives the number of updates going into the rendering, i.e. rotateRate. Set this to something higher, like 30, 40, 50.

    In addition, there's the speed of the rotation; rotateSpeed. This controls the movement between rotation updates. The max is 1.0, and will be extremely fast and uncontrollable. Somewhere between 0.010 and 0.001 will work the best.

    It may be possible to allow users to control these values as well, and choose a rotation speed. Something like choosing the speed of the mouse.

  • @z3dev changing options only makes issue more visible but does not solve it. Are you not seing there is inertia when rotate is following the mouse....

    if I move my mouse few times left / right the rotation does not end in same place if mouse is i nsam place as it does in V1. .. it is so anoying I cant describe :(.

    http://hrg.hr/tmp/bandicam 2020-10-15 10-22-50-635.mp4

  • @z3dev all of that was tested on https://jscad.xyz/ ... but I will try local instance and settings

  • @hrgdavor yup. there are some settings.

    I think that you are working with a local version of V2. Just change the constants in this file.


    And start the dev instance.

    npm run dev

    Let me know what works best.

  • @z3dev said in V2: Feedback render sluggish on GTX1070:

    @hrgdavor yup. thought that it might be 'rotate'. it feels a little sluggish at times.

    not just sluggish, it seems like intentional smoothing with bounce, it feels horrible

  • pan as well (it is even worse, moves like 10% of mouse movement)
    http://hrg.hr/tmp/bandicam 2020-10-14 09-35-02-460.mp4

  • @hrgdavor yup. thought that it might be 'rotate'. it feels a little sluggish at times.

  • sorry, have not noticed your responses. did not get email notify although I tried to enable it in settings.

    hm, yes, this is windows 10. and looking at it more closely, it it may not be performance issue.

    it is loke rotation is elastic and and lagging

    video showing difference V1 vs V2
    http://hrg.hr/tmp/bandicam 2020-10-12 11-10-44-928.mp4

  • @hrgdavor can you provide some more feedback on the 'sluggish' behaviour?

    there are internal throttles on the number of rotations, pans, zooms per second. maybe that makes V2 seem 'sluggish'?

  • I converted some of V1 examples to V2 and when I run them both in V1 and V2, their performance looks the same. I'm on Ubuntu with Firefox both on a very old tabletop pc (with a 2011 Radeon) and on a recent laptop (with Ryzen 3).

  • @hrgdavor not good.

    FYI, I use a Mac Mini (late 2012) for development. There's nothing fast about this PC but I definitely don't have 'horrible' performance with V2 JSCAD.

    What OS are you running? It looks like Windows 10.

Log in to reply