Only draw one pixel in getID to lower performance impact on mousedown
Viewer.getID draws a viewport of half the size of the regular viewport. This could be greatly improved by drawing a viewport of only one pixel, offseting the screen to have only the pixel at x,y coordinates drawn.
This is how we had implemented picking in our 3D engine at my previous company.
This is a great idea. You are most welcome to contribute with a pull request :-)
I will probably, although the develop branch is confusing and I had to change a lot to make it build.
On a same fashion, there's no need to call getID at all when no handlers are bound to the pick/dblclick events
Here: https://github.com/xBimTeam/XbimWebUI/pull/218
Slight performance gain, although I'm still having long (> 100ms) getID calls in some conditions, not too sure why
Thank you very much! I'll review and merge in the next few days.
After much experimentation and research, readPixels is slow regardless of how many pixels are read or drawn. I wanted to have picking at every frame in order to have mouse hover interactions but on integrated graphics card it axes the framerate in half. Might try to do picking via raycasting instead. Nevertheless, my PR is still a small improvement from before