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

Pick normals using a 3x3 viewport #1177

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Conversation

Kurtil
Copy link
Contributor

@Kurtil Kurtil commented Oct 16, 2023

It seems that partiale derivatives don't work very well on a 1x1 viewport. Indeed, picked normals have a flipped direction sometimes. It may be due to the fact that fragments are computed using 2x2 block, and partiale derivative use this implementation to compute de derivative across neighbouring fragment... Pure supposition but using a 3x3 viewport fix the normal flipped direction issue.

Also, this PR slightly update the lines added for picking (as it is the same for picking normals). Indeed, it adds the _uDrawingBufferSize uniform for all pick renderer + uses it in the clip space remapping function to be more correct.

@ghost
Copy link

ghost commented Oct 16, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@xeolabs xeolabs added this to the 2.4.0 milestone Oct 16, 2023
@xeolabs xeolabs added the bug Something isn't working label Oct 16, 2023
@xeolabs xeolabs merged commit 5cd85b5 into xeokit:master Oct 16, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants