How to use MultiMaterial on DOUBLESIDE Plane

I’m trying to make a card with 2 materials. I used to make this working, but now it is not working and I don’t know why. So it proves I lack real understanding of the things here. I asked several AIs and they cannot fix it either, so this problem may not be that obvious. I believe the front face is rendered because if you try scrolling you can see the front face rendered briefly, feels like a z-fighting problem, but should not be it? And anyone help me how to make this working? Thanks!

From the docs, i cannot figure it out and even do not understand what’s the difference between verticesStart: number and indexStart: number of Babylon.js docs

Hey, welcome!


You should fix this error first:

This works:

1 Like

I grabbed two files online to replace my local file and caused the CORS issue. Thanks for pointing this out!

Is there any way to avoid updating the VerticesData manually to achieve this? Because I had a working code using BABYLON.Mesh.DOUBLESIDE plane before, now it does not work and I don’t think I changed my code though. Additionally, I do see the front side rendered briefly when scaling aggressively with an angle, which feels like a bug to me?

Like this:

1 Like

Yes! That’s what I was trying to do! But I found an interesting issue, i only commented out the per frame update, and back side will not be rendered. Why is that?

Because the scene uses a PointLight and the other side of the mesh is not lit with this light. Since the plane is rotating but the light is stationary… you get the point…

Replace with a HemisphericLight and you’ll see the textures on both sides.

If you want two different textures (like a card) but you don’t need different materials there is a simpler solution. Let me know.

2 Likes

Thank you a lot! Now I have a better understanding of this plus some lighting!

1 Like