GlowLayer and NodeMaterials

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:

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 :slight_smile:


1 Like

Welcome aboard!

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