V2: Feedback render sluggish on GTX1070
-
I was trying out https://jscad.xyz/#https://raw.githubusercontent.com/gilboonet/gilboonet.github.io/master/scripts/PiedGen1.js
and render is sluggish like I have 5 yrs old laptop with integrated gpu.
compared to v1 it is horrible to use.
I have GTX1070 it should run smoothly.
I tried Edge, Chrome, FF
-
@hrgdavor don't panic. i understand just fine. but i wanted to make sure that everything has been tried before making changes.
also, i'm not certain why 'exact' mouse position is important. i'm just fine working with V2, and don't find the inertia to be troublesome.
so, maybe this would be a user preference. no?
-
@hrgdavor here is video showing how I expect rotate to work
versus how it works on xyzhttp://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 gestures.drags .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; cancelAnimationFrame(timer); 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 :(.
-
@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.
packages/web/src/ui/views/viewer.js
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.