-
Notifications
You must be signed in to change notification settings - Fork 635
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
move near clipping plane further away for more depth buffer precision. #13338
Conversation
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.
LGTM, I guess adding a test for this is way too hard (unless we do image analysis/comparison)
Maybe we can add a separate jira task to analyze solutions for the most common z fighting/depth buffer issues that users might come across .
We actually have image comparison tests! Unfortunately to keep them stable between graphics cards and different machines we needed to add quite a big fuzz factor :( - we could revisit that at some point as well. |
@mjkkirschner do you think there might be any performance implications for this change ? |
I think the GPU in modern graphics libraries (dx11 > etc) will not render multiple pixels at the same location if the depth of the new pixel is greater than something already in the depth buffer - but I cannot remember exactly. If thats true, than performance should be the same... |
Are these near plane and far plane constants that you're playing with in this PR the |
The equation in the article that includes depth bias has its own horrible equation depending on what format the buffer is in - Helix appears to use a 32bit float depth buffer. |
I'm not sure I understand - you say that the near and far plane distances are calculated dynamically depending on the camera position. If that's the case, then what is this constant value? In any case, don't let my questions prevent you from merging this PR. |
@aparajit-pratap as one moves the camera, or zooms we do this: in most cases this boils down to: |
* add nunit test adapter for 2022 (#13313) * add nunit test adapter for 2022 * update * Update Setup.cs * update * Update DynamoCore.csproj * Create System.Net.Http.dll * update * update Co-authored-by: pinzart <[email protected]> * Filter Mouse Pressed Removed (#13319) - removed flashing white color on mouse pressed for the filter ui element * Fixing horizontal center (#13312) * Update Node AutoComplete Dialog Visuals (#13329) * Update Node AutoComplete Visuals * Reuse style from central location * Add editorconfig (#13233) * Dyn5272 (#13334) tests pass - merging this then will send cherry pick * Dyn 5159 import export preferences (#13301) * Import Export Settings * Info Icons * Indentation * Using Dynamo View Model reference * Moving the methods to the proper places according to their accessibility * Handling Generic Exceptions * updating the RaisePropertyChanged * Extracting the import extension file as a variable * Unique file name * Changing the access level * Various revisions * Cleaning vars * Adding Unit Test * Adding Comments and cleaning vars * Removing unnecessary methods * Refactoring to get the static fields automatically * Updating the Unit Test * checking new settings file * Adding validation info * Getting First Property with the same value * Updating valid TrustedLocations entries * move near clipping plane further away for more depth buffer precision. (#13338) passed here: merging. * Keep Node AutoComplete popup hidden when window deactivated (#13337) * Keep Node AutoComplete popup hidden when window deactivated * Add condition and null checks * comments Co-authored-by: pinzart90 <[email protected]> Co-authored-by: pinzart <[email protected]> Co-authored-by: Deyan Nenov <[email protected]> Co-authored-by: jesusalvino <[email protected]> Co-authored-by: Aaron (Qilong) <[email protected]> Co-authored-by: Aabishkar KC <[email protected]>
…3343) * add nunit test adapter for 2022 (#13313) * add nunit test adapter for 2022 * update * Update Setup.cs * update * Update DynamoCore.csproj * Create System.Net.Http.dll * update * update Co-authored-by: pinzart <[email protected]> * Filter Mouse Pressed Removed (#13319) - removed flashing white color on mouse pressed for the filter ui element * Fixing horizontal center (#13312) * Update Node AutoComplete Dialog Visuals (#13329) * Update Node AutoComplete Visuals * Reuse style from central location * Add editorconfig (#13233) * Dyn5272 (#13334) tests pass - merging this then will send cherry pick * Dyn 5159 import export preferences (#13301) * Import Export Settings * Info Icons * Indentation * Using Dynamo View Model reference * Moving the methods to the proper places according to their accessibility * Handling Generic Exceptions * updating the RaisePropertyChanged * Extracting the import extension file as a variable * Unique file name * Changing the access level * Various revisions * Cleaning vars * Adding Unit Test * Adding Comments and cleaning vars * Removing unnecessary methods * Refactoring to get the static fields automatically * Updating the Unit Test * checking new settings file * Adding validation info * Getting First Property with the same value * Updating valid TrustedLocations entries * move near clipping plane further away for more depth buffer precision. (#13338) passed here: merging. * add more failing tests * implement case 2 of replication * Update ReplicationTests.cs * add failing test * add some more failing tests * add some lacing tests that use arb rank params * fix tests 1. Missing replication Longest/Shortest attribute 2. Fix result - wrap in list (like old VM) Co-authored-by: pinzart90 <[email protected]> Co-authored-by: pinzart <[email protected]> Co-authored-by: Deyan Nenov <[email protected]> Co-authored-by: jesusalvino <[email protected]> Co-authored-by: Aaron (Qilong) <[email protected]> Co-authored-by: Aabishkar KC <[email protected]> Co-authored-by: kirschm <[email protected]>
* add nunit test adapter for 2022 (#13313) * add nunit test adapter for 2022 * update * Update Setup.cs * update * Update DynamoCore.csproj * Create System.Net.Http.dll * update * update Co-authored-by: pinzart <[email protected]> * Filter Mouse Pressed Removed (#13319) - removed flashing white color on mouse pressed for the filter ui element * Fixing horizontal center (#13312) * Update Node AutoComplete Dialog Visuals (#13329) * Update Node AutoComplete Visuals * Reuse style from central location * Add editorconfig (#13233) * Dyn5272 (#13334) tests pass - merging this then will send cherry pick * Dyn 5159 import export preferences (#13301) * Import Export Settings * Info Icons * Indentation * Using Dynamo View Model reference * Moving the methods to the proper places according to their accessibility * Handling Generic Exceptions * updating the RaisePropertyChanged * Extracting the import extension file as a variable * Unique file name * Changing the access level * Various revisions * Cleaning vars * Adding Unit Test * Adding Comments and cleaning vars * Removing unnecessary methods * Refactoring to get the static fields automatically * Updating the Unit Test * checking new settings file * Adding validation info * Getting First Property with the same value * Updating valid TrustedLocations entries * move near clipping plane further away for more depth buffer precision. (#13338) passed here: merging. * add more failing tests * implement case 2 of replication * Update ReplicationTests.cs * add failing test * add some more failing tests * add replication test * fix merge conflict * fix merge conflict Co-authored-by: pinzart90 <[email protected]> Co-authored-by: pinzart <[email protected]> Co-authored-by: Deyan Nenov <[email protected]> Co-authored-by: jesusalvino <[email protected]> Co-authored-by: Aaron (Qilong) <[email protected]> Co-authored-by: Aabishkar KC <[email protected]> Co-authored-by: Michael Kirschner <[email protected]> Co-authored-by: kirschm <[email protected]>
* add nunit test adapter for 2022 (#13313) * add nunit test adapter for 2022 * update * Update Setup.cs * update * Update DynamoCore.csproj * Create System.Net.Http.dll * update * update Co-authored-by: pinzart <[email protected]> * Filter Mouse Pressed Removed (#13319) - removed flashing white color on mouse pressed for the filter ui element * Fixing horizontal center (#13312) * Update Node AutoComplete Dialog Visuals (#13329) * Update Node AutoComplete Visuals * Reuse style from central location * Add editorconfig (#13233) * Dyn5272 (#13334) tests pass - merging this then will send cherry pick * Dyn 5159 import export preferences (#13301) * Import Export Settings * Info Icons * Indentation * Using Dynamo View Model reference * Moving the methods to the proper places according to their accessibility * Handling Generic Exceptions * updating the RaisePropertyChanged * Extracting the import extension file as a variable * Unique file name * Changing the access level * Various revisions * Cleaning vars * Adding Unit Test * Adding Comments and cleaning vars * Removing unnecessary methods * Refactoring to get the static fields automatically * Updating the Unit Test * checking new settings file * Adding validation info * Getting First Property with the same value * Updating valid TrustedLocations entries * move near clipping plane further away for more depth buffer precision. (#13338) passed here: merging. * add more failing tests * implement case 2 of replication * Update ReplicationTests.cs * add failing test * add some more failing tests * add replication test * fix merge conflict * fix merge conflict * update replication test Co-authored-by: pinzart90 <[email protected]> Co-authored-by: pinzart <[email protected]> Co-authored-by: Deyan Nenov <[email protected]> Co-authored-by: jesusalvino <[email protected]> Co-authored-by: Aaron (Qilong) <[email protected]> Co-authored-by: Aabishkar KC <[email protected]> Co-authored-by: Michael Kirschner <[email protected]> Co-authored-by: kirschm <[email protected]>
…namoDS#13343) * add nunit test adapter for 2022 (DynamoDS#13313) * add nunit test adapter for 2022 * update * Update Setup.cs * update * Update DynamoCore.csproj * Create System.Net.Http.dll * update * update Co-authored-by: pinzart <[email protected]> * Filter Mouse Pressed Removed (DynamoDS#13319) - removed flashing white color on mouse pressed for the filter ui element * Fixing horizontal center (DynamoDS#13312) * Update Node AutoComplete Dialog Visuals (DynamoDS#13329) * Update Node AutoComplete Visuals * Reuse style from central location * Add editorconfig (DynamoDS#13233) * Dyn5272 (DynamoDS#13334) tests pass - merging this then will send cherry pick * Dyn 5159 import export preferences (DynamoDS#13301) * Import Export Settings * Info Icons * Indentation * Using Dynamo View Model reference * Moving the methods to the proper places according to their accessibility * Handling Generic Exceptions * updating the RaisePropertyChanged * Extracting the import extension file as a variable * Unique file name * Changing the access level * Various revisions * Cleaning vars * Adding Unit Test * Adding Comments and cleaning vars * Removing unnecessary methods * Refactoring to get the static fields automatically * Updating the Unit Test * checking new settings file * Adding validation info * Getting First Property with the same value * Updating valid TrustedLocations entries * move near clipping plane further away for more depth buffer precision. (DynamoDS#13338) passed here: merging. * add more failing tests * implement case 2 of replication * Update ReplicationTests.cs * add failing test * add some more failing tests * add some lacing tests that use arb rank params * fix tests 1. Missing replication Longest/Shortest attribute 2. Fix result - wrap in list (like old VM) Co-authored-by: pinzart90 <[email protected]> Co-authored-by: pinzart <[email protected]> Co-authored-by: Deyan Nenov <[email protected]> Co-authored-by: jesusalvino <[email protected]> Co-authored-by: Aaron (Qilong) <[email protected]> Co-authored-by: Aabishkar KC <[email protected]> Co-authored-by: kirschm <[email protected]>
* add nunit test adapter for 2022 (DynamoDS#13313) * add nunit test adapter for 2022 * update * Update Setup.cs * update * Update DynamoCore.csproj * Create System.Net.Http.dll * update * update Co-authored-by: pinzart <[email protected]> * Filter Mouse Pressed Removed (DynamoDS#13319) - removed flashing white color on mouse pressed for the filter ui element * Fixing horizontal center (DynamoDS#13312) * Update Node AutoComplete Dialog Visuals (DynamoDS#13329) * Update Node AutoComplete Visuals * Reuse style from central location * Add editorconfig (DynamoDS#13233) * Dyn5272 (DynamoDS#13334) tests pass - merging this then will send cherry pick * Dyn 5159 import export preferences (DynamoDS#13301) * Import Export Settings * Info Icons * Indentation * Using Dynamo View Model reference * Moving the methods to the proper places according to their accessibility * Handling Generic Exceptions * updating the RaisePropertyChanged * Extracting the import extension file as a variable * Unique file name * Changing the access level * Various revisions * Cleaning vars * Adding Unit Test * Adding Comments and cleaning vars * Removing unnecessary methods * Refactoring to get the static fields automatically * Updating the Unit Test * checking new settings file * Adding validation info * Getting First Property with the same value * Updating valid TrustedLocations entries * move near clipping plane further away for more depth buffer precision. (DynamoDS#13338) passed here: merging. * add more failing tests * implement case 2 of replication * Update ReplicationTests.cs * add failing test * add some more failing tests * add replication test * fix merge conflict * fix merge conflict Co-authored-by: pinzart90 <[email protected]> Co-authored-by: pinzart <[email protected]> Co-authored-by: Deyan Nenov <[email protected]> Co-authored-by: jesusalvino <[email protected]> Co-authored-by: Aaron (Qilong) <[email protected]> Co-authored-by: Aabishkar KC <[email protected]> Co-authored-by: Michael Kirschner <[email protected]> Co-authored-by: kirschm <[email protected]>
* add nunit test adapter for 2022 (DynamoDS#13313) * add nunit test adapter for 2022 * update * Update Setup.cs * update * Update DynamoCore.csproj * Create System.Net.Http.dll * update * update Co-authored-by: pinzart <[email protected]> * Filter Mouse Pressed Removed (DynamoDS#13319) - removed flashing white color on mouse pressed for the filter ui element * Fixing horizontal center (DynamoDS#13312) * Update Node AutoComplete Dialog Visuals (DynamoDS#13329) * Update Node AutoComplete Visuals * Reuse style from central location * Add editorconfig (DynamoDS#13233) * Dyn5272 (DynamoDS#13334) tests pass - merging this then will send cherry pick * Dyn 5159 import export preferences (DynamoDS#13301) * Import Export Settings * Info Icons * Indentation * Using Dynamo View Model reference * Moving the methods to the proper places according to their accessibility * Handling Generic Exceptions * updating the RaisePropertyChanged * Extracting the import extension file as a variable * Unique file name * Changing the access level * Various revisions * Cleaning vars * Adding Unit Test * Adding Comments and cleaning vars * Removing unnecessary methods * Refactoring to get the static fields automatically * Updating the Unit Test * checking new settings file * Adding validation info * Getting First Property with the same value * Updating valid TrustedLocations entries * move near clipping plane further away for more depth buffer precision. (DynamoDS#13338) passed here: merging. * add more failing tests * implement case 2 of replication * Update ReplicationTests.cs * add failing test * add some more failing tests * add replication test * fix merge conflict * fix merge conflict * update replication test Co-authored-by: pinzart90 <[email protected]> Co-authored-by: pinzart <[email protected]> Co-authored-by: Deyan Nenov <[email protected]> Co-authored-by: jesusalvino <[email protected]> Co-authored-by: Aaron (Qilong) <[email protected]> Co-authored-by: Aabishkar KC <[email protected]> Co-authored-by: Michael Kirschner <[email protected]> Co-authored-by: kirschm <[email protected]>
Purpose
An issue stemming from this change:
#12607
reported here:
https://forum.dynamobim.com/t/edges-preview-issue-why-do-the-edges-look-like-this-in-the-new-version-of-dynamo/81229
The artifact that is shown is that edges of the surfaces which should be hidden are being drawn as if they are on top of the surfaces in front of them.
While testing this I noticed that the effect was worse the further the geometry was from the camera (as we zoomed out).
My guess is that the depth buffer is not as precise far from the near plane, especially as our near and far plane are calculated dynamically as the camera moves.
As we introduce depth bias, those changes, while small near the near plane, become larger as precision decreases at the far plane.
I believe this article confirms my hypothesis:
https://developer.nvidia.com/content/depth-precision-visualized
okay so - some options:
This PR goes with 2.
It seems to work for current issue at hand reducing most of the artifacting lines, and it also still works for the TSplines example we fixed in the previous PR that introduced this issue.
some before and after images:
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Attempted to improve rendering of curves that should be hidden by meshes when geometry is far from camera.
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of