PBRMaterial hiding Sprite?

Okay this one is really weird and I don’t really know how it can happen.

I’m sorry that I don’t give a playground but the app that I’m working on is so much complex that making a playground that can reproduce the exact same scenario is really time consuming and too hard without making it incomprehensible.

So the thing is that I’m importing many glb in my scene. There’s only one kind of glb that is creating the problem.
Every other meshes has a custom StandardMaterial and the problematic ones has a PBRMaterial that is not replaced by another material because I need to keep the material infos in the original model.
There’s a functionnality in the app that shows “plus” sprites near a mesh that enables the mesh duplication on the sprite position.
(like this : )

But when I try to show sprites on the mesh that has the PBRMaterial it don’t appear. And what is the most brainf***ing is that if I click on the spot where the sprite is supposed to appear, it does the duplication so it’s pickable just hided by something in the material.

And what makes me believe that the cause is the PBRMaterial is that if I replace the PBRMaterial by a standardMaterial, (which I don’t really want because I want to keep the params as nearest as the glb give) the sprites are visible :

With a Standard Material (sprites are visible and pickable):

With a PBR material (sprites are hidden by something but pickable) :

I’m really desperate on this one if someone can has some relevant clues or knows the problem and knows how to fix it would be a great relief.

Thank you

It is unfortunately impossible to troubleshoot without accessing a repro somewhere. Are you sure that the sprites are not visible from the back and you are not overriding too much from the glb setup ?

1 Like

I tried to look at the scene at every angles and modify a lot of property of the material but still can’t see it. I don’t know what you mean by overriding but I don’t think that I’m doing something that could trigger this kind of behavior.

Okay I found the problem it was something about the backfaceCulling …
To see what I’m talking about, go to this link and change line 208 to true.
(The material apperently hide the sprite if backfaceculling is set to true)

So as @Deltakosh said in GLTF Model (from 3DS exporter) does not generate shadows, faces may be flipped when importing a glb there’s something about right handed and left handed.
The guy who created this topic had to set the backfaceCulling to false to see the faces correctly.

Is there a way to avoid to set backFaceCulling to false or avoid this kind of inversion ? Because let backfaceCulling to true can reduce perfomances ?

Yup that is exaclty why i asked if you were able to see them form behind :slight_smile:

You can change the winding order on the material with sideOrientation which is how the PBR material sets it.