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

Add a high precision getter for picked position #101

Open
csvurt opened this issue Feb 11, 2015 · 1 comment
Open

Add a high precision getter for picked position #101

csvurt opened this issue Feb 11, 2015 · 1 comment

Comments

@csvurt
Copy link
Contributor

csvurt commented Feb 11, 2015

Currently the picked position is limited to 8 bits per axis due to WebGL color buffer limitations. While this is typically enough for small models things get less and less accurate as bounding box sizes increase. Accurate results are important for things like object placement in large scenes (eg. when clicking on a large ground plane to place an object there).

Because rendering to floating point buffers is iffy under the current WebGL spec we can't rely on it to replace the uint color buffer that we currently use.

We should add a second getter for picked position that returns a high precision result through some other means (eg. ray intersection in JS or multiple render passes of the picked object). Because this is potentially a slow operation we should look into using Promises to return the result.

Normals are always unit vectors so they have a possible error of 0.0078 units when encoded to 8 bits, which should be good enough for most applications.

Originating problem is described in #60

@wherget
Copy link

wherget commented Apr 13, 2015

I believe this is affecting us in COMPASS as well, so that's a definitive +1 from me for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants