-
Notifications
You must be signed in to change notification settings - Fork 53
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
Changed calculation for range clipping #325
Changes from 1 commit
e9a3dc2
9bfe9d1
1344138
272c20c
87267f8
7981084
b68668f
34267e4
9675ef6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,7 +139,8 @@ void main() | |
} | ||
|
||
// clamp xyz and set rgb to background color | ||
if (point.x > far - tolerance) | ||
if (point.x * point.x + point.y * point.y > | ||
(far - tolerance) * (far - tolerance)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about just Similarly for clipping points within near clip plane: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, I had no idea there was a length function. Good catch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does 9bfe9d1 works? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah that looks fine. Can you also add a note about this change in the Migration.md guide? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where should I note the change in the migration guide? 5 -> 6 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, you can add a new section There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 34267e4 should take care of this |
||
{ | ||
if (isinf(max)) | ||
{ | ||
|
@@ -158,7 +159,8 @@ void main() | |
color = vec4(backgroundColor, 1.0); | ||
} | ||
} | ||
else if (point.x < near + tolerance) | ||
else if (point.x * point.x + point.y * point.y < | ||
(near + tolerance) * (near + tolerance)) | ||
{ | ||
if (isinf(min)) | ||
{ | ||
|
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.
can you make the same change to
depth_camera_final_fs.glsl
?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.
If I change this, the tests start falling again. expecting -inf and getting inf https://github.com/ignitionrobotics/ign-rendering/blob/lobotuerk/depthRangeChange/test/integration/depth_camera.cc#L324-L326
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.
Changing both that and https://github.com/ignitionrobotics/ign-rendering/blob/lobotuerk/depthRangeChange/test/integration/depth_camera.cc#L309-L311 to
maxVal
make all tests pass, but I don't think that makes senseThere 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.
I think the problem is that because
point
was previously clamped to-inf
solength(point)
becomes+inf
. So indepth_camera_final_fs.glsl
we can change to something like:which just skips this additional clamping if it's already been clamped in the previous pass.
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.
34267e4 should take care of this