# Depth Renderer

> Learn all about the depth renderer in Babylon.js.

Source: https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/depthValuesDepthRenderer

BABYLON.DepthRenderer is a tool used to generate a depth texture (a texture that contains the depth buffer and can be used to read scene depth values).

Using it is pretty straightforward:

```javascript
const renderer = scene.enableDepthRenderer();
```

Starting from there, the scene will fill the renderer with depth values for you. All active meshes (meshes that are visible from the current camera's point of view) are drawn by the DepthRenderer.

**Warning: Transparent meshes are not drawn because they are not written to the depth buffer**

You can then use the texture associated with the renderer like any other texture by using the `getDepthMap()` function:

```javascript
const mat = new BABYLON.StandardMaterial("mat01", scene);
mat.emissiveTexture = renderer.getDepthMap();
```

If you want to disable the renderer, just call the following code:

```javascript
scene.disableDepthRender();
```

As you can see, you can use the depth map associated with the DepthRenderer with any materials or post-processes.

**Note: By default, the generated texture uses float components thanks to the _WebGL OES_texture_float_ extension. If this extension is not supported, Babylon.js reverts to byte components, which means less precision for depth values.**
