-
Notifications
You must be signed in to change notification settings - Fork 206
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
Backdrop : Improve ordering of nested backdrops #5596
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.
Thanks John! I'll leave the maths to Daniel, but from a user perspective this seems to nicely walk the line of "smart enough to automatically do what I want in the majority of cases, while providing just enough control to allow me to get out of ambiguous situations of my own making".
I went through the carefully constructed backdrops of Gaffer's examples to check for regressions. Everything worked as expected for the most part, but it did highlight a couple of issues that I've commented inline...
Code all looks reasonable to me - Murray seems to have done a good job of catching weird cases interactively. Do we have a quick way of disabling depth write for pixels with zero alpha, so the text just has super ugly edges, instead of being surrounded by a gray box? |
Thanks for the reviews - I've pushed a couple of commits that hopefully get this into a reasonable place. |
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.
Fixes look good to me, thanks!
I do wonder if we shouldn't just be refusing to render text outside the backdrop, but maybe that's best left for another time.
Yeah, maybe we consider that at the same time as tackling more advanced text layout for backdrops...
We now automatically draw larger backdrops behind smaller ones, so that nested backdrops "just work". An additional `depth` plug allows the user to override this in rare cases where they want a smaller backdrop to appear beneath a larger one.
We were already trying to discard fragments with zero alpha so that they don't affect selection hits. But we were doing that before taking the texture alpha into account. Although the original motivation was selection hits, discarding zero alpha also avoids depth buffer writes, which is important now that Backdrops use depth buffering to control the order of nesting.
d409bf5
to
d42c572
Compare
Rebased to squash fixup in - merging. |
We now automatically draw larger backdrops behind smaller ones, so that nested backdrops "just work". An additional
depth
plug allows the user to override this in rare cases where they want a smaller backdrop to appear beneath a larger one.