# volume rendering issues with two objects

**URL:** <https://discourse.vtk.org/t/volume-rendering-issues-with-two-objects/12922>\
**Category:** vtk.js\
**Created:** [December 18, 2023, 9:11am UTC](https://discourse.vtk.org/t/volume-rendering-issues-with-two-objects/12922 "2023-12-18T09:11:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gzt036](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gzt036/32/5960_2.png) [@gzt036](https://discourse.vtk.org/u/gzt036)\
**Post date:** [December 18, 2023, 9:11am UTC](https://discourse.vtk.org/t/volume-rendering-issues-with-two-objects/12922/1 "2023-12-18T09:11:29Z")

</div>

loading two volumes and place them separately, you will see the rendering issues with z-order.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/c/c777e7e76986856b575f684893446c248a4f191c.jpeg)

 ![image](https://discourse.vtk.org/uploads/default/original/2X/b/bae12e554a04128b735b57362ed2fd70d56cfdc3.jpeg)

basically the one on top will always blocking the other one, no matter what direction you look at. Could this be fixed? Thanks!

---

<div class="post-metadata">

**Author:** ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)\
**Post date:** [December 18, 2023, 9:53am UTC](https://discourse.vtk.org/t/volume-rendering-issues-with-two-objects/12922/2 "2023-12-18T09:53:25Z")

</div>

Do you confirm you are using VTK.js ?

This is an expected behavior in VTK.js. The volume rendering does not write into the depth buffer, hence the last volume to be rendered to writing on top of the previous volume.  
To correctly support it, a multi-volume mapper should be created and it does not exist at this time.

Regards,  
Julien.

---

<div class="post-metadata">

**Author:** ![gzt036](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gzt036/32/5960_2.png) [@gzt036](https://discourse.vtk.org/u/gzt036)\
**Post date:** [December 19, 2023, 1:02am UTC](https://discourse.vtk.org/t/volume-rendering-issues-with-two-objects/12922/3 "2023-12-19T01:02:20Z")

</div>

Thanks Julien for your clear explanation. Is this somehow also related to the other problem of volume rendering with transparent objects? [rendering problems when volume and surface source are added in the same scene](https://discourse.vtk.org/t/rendering-problems-when-volume-and-surface-source-are-added-in-the-same-scene/8849)

Volume rendering is what makes VTK.js distinct from other online 3D packages, e.g. three.js, Correct and robust volume rendering should be its essential feature not just for the value of the package but also the great expansion of the potential applications. I strongly suggest VTK.js team make this one of the top priorities.

---

<div class="post-metadata">

**Author:** ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)\
**Post date:** [December 19, 2023, 7:25am UTC](https://discourse.vtk.org/t/volume-rendering-issues-with-two-objects/12922/4 "2023-12-19T07:25:48Z")

</div>

No this is a different technical aspect (depth peeling)

VTK.js improvements are coming from the community or external funding. Please consider submitting pull requests or reach me out if you have funding to support such efforts.
