# renderer renders with wrong order with opacity

**URL:** https://discourse.vtk.org/t/renderer-renders-with-wrong-order-with-opacity/2833
**Category:** Support
**Created:** [March 17, 2020, 11:14am UTC](https://discourse.vtk.org/t/renderer-renders-with-wrong-order-with-opacity/2833 "2020-03-17T11:14:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [March 17, 2020, 11:14am UTC](https://discourse.vtk.org/t/renderer-renders-with-wrong-order-with-opacity/2833/1 "2020-03-17T11:14:31Z")

</div>

Hello,

I have a problem with the order of the rendering. I have a render and i render a dicom volume and some geometric polydatas like a cube. The problem is that if i add some oppacity in the cube, some parts dissappear because of the dicom volume. As if the cube was rendered behind. It only happens if the oppacity is set. i read that this can be solved by setting SetUseDepthPeeling. but in my case nothing happens.

bad rendered  
 ![problemaCubo](https://discourse.vtk.org/uploads/default/original/2X/5/542a9588195ffb8355531cf6c525987d5a43e837.png)

![problemaCubo2](https://discourse.vtk.org/uploads/default/original/2X/8/8060b9545d3f88fdc9b1b87dcf8944a291d3861e.png)

visible here (depends on the camera rotation)  
 ![CubobBIENrendered](https://discourse.vtk.org/uploads/default/original/2X/6/6dfaedd1ab3261f87934878125b40b310228827b.png)

```
 get_volume_render_window()->
  GetRenderers()->GetFirstRenderer()->AddActor(windows_splint);
 get_volume_render_window()->
  GetRenderers()->GetFirstRenderer()->SetUseDepthPeeling(true);
 get_volume_render_window()->SetAlphaBitPlanes(true);
 get_volume_render_window()->SetMultiSamples(false);
```

---

<div class="post-metadata">

### Author: ![Michael](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael/32/16_2.png) [@Michael](https://discourse.vtk.org/u/Michael)
#### Post date: [March 17, 2020, 1:20pm UTC](https://discourse.vtk.org/t/renderer-renders-with-wrong-order-with-opacity/2833/2 "2020-03-17T13:20:07Z")

</div>

You probably want to enable depth peeling for volumes as well:  
`get_volume_render_window()-> GetRenderers()->GetFirstRenderer()->UseDepthPeelingForVolumesOn()`

---

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [March 17, 2020, 3:16pm UTC](https://discourse.vtk.org/t/renderer-renders-with-wrong-order-with-opacity/2833/3 "2020-03-17T15:16:41Z")

</div>

thank you
