google / google/neuroglancer

feat: Improve blending with multiple volume rendering layers

Open
#771 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
389
Avg merge
3d 21h
Merged PRs (30d)
3

Description

In https://github.com/google/neuroglancer/pull/671, it was brought up about the colors across volume rendering layers not blending how one would expect (red + green = kind of brown, instead of yellow, see the 2D).

![Image](https://github.com/user-attachments/assets/4734b800-a258-48bb-a03c-ffd31f4b7f66)

I thought a small bit of background would be useful. At one point, we had max projection layers blend in a non-order independent way. This caused issues though, like so:
https://github.com/user-attachments/assets/40788474-a81f-495c-a005-0fb32865e857
And as such, was fixed to use OIT blending in https://github.com/google/neuroglancer/pull/584

Aside -- If I make a very small change from just before that PR at commit `5235ef2876c8e60502890164a918c3e67e6c115d`, the result is I think more along the lines of what I guess the expected outcome is:
![Image](https://github.com/user-attachments/assets/a01e541e-0a6a-484a-a0d4-94417077f58f)
![Image](https://github.com/user-attachments/assets/14b89e6f-38a1-4860-9cba-74f569776190)

Then, we had further blending issues between volume rendering and the other neuroglancer layers. As such the OIT blending was used to combine the VR result and the result from other transparent layers at that point to fix issues in
https://github.com/google/neuroglancer/pull/589

After this, we kind of further baked in this idea of volume rendering behaving differently by allowing it to render to a different buffer than the regular transparent buffer. This buffer could be smaller in XY resolution than the final OIT/transparent buffer which is used at the final step to contribute that what ends up on screen. This was in:
https://github.com/google/neuroglancer/pull/591

I'd need to dig/think a little more, but I guess there could be two different kind of volume rendering buffers setup for two different blending modes. From what I can think of right now, the additive blending might not look that well with other layers that are not additive VR rendering layers though.

You'd basically make a new volume rendering buffer that stores the color and blends it without using OIT like the old volume rendering did before the fixes to make it behave better with other transparent and non-transparent layers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.