-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
LineSegments2: Fix raytracing when the geometry has instanceCount
set.
#25032
LineSegments2: Fix raytracing when the geometry has instanceCount
set.
#25032
Conversation
It seems there is now a conflict after merging #24405. Do you mind updating the PR? |
b95c355
to
728b0f3
Compare
@Mugen87 Can this change be merged now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me!
It has been discussed in #8690 whether bounding volumes should honor certain geometry properties or not. It seems If we add no support for |
instanceCount
set.
Description
The
LineSegments2
mesh has support for raytracing. However, all segments are evaluated when checking for intersections, even if the geometry'sinstanceCount
has been set to a lower value than the total segment count. Therefore, intersections are still detected with the non-visible line segments. This PR fixes this by considering theinstanceCount
when setting the iteration count during ray tracing.The bounding box/sphere methods still do not consider the
instanceCount
, but this is a more challenging problem to solve correctly and does not affect the correctness of the ray tracing results.The behavior before and after can be reproduced by applying a transformation in the
Line2
ray tracing example (/examples/#webgl_lines_fat_raycasting
). Here is an example patch that can be used: