# DefaultRenderingPipeline. Glow layer support in Babylon Native

**URL:** <https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969>\
**Category:** Questions\
**Created:** [January 5, 2024, 4:02am UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969 "2024-01-05T04:02:52Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [January 5, 2024, 4:02am UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/1 "2024-01-05T04:02:52Z")

</div>

Seems GlowLayer is not supported via the DefaultRenderingPipeline in Babylon Native. Getting an exception:

```auto
Exception thrown: 'System.IO.IOException' in System.Net.Sockets.dll
'NativeTestApp.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.4\System.Text.Encoding.Extensions.dll'. 
The program '[3616] NativeTestApp.exe' has exited with code 0 (0x0).

```

To repro just add this to the babylon native example app:

```auto

    var pipeline = new DefaultRenderingPipeline("defaultRPPostProcess", true, scene, [scene.activeCamera]);

pipeline.glowLayerEnabled = true;

```

you’ll want to add this here instead of using imageProcessingConfiguration.

> <https://github.com/BabylonJS/BabylonNativeExamples/blob/main/Apps/ConsoleApp/Scripts/index.js#L64>

Any thoughts?  
@bghgary

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 5, 2024, 4:11pm UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/2 "2024-01-05T16:11:15Z")

</div>

My guess is that exception is unrelated. I can investigate next week.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 5, 2024, 4:18pm UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/3 "2024-01-05T16:18:06Z")

</div>

Assigned @bghgary on January 5, 2024, 4:18pm UTC



---

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [January 10, 2024, 10:10pm UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/4 "2024-01-10T22:10:42Z")

</div>

@bghgary any update on this? Do you need anything else from me to help debug/test?

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 10, 2024, 11:11pm UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/5 "2024-01-10T23:11:26Z")

</div>

Sorry, I was hoping to get to this soon, but I’m swamped at the moment. I can definitely look at it on Friday, hopefully sooner. Is this urgent for you?

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 10, 2024, 11:41pm UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/6 "2024-01-10T23:41:57Z")

</div>

I found some time to at least try to repro. I was unable to get the exception, but the glow layer also doesn’t work.

---

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [January 11, 2024, 12:47am UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/7 "2024-01-11T00:47:02Z")

</div>

i’ll take ‘glow layer doesn’t work’ as a repro 🙂 The exception may be something on our end downstream. Let me know if you hit any roadblocks, i’ll try to dig further myself.

-Anupam

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 11, 2024, 12:53am UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/8 "2024-01-11T00:53:00Z")

</div>

I figured out what is going on. It is a problem on the JS side. I will give you a workaround in a bit.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 11, 2024, 1:28am UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/9 "2024-01-11T01:28:36Z")

</div>

This is total hack for now, but if you put the following code before the `NativeEngine` is created in the JS code, it will force the shaders to be compiled synchronously.

```js
BABYLON.NativeEngine.prototype.isAsync = function () { return false; }

```

We will work on the real solution for later.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 11, 2024, 11:41pm UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/10 "2024-01-11T23:41:11Z")

</div>

This PR will make it such that you can turn off async shader compilation using the same mechanism as the web.

[Fixes for native async shader compilation by bghgary · Pull Request #14701 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/14701)

Turn it off by setting the following after creating the engine:

```js
engine.getCaps().parallelShaderCompile = undefined;

```

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 12, 2024, 1:47am UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/11 "2024-01-12T01:47:54Z")

</div>

Unassigned @bghgary on January 12, 2024, 1:47am UTC



---

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [January 13, 2024, 5:14pm UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/12 "2024-01-13T17:14:23Z")

</div>

Amazing as usual Gary. Unfortunately still getting the exception so there may be additional things going on , I will debug this further and keep you posted. Thanks so much again and have an excellent weekend!

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 16, 2024, 4:54pm UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/13 "2024-01-16T16:54:50Z")

</div>

Are you getting the exception with the Babylon Native Example app?

---

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [January 16, 2024, 5:32pm UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/14 "2024-01-16T17:32:42Z")

</div>

Its crashing in our app , havent tried it with native example… let me give that a shot quick and I’ll report back.

---

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [February 17, 2024, 6:29am UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/15 "2024-02-17T06:29:05Z")

</div>

Following back up on this. So we still are not able to get the glow effect to render using our own code but it does work using the native test app. We’re not getting a crash but we just dont see the glow

I noticed none of the observables were being called eg.onBeforeComposeObservable

after some debugging, looks like its failing this check:

> <https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Layers/effectLayer.ts#L751>

Is there anything that could cause this check to fail that you might know of? We have an emissive mesh in the scene (the xbox nexus quad on the controller), so the glow should be getting applied to there.

I checked if the nexus mesh was included in the glow layer using glowLayer.hasMesh and it is included. Also onAfterRenderMeshToEffect is getting called for all meshes in the scene including the nexus mesh. This is consistent with what im seeing in the example app.

I also tried to just remove any DefaultRenderingPipeline stuff and just added the GlowLayer effect without any other post processing and it still does not work.

I’ll keep digging but wondering if you had anything that comes to mind…

this is the last little bit thats blocking us from launching our new back end renderer. Trying to get this resolved in the next week 🙂 So close!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [February 19, 2024, 8:50pm UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/17 "2024-02-19T20:50:00Z")

</div>

Assigned @bghgary on February 19, 2024, 8:50pm UTC



---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [February 22, 2024, 12:52am UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/18 "2024-02-22T00:52:59Z")

</div>

> [@bghgary](#):
>
> `engine.getCaps().parallelShaderCompile = undefined;`

You are missing this in the code. Once I add it, it works.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [February 22, 2024, 12:56am UTC](https://forum.babylonjs.com/t/defaultrenderingpipeline-glow-layer-support-in-babylon-native/46969/19 "2024-02-22T00:56:07Z")

</div>

Unassigned @bghgary on February 22, 2024, 12:56am UTC


