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

Moving Least Squares produces NaN outputs #787

Open
translunar opened this issue Jul 3, 2014 · 5 comments
Open

Moving Least Squares produces NaN outputs #787

translunar opened this issue Jul 3, 2014 · 5 comments
Labels
help wanted kind: bug Type of issue module: surface needs: pr merge Specify why not closed/merged yet

Comments

@translunar
Copy link

In certain race conditions, MLS with the SAMPLE_LOCAL_PLANE mode is producing output that consists either entirely or partially of NaNs in the xyz coordinates. I don't believe this is supposed to happen. In this case, the input for MLS includes no NaNs.

It's difficult to write a reproducible test case for this bug, but I've committed code which shows that the computeMLSPointNormal function is the culprit here:

translunar@a477b7a

(Note: this does indeed abort for me when the race condition occurs.)

I'm going to attempt to find the problem, but wanted to mention I was working on it first.

@translunar
Copy link
Author

Okay, I believe the problem is that the points in question all lie on a line. This happens when the MLS search radius is too small. In the case of the RenderViewsTesselatedSphere app, it can also happen when the near and far plane are too far apart and the z-buffer has insufficient precision. That means that in certain scenes points which recede toward the perspective point are "quantized" by the z-buffer and detail gets lost. The result: some planes get deformed, or plane information gets lost entirely.

I think there should still be some kind of check for NaN points in SAMPLE_LOCAL_PLANE for MLS, but I don't know the best way to implement it.

Instead, I will likely propose a change to the RenderViewsTesselatedSphere app which attempts to address the clipping plane problem — if I can find a solution. Working on that now.

@SergioRAgostinho
Copy link
Member

To whoever fixes this, please integrate this test #788 in your fix and make sure it passes.

@stale
Copy link

stale bot commented May 19, 2020

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the status: stale label May 19, 2020
@kunaltyagi kunaltyagi added the status: triage Labels incomplete label May 21, 2020
@stale stale bot removed the status: stale label May 21, 2020
@stale
Copy link

stale bot commented Jun 20, 2020

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the status: stale label Jun 20, 2020
@kunaltyagi kunaltyagi added help wanted kind: bug Type of issue module: surface needs: pr merge Specify why not closed/merged yet and removed status: stale status: triage Labels incomplete labels Jun 22, 2020
@kunaltyagi
Copy link
Member

Needs #1407 or similar PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted kind: bug Type of issue module: surface needs: pr merge Specify why not closed/merged yet
Projects
None yet
Development

No branches or pull requests

3 participants