Stretched view in preview version

Hi guys,

reporting a bug with scene display on preview version. The scene is exported from Unity with Khronos Babylon exporter and looks stretched, like this:

On stable version it’s okay though.

Is it a problem with the exporter or with the framework?

Hello and welcome!

do you mean with glTF or .babylon file format?

That being said both should work. Can you make sure your are calling engine.resize() ?

It’s babylon. With GLBs it’s good both in preview and stable. It’s only .babylon in preview version that is bad. And by the way it happened from what I remember just a day or two ago. It was okay earlier.

And yes, I’m calling engine.resize

can you share a repro in the playground? (Using External Assets - Babylon.js Documentation)

Yeah, I’ll try to.

In the meanwhile I’ve found out it only happens with scenes from Unity Babylon exporter. The scene exported from Babylon Editor is displayed okay.

ok so let me add @MackeyK24

So here is the scene in the playground:

There are just several cubes there and they also show up in my code stretched. But in playgroung they show up okay. The question is what engine version is used in the playground? Is it the preview version? The problem on my side is only visible in the preview version. On stable it’s okay.

Look in the console message of your browser when the PG is opened.

It’s Babylon.js v4.1.0-rc.9

So I assume it’s the preview version?

It is always the last one

Which version are you using on your computer?

Well it’s the preview version:

Try to flush the cache of the browser, I think you should normally get “4.1.0”.

Yeah, I’ve tried it and I’m getting rc.9:

When I display in the browser and I look for “4.1.0” (without quotation marks), I only find 2 occurrences:

  • return"babylonjs@4.1.0"
  • return"4.1.0"

There’s no 4.1.0-rc.9 string in this file (I don’t think the minification can compact this string into something else). There’s no rc.9 either.

Well that becomes interesting then.

One more weird thing I’ve noticed is that when I load the engine from, it shows me 4.1.0 without rc.9 in the console, and also shows me a stretched picture BUT not on all scenes from Unity. There is a scene which is not affected by this!

I’ll try to investigate further.

Can you package up and send me the scene … I’ll take a look in the legacy unity exporter…

Note: the newer version of toolkit is now GLTF 2.0
So you don’t get a lot of those issues we have going from unity to Babylon Json

Wow, super, I didn’t know about that! Where can I find the .unitypackage to try it out? If it exports everything correctly then the problem is solved.