# Z-buffer scale

**URL:** https://discourse.vtk.org/t/z-buffer-scale/3483
**Category:** Support
**Created:** [June 7, 2020, 10:08pm UTC](https://discourse.vtk.org/t/z-buffer-scale/3483 "2020-06-07T22:08:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![j.praptak](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/a6a055/32.png) [@j.praptak](https://discourse.vtk.org/u/j.praptak)
#### Post date: [June 7, 2020, 10:08pm UTC](https://discourse.vtk.org/t/z-buffer-scale/3483/1 "2020-06-07T22:08:37Z")

</div>

Hello.  
I’m creating a depth map from 3D just like in example:  
[https://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ZBuffer](https://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ZBuffer)  
Is there an easy way to set the output so that the closest point of actor is Whitest (255,255,255) and the furthest point is Blackest (0,0,0)  
I know that it can be adjusted through vtkImageShiftScale(), but I can’t make it work the way I want.

---

<div class="post-metadata">

### Author: ![Alex1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@Alex1](https://discourse.vtk.org/u/Alex1)
#### Post date: [July 14, 2020, 5:28pm UTC](https://discourse.vtk.org/t/z-buffer-scale/3483/2 "2020-07-14T17:28:45Z")

</div>

Hi,  
you can also use  
`float* renZBuffer = renWin->GetZbufferData(0, 0, renderWindowSizeX - 1, renderWindowSizeY - 1);`
