NullEngine bug on latest preview version

Hello,

I wanted to report an issue with version 5.0.0-alpha.63.
I am trying to create the headless version of Babylon using NullEngine but I get the following error :

TypeError: e._getDrawWrapper is not a function

Worth noting that it worked with the latest stable version, I recently upgraded to try the WebGPU port.

Cheers.

Adding @Evgeni_Popov who built the draw wrapper. Could you provide a repro of the code you use with nullEngine to pin point the culprit ?

It’s tough to provide a repro but should be fairly easy to reproduce. It always gives the error if the scene has at least one mesh and it fails on the first render call.

I’m not able to reproduce the problem:

https://playground.babylonjs.com/#RNJVMT

I was able to reproduce when it happens but I doubt it needs to be tested on Node.
So basically the issue comes up when adding a render outline like this :

sphere.renderOutline = true;
sphere.outlineWidth = 0.02;
sphere.outlineColor = BABYLON.Color3.Black();

Obviously you don’t need an outline serverside but I am using shared components thus the issue. I wasn’t able to reproduce it in the playground as well.

It still does not seem to break in the playground: https://playground.babylonjs.com/#RNJVMT#1 are you sure it is only this that made it break for you ?

Yup, I suspect it doesn’t break the playground since it still renders on a browser. Maybe if it’s tested in a NodeJS environment would be easier to replicate.

1 Like

Would it be possible for you to create a tiny repro on Github ? This would be amazingly helpful to troubleshoot. I am not able to repro in our unit tests and the only places I am seeing _getDrawWrapper in the outline do not make much senses :frowning:

Actually this does not fail on node:

import { NullEngine, Scene, FreeCamera, Vector3, HemisphericLight, MeshBuilder, Color3 } from '@babylonjs/core'

const engine = new NullEngine()

const scene = new Scene(engine);
new FreeCamera("camera1", new Vector3(0, 5, -10), scene);
new HemisphericLight("light", new Vector3(0, 1, 0), scene);

MeshBuilder.CreateGround("ground", {width: 6, height: 6}, scene);

const sphere = MeshBuilder.CreateSphere("sphere", {diameter: 2, segments: 32}, scene);
sphere.renderOutline = true;
sphere.outlineWidth = 0.02;
sphere.outlineColor = Color3.Black();

engine.runRenderLoop(() => {
    scene.render();
});

with

1 Like

Hi @Null just checking in, were you able to create a repro? :slight_smile:

Hey there, nope, I did a workaround by removing the outline in the Server side. Repro is tough given that I would need to provide the whole webpack based solution together with the wrapper I have used for Bjs.

I’ll try this one and let you know.

1 Like