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
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
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?
sebavan
September 2, 2024, 5:31pm
7
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
kzhsw
September 4, 2024, 1:45am
10
OS: Windows 10 x64
Browser: ungoogled-chromium 108.0.5359.95
Babylon.js: 5.38.0
Playground: Babylon.js Playground
Expected:
Exported GLB should contains the original image.
Actual:
JPEG-encoded image is converted to PNG.
Image size goes from 8160 bytes to 112602 bytes.
See the console.assert codes for detail.
Exporting the original texture image can bypass the use of gpu.