Mirrored instance meshes are not visible in sandbox

Hello, I want to report a bug - in the sandbox, mirrored instanced meshes are either shown in black or invisible. Appears only if instance meshes are mirrored. Screenshot attached - I have switched on edges rendering on black meshes.

A few days ago there wasn’t such problem, maybe it was sandbox update recently after which this problem have appeared.

Hi and welcome to the Community,
Can you provide a little more details (confirm) since there’s no PG.
When you say ‘mirrored instances’, do you mean instances with a minus scaling on whatever axis?
I’m asking because I’m experiencing this problem also starting from shortly (about 1 week ago) and I made a post about this. I found that it happens only with instances (not with clones). It also seems to happen only under ‘unknown’ conditions from an imported mesh.
Could you please confirm the above (instance is not rendering with a minus scaling on either axis)?
If so, I will try push this because I did find a workaround for my current project but I believe this is still not normal (especially considering that it was working until now).
Thanks and meanwhile have a great day :sunglasses:

Hi mawa,

yes, confirmed, this problem is appearing on instanced meshes with negative transform values. I mirror them in 3ds max and then export to sandbox, and this is what I get…

Got it. Looks like the same thing I’m experiencing with an obj export from c4d.
Did you try not to mirror it in 3ds and then mirror it in BJS (something I tried without success).
Can you also confirm you are using the left-handed system (the BJS default)?
Can you also try it with a clone instead of instance?
And then let us know about the results…

It would be good if you could do the same tests I did - and then, on my side, I’ll call in again @carolhmj on this topic because something just has to have gone wrong with this later update.
Thanks,

Edit: BTW, the bug I experienced not just in the sandbox, but also from my server (running the current preview version)

I tried - if I export with positive value (not mirrored), all is shown as expected.

If I use clone (so each mesh is unique), even mirrors looks okay too. So the problem is in the instanced mirrored meshes for sure.

Sorry I am not developer so I don’t have any idea about left or right-handed system, I just guess it must be default, since I am using 3ds max export plugin.

P.S.: I remember that 10 years ago in 3ds max 2011 there also was a problem with showing mirrored objects - normals were flipped in incorrect way, therefore all mirrored objects were shown as black. Probably, Babylon now has similar issue…

Hello,

Can you provide your meshes so we can test?

Same for me (using obj file format)

Yup would be amazing to have a repro mesh ??? this is a pretty big issue I would like to fix it ASAP

@mawa could you share your obj ?

My obj is currently a bit of ‘a mess’. Understand it’s a fully editable sketch version of a monumental scene.
It doesn’t affect the object itself though (at least ,I don’t think so, since it was working before). But it certainly doesn’t help for debug.
Just give me some time to remove all the other meshes, quickly check this extract in a new scene, and if the bug remains as such, I will send you a repro for just this part. Thanks,

2 Likes

@sebavan
Here goes my debug version. Cleaned the scene to keep just the two objects involved with this bug.
I had to push it on my preview server because I cannot give the dev link public. So you can access the scene with this link from my preview environment:
https://media-geneva.ch/demos/bjs/museum/museum-instance-debug.html
and you can download the script and asset from this link:
https://media-geneva.ch/demos/bjs/museum/debug-instances.zip

I tried to keep with the overall structure of the script to ensure it still matches my case. Sorry for the additional script.

In this repro, every instance of name ‘*inst0’ has received a -1 scaling on the y.axis. However a minus scaling on any axis will do the same (the instance does not render). A clone version from the same mesh does render with mirrored scaling on any axis.

The original mesh from c4d exported to obj DOES NOT HAVE a minus scaling. However, one thing that is common to all these meshes is that they have a DISPLACED PIVOT and also a ROTATION on the XZ plane.

Hope this helps and please let me know,
Thanks,

Ok, here is a simpler repro : Babylon.js Playground

Oh,fancy! :face_with_raised_eyebrow: I tried this with the rabit PG (StanfordBunny.obj) and it didn’t repro the bug and @carolhmj did some tests too and couldn’t repro either. :thinking:

Edit:

Thanks to the awesome @Deltakosh Fix negative scaling issue with instances by deltakosh · Pull Request #13055 · BabylonJS/Babylon.js · GitHub

2 Likes