Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only draw one pixel in getID to lower performance impact on mousedown #217

Open
SBRK opened this issue Dec 12, 2018 · 5 comments
Open

Only draw one pixel in getID to lower performance impact on mousedown #217

SBRK opened this issue Dec 12, 2018 · 5 comments

Comments

@SBRK
Copy link

SBRK commented Dec 12, 2018

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.

@martin1cerny
Copy link
Member

This is a great idea. You are most welcome to contribute with a pull request :-)

@SBRK
Copy link
Author

SBRK commented Dec 13, 2018

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

@SBRK
Copy link
Author

SBRK commented Dec 13, 2018

Here:
#218

Slight performance gain, although I'm still having long (> 100ms) getID calls in some conditions, not too sure why

@martin1cerny
Copy link
Member

Thank you very much! I'll review and merge in the next few days.

@SBRK
Copy link
Author

SBRK commented Dec 17, 2018

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

tomlee-dev pushed a commit to ictway/XbimWebUI that referenced this issue Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants