GLB Exporter has no textures if NullEngine is used

Hello everyone,

I am trying to export my scene on server side, the exact same code works if the Engine is a regular engine but if I use a NullEngine, the textures are not exported.

I am not 100% sure if it’s a bug or by design but would be great to have it working without any workarounds.

Here is the playground:

If you use a regular Engine, the produced glb file has 436KB with the NullEngine the file has only 88 bytes.

Thank you in advance :smiley:

Unfortunately this is by design. NullEngine has no access to GPU to load textures.

One way to do it: Running Babylon.js On A Server | Babylon.js Documentation (babylonjs.com)

2 Likes

Oh, no! I was hopping that was wrong with the code.

In that case, I probably have two options, right?

1 - Use puppeteer or similar solutions as was suggested in other threads

2 - Polyfill the methods to avoid the GPU calls, maybe load the texture from memory.

I will probably rethink the solution I want and go in a completely different direction.

Thanks for the answer, you just saved me a lot of time debugging!

3 Likes

My pleasure!

1 Like

When can you support this feature? I think babylon.js needs to increase support on the server-side

bro,have you solved the problem of material loss?

You could use smthg like this: Babylon.js docs

No, sir! I changed the logic to render client-side.

This is not on us unfortunately. The node.js server does not provide the required method to decode images

Exporting the original texture image can bypass the use of gpu.