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

Separate pass for billboards #8810

Open
lilleyse opened this issue Apr 28, 2020 · 1 comment
Open

Separate pass for billboards #8810

lilleyse opened this issue Apr 28, 2020 · 1 comment

Comments

@lilleyse
Copy link
Contributor

There's several interrelated billboard issues that could be solved by rendering billboards in their own pass. It may be a requirement for #6840 and is necessary architecture for #4235.

@YoussefV you should first check out #6840 which links to #6802 (comment) which links to #5121. When billboard.disableDepthTestDistance is infinity the billboard gets clamped to the near plan so it renders above everything else, but since it still writes depth it interferes with the camera controller. Disabling depth writes on the billboard is not enough; primitives rendered after the billboard will overwrite the billboard's color which is not desired. However disabling depth writes could work if the billboard were rendered after everything else in the scene.

Now comes the tie-in for #4235. There's some discussion in that issue about rendering billboards in a separate pass in order to improve rendering quality. The two things that really hurt billboard (and label) quality at the moment are viewer.useBrowserRecomendedResolution and FXAA. We set viewer.useBrowserRecomendedResolution to true by default because it significantly improves performance for high-DPI displays, but it tends to hurt the quality of text. FXAA is disabled by default, but when it's enabled it also has the tendency to blur text. MSAA is a better alternative to FXAA but it doesn't help or hurt billboard quality since it's geometric anti-aliasing. This sandcastle compares how these options affect billboard quality: sandcastle. If we want to render the crispest text possible we will likely need to render billboards to a native-res framebuffer in a separate pass from the rest of the scene.

@YoussefV for now let's concentrate on fixing #6840, but make the right architectural decisions for #4235. Roughly what this involves is:

  • Render billboards in their own Pass after the translucent pass. It will consist of three "subpasses"
    • Render opaque billboards with depth test/write enabled
    • Render translucent billboards with depth test enabled, depth write disabled
    • Render billboards with disableDepthTestDistance === Number.POSITIVE_INFINITY with depth test/write disabled
  • If billboards aren't rendered in the translucent OIT pass anymore we may start to see alpha blending problems. Billboards may need to be sorted by depth every frame, though this could be prohibitively expensive. Though it would help fix Billboard ordering incorrect when using disableDepthTestDistance #6838.
  • Don't worry about rendering to a different framebuffer or anything yet, but I think we'll need to do it eventually.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants