enh(viz): enable binary-transparent surfacic objects with volume rendering
Description
There seems to be a rendering limitation when transparent objects are displayed in front of a volume rendering.
Proposal
Investigate if this is a real limitation or a bug.
Edit: Yes, this is a strong limitation of the current rendering pipeline. The mixed rendering only works well with fully opaque objects. Upgrading the pipeline to support arbitrary transparent surfacic objects would be a difficult task, and finding the best approach is really not easy. With depth peeling, we could integrate the volume rendering in the peeling process, and alter the ray entry/exit map along the process. With dual depth peeling, I don't know, and with WeightedBlended OIT, this is also not straightforward, because we would need the change the way we composite along rays according to depth to match this technique, which would probably end up with a different visual result.
However, our current need is about binary-transparent surfacic objects, thus with a=0 or a=1. This is a much simpler process, thus I propose to only address this for now.
Functional specifications
We will modify the rendering pipeline to take into account binary-transparent surfacic objects, such as an ultrasound video plane.
Technical specifications
When we compute the ray entries and exits in the volume rendering, we perform a last pass to mark an exit in a fragment if we encounter a surfacic object. We need to modify the shading stage to compute the alpha factor and discard the fragment if the alpha is zero. This is material specific, thus we can no longer rely on the current RayEntryPoints material. We could add manually the technique to each material, but it should be able to generate it automatically in the RayExitDepthListener
.
Test plan
In sight, we could evaluate the feature with a transparent 3D negatoscope.