-
Notifications
You must be signed in to change notification settings - Fork 220
Fix blanking fill #8107
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
base: master
Are you sure you want to change the base?
Fix blanking fill #8107
Conversation
Area patterns now z-fight with their background shapes. The shapes draw with blanking fill. We test for "same element" in shader by comparing feature Ids. But feature Ids will differ because the pattern geometry is of GeometryClass.Pattern. Same would technically occur if e.g. blanking region was construction geometry with geometry of class primary intended to draw in front of it. It would also happen if the blanking region and other geometry were on different subcategories. |
Fixing this requires the fragment shader to be able to answer the question "am I drawing the same element as the one that was previously written to the pick buffer?" This is only relevant for blanking fill - edges always have the exact same feature Id as their surfaces, so the current logic works; and planar regions draw on top of non-planar surfaces regardless of feature/element. Proposed solutionIf a Batch contains any blanking regions, then we need to populate an extra texture that correlates feature index to "element index" (just some unique integer that is the same for all features belonging to the same element - e.g., the index of that element in a list of unique elements in the batch, or the index of the first feature associated with that element). When drawing the non-planar pass (in which planar blanking regions are now drawn), the fragment shader looks up the element index of the current feature and compares it to the one in the pick buffer. If and only if they match, the blanking region is discarded in favor of the previously-drawn fragment. A couple of limitations:
@markschlosseratbentley I'm open to other ideas. PriorityI'm inclined to defer implementation temporarily as we have more pressing problems in the area of drawing production (and elsewhere). I suspect that in general users try to avoid having text with background fill overlap other geometry in their section drawings. @Josh-Schifter what is your take on the urgency? |
Thanks for the examples. In that case I think @claudiaareneee should proceed with #8055 with the assumption that we will address the blanking fill issue separately. @markschlosseratbentley if no one else picks it up in the meanwhile I should be able to get back to it in a week or so. |
Fixes #8101.
Dunno why we ever tried to do this using the old-fashioned polygon offset thing when we have fragment shader logic for controlling display priority.
Unit tests proved infeasible.