-
Notifications
You must be signed in to change notification settings - Fork 51
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
RenderOrder is in different scale in Reverse Z #514
RenderOrder is in different scale in Reverse Z #514
Conversation
I could not find info online about this problem, so i had to write a test myself. The obvious solution is to multiply the depth bias by 100 or so; but I was wondering what would be the side effects on other geometry. I.e. what would happen to geometry that is meant to be in front of the plane? We know a depth bias of 300 works at close range at reverse Z (where at normal Z a depth bias of 3 was enough), but would the plane get on top of everything as you move the camera away? So I made a test: https://www.youtube.com/watch?v=s2XdH3fYUac We can safely multiply by something like 100 or so, and we will get better results with reverse Z than we could with normal Z + the usual depth bias constant scale. With Normal Z, wven with a depth bias of 3 will eventually be on top of everything, but with Reverse Z + depth bias of 300, that never happens. Apparently multiplying the constant bias by 100.0f *is* the right thing to do. Fixes gazebosim#427 Signed-off-by: Matias N. Goldberg <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-rendering6 #514 +/- ##
===============================================
Coverage 55.42% 55.42%
===============================================
Files 195 195
Lines 19758 19762 +4
===============================================
+ Hits 10951 10954 +3
- Misses 8807 8808 +1
Continue to review full report at Codecov.
|
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.
oh interesting, I didn't expect the fix to be a straightforward multiplication factor. The results look good, thanks for testing!
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
This pull request has been mentioned on Gazebo Community. There might be relevant details there: https://community.gazebosim.org/t/new-ignition-releases-2022-03-01-citadel-edifice-fortress/1313/1 |
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]> gazebosim#514 causes render order issues for Metal - reverting until resolved.
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
…im#514 Signed-off-by: Rhys Mainwaring <[email protected]>
I could not find info online about this problem, so i had to write a
test myself.
The obvious solution is to multiply the depth bias by 100 or so; but I
was wondering what would be the side effects on other geometry.
I.e. what would happen to geometry that is meant to be in front of the
plane? We know a depth bias of 300 works at close range at reverse Z
(where at normal Z a depth bias of 3 was enough), but would the plane
get on top of everything as you move the camera away?
So I made a test: https://www.youtube.com/watch?v=s2XdH3fYUac
We can safely multiply by something like 100 or so, and we will get
better results with reverse Z than we could with normal Z + the usual
depth bias constant scale.
With Normal Z, wven with a depth bias of 3 will eventually be on top of
everything, but with Reverse Z + depth bias of 300, that never happens.
Apparently multiplying the constant bias by 100.0f is the right thing
to do.
Fixes #427
Signed-off-by: Matias N. Goldberg [email protected]
🦟 Bug fix
Fixes #427
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge