# GlowLayer and NodeMaterials

**URL:** https://forum.babylonjs.com/t/glowlayer-and-nodematerials/26204
**Category:** Bugs
**Created:** [December 20, 2021, 6:22pm UTC](https://forum.babylonjs.com/t/glowlayer-and-nodematerials/26204 "2021-12-20T18:22:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dschibait](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dschibait/32/20706_2.png) [@dschibait](https://forum.babylonjs.com/u/dschibait)
#### Post date: [December 20, 2021, 6:22pm UTC](https://forum.babylonjs.com/t/glowlayer-and-nodematerials/26204/1 "2021-12-20T18:22:03Z")

</div>

Hi Folks!

i have some nice days with your NodeMaterial and now I want to let some extra glow enter my scene.  
I saw that nice video and the playground in your documentation.

So, i understand how the effect is generated, i also understand these lines of codes which enables / disableds the glowMask and also this refererMeshToUseItsOwnMaterial function.

here is the problem (im not sure if i should call it bug with my knowledge :))

Here is the example where you can see the error:  
[https://playground.babylonjs.com/#7QCYPB#38](https://playground.babylonjs.com/#7QCYPB#38)

i used the nice example from the video - and just added 2 lines of code here. Just a setTimeout for 5 seconds, between the creation of the GlowLayer and using this with the referenceMeshToUseItsOwnMaterial  
Function … yeah, ends up with the error:

Uncaught TypeError: Cannot create property ‘NORMAL’ on string ‘#define NUM\_BONE\_INFLUENCERS 0  
#define GLOW’  
at t.\_prepareDefinesForAttributes (babylon.js:16)  
at t.isReadyForSubMesh (babylon.js:16)  
at t.render (babylon.js:16)  
at t.e.\_renderSubMesh (babylon.js:16)  
at \_mainTexture.customRenderFunction (babylon.js:16)  
at e.render (babylon.js:16)  
at e.render (babylon.js:16)  
at t.renderToTarget (babylon.js:16)  
at t.\_render (babylon.js:16)  
at t.render (babylon.js:16)

So also in my project, i have to use the GlowLayer instantly after creation - then everything is working fine - but when waiting some time (or loading something) you get some problems.

Maybe i get the GlowLayer wrong, but i want to re-use them whenever i can - or should i re-create the GlowLayer for any object? (im not soooo deep in babylonjs passes, to know, if any GlowLayer has his own pipeline or not :))

would be nice if someone could explain this to me - or if it is a bug, feel free to cuddle it 🙂

regards  
Thomas

---

<div class="post-metadata">

### Author: ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)
#### Post date: [December 20, 2021, 6:28pm UTC](https://forum.babylonjs.com/t/glowlayer-and-nodematerials/26204/2 "2021-12-20T18:28:13Z")

</div>



---

<div class="post-metadata">

### Author: ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)
#### Post date: [December 20, 2021, 7:04pm UTC](https://forum.babylonjs.com/t/glowlayer-and-nodematerials/26204/3 "2021-12-20T19:04:29Z")

</div>

Welcome aboard!

This PR will fix the problem in 5.0 (it is working as expected in 4.2):

> <https://github.com/BabylonJS/Babylon.js/pull/11679>
>
> See https://forum.babylonjs.com/t/glowlayer-and-nodematerials/26204

---

<div class="post-metadata">

### Author: ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)
#### Post date: [December 20, 2021, 7:04pm UTC](https://forum.babylonjs.com/t/glowlayer-and-nodematerials/26204/4 "2021-12-20T19:04:40Z")

</div>


