# How to use tone mapping correctly when displaying transparent structures using depth peeling ?

**URL:** https://discourse.vtk.org/t/how-to-use-tone-mapping-correctly-when-displaying-transparent-structures-using-depth-peeling/11794
**Category:** Support
**Created:** [June 22, 2023, 2:48pm UTC](https://discourse.vtk.org/t/how-to-use-tone-mapping-correctly-when-displaying-transparent-structures-using-depth-peeling/11794 "2023-06-22T14:48:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ctroesch](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/c0e974/32.png) [@ctroesch](https://discourse.vtk.org/u/ctroesch)
#### Post date: [June 22, 2023, 2:48pm UTC](https://discourse.vtk.org/t/how-to-use-tone-mapping-correctly-when-displaying-transparent-structures-using-depth-peeling/11794/1 "2023-06-22T14:48:24Z")

</div>

Hi there,

I am trying to render 3D models with transparent structures using Depth Peeling, PBR, SSAO and Tone Mapping.

To do so, I use the `vtkRenderStepsPass` with the following configuration:

```auto
// Create renderer
const auto renderer = vtkRenderer::New();
renderer->SetUseImageBasedLighting(true);

// Create render steps pass
const auto renderStepsPass = vtkRenderStepsPass::New();
renderer->SetPass(renderStepsPass);

// Create Depth Peeling pass
const auto depthPeelingPass = vtkDepthPeelingPass::New();
depthPeelingPass->SetMaximumNumberOfPeels(8);
depthPeelingPass->SetOcclusionRatio(0);
depthPeelingPass->SetTranslucentPass(renderStepsPass->GetTranslucentPass());
renderStepsPass->SetTranslucentPass(depthPeelingPass);

// Create SSAO pass
ssaoPass = vtkSSAOPass::New();
ssaoPass->SetDelegatePass(renderStepsPass->GetOpaquePass());
renderStepsPass->SetOpaquePass(ssaoPass);

// Create Tone Mapping pass
const auto toneMappingPass = vtkToneMappingPass::New();
toneMappingPass->SetToneMappingType(vtkToneMappingPass::GenericFilmic);
toneMappingPass->SetGenericFilmicUncharted2Presets();
toneMappingPass->SetExposure(1.0);
toneMappingPass->SetDelegatePass(renderStepsPass->GetCameraPass());
renderStepsPass->SetPostProcessPass(toneMappingPass);

```

This works great when I display only opaque structures. When I add transparency to one of theme, the tone mapping pass washes out the colors as displayed on the following image:

 ![pbr+tonemapping](https://discourse.vtk.org/uploads/default/original/2X/0/08ae11ee923c7d9cf4fe4975cd8fe71b53fbca5a.png)

(Note: On the right, the lung structure is transparent)

Is there a way to avoid this washed-out effect somehow ?

Thanks a lot for your help,

Clément
