DefaultRenderingPipeline. Glow layer support in Babylon Native

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

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:

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

pipeline.glowLayerEnabled = true;

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

Any thoughts?

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

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

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?

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.

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


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

1 Like

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.

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

We will work on the real solution for later.

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 (

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

engine.getCaps().parallelShaderCompile = undefined;
1 Like

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!

1 Like

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

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

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:

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 :slight_smile: So close!

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

1 Like