-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[wip] layer-by-layer rendering #1197
Conversation
You likely have to request a buffer that is a combination of depth and stencil buffer with something like |
I figured out the depth/stencil buffer issue, but there are still quite a few rendering test failures. |
World wrapping is broken -- the multiply-used z0 tile is being overdrawn because its matrix is always calculated using the wrapped coordinates in |
I've been digging into some of the rendering test failures today and it looks like even though the depthstencil is set up properly the depth buffer isn't working. The rendering tests only show something if depthFunc is set to pass fragments with equal z values ( |
@ansis - It's possible my hack in ad59cd0 does not actually result in a depth buffer getting created on the headless-gl side. See stackgl/headless-gl#15. |
Instead of drawing the current tile's clipping area before starting a triangle, draw clipping masks for all tiles at the beginning. This will let us to switch to layer-by-layer rendering.
The first pass draws opaque objects top-down without blending. The second pass draws translucent objects bottom-up with blending. The depth buffer is used to drop fragments below opaque fills.
I'm stuck. From what I can tell depth writing and testing is working properly in the headless testing, but Here's a separate case where the @kkaefer any ideas? |
This is blocked by making both depth and stencil testing work for render tests. This means figuring out how to use a depthstencil in headless-gl or finding a different way to do render tests. |
Status update here: we believe that recent releases of stackgl/headless-gl should resolve the depth and stencil testing issues in headless rendering. However we've run into issues with using recent releases of stackgl/headless-gl in CI that need to be dug into. We're following that progress in #1447. |
We're now using headless-gl 2.0 and should check that this is unblocked as expected. |
⇢ #1727 |
This fixes #193 and fixes #757 and fixes #1156.
Rendering tests are all currently failing because it's lacking a depth buffer. I tried adding it with https://gist.github.com/ansis/d07edada904fad335520 but it's not working. The framebuffer status check is returning 36061 (FRAMEBUFFER_UNSUPPORTED). @kkaefer any ideas?
what my attempt at setting up a depth buffer looked like:
Performance: It seems similar. Needs more careful testing. @mourner
With these changes rendering works more similarly to -native. All layers are drawn in two passes: opaque and then transparent. Tile clip ids are drawn to the stencil at the same time to allow for fast switching between tiles. The depth buffer is used to drop fragments below opaque fills..
I did not make any effort to name and structure things similarly to -native. We should reorganize things in both so that they are more similar.
Clip ids work a bit differently than in -native. Each source as it's own set of clip ids and the stencil mask is redrawn whenever it switches between sources. This approach us use less stencil bits (5). With only 5 bits we have 3 left over for drawing fills. This is what let me implement this before we merge the fill triangulation work. I also have concerns about whether -native's stencil clipping works properly across multiple sources.