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

RenderOrder is in different scale in Reverse Z #514

Merged

Commits on Dec 11, 2021

  1. RenderOrder is in different scale in Reverse Z

    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]>
    darksylinc committed Dec 11, 2021
    Configuration menu
    Copy the full SHA
    5bc9e4b View commit details
    Browse the repository at this point in the history