# Trying to better understand (auto?) depth write in shaders?

**URL:** <https://forum.babylonjs.com/t/trying-to-better-understand-auto-depth-write-in-shaders/36358>\
**Category:** Questions\
**Tags:** material, shader\
**Created:** [December 7, 2022, 11:03pm UTC](https://forum.babylonjs.com/t/trying-to-better-understand-auto-depth-write-in-shaders/36358 "2022-12-07T23:03:54Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![inteja](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/inteja/32/22553_2.png) [@inteja](https://forum.babylonjs.com/u/inteja)\
**Post date:** [February 25, 2023, 11:00pm UTC](https://forum.babylonjs.com/t/trying-to-better-understand-auto-depth-write-in-shaders/36358/8 "2023-02-25T23:00:07Z")

</div>

Thanks @Evgeni_Popov, that got me a step closer. I managed to get it going:

> **[Babylon.js Playground](https://playground.babylonjs.com/#53D9YK%2322)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

However one of my goals in migrating from `ShaderMaterial` to `MaterialPluginBase` was that I’d made the assumption that I could then use greased line `emissiveColor` with `GlowLayer` but it seems `GlowLayer` is not yet compatible with material plugins 🙁

> [@Material plugin with glowlayer](https://forum.babylonjs.com/t/material-plugin-with-glowlayer/36523/1):
>
> PG: [Babylon.js Playground](https://playground.babylonjs.com/#YDNN9K) Glowlayer is using its own shader to create the glowmap so it can’t catch the shader code from material plugins. I dig into the source code but find it hard to solve the problem with some clean hack. It seems that material plugin is not desined for the situation rofl, but I relied too much on it.

---

_[View the full topic](https://forum.babylonjs.com/t/trying-to-better-understand-auto-depth-write-in-shaders/36358)._
