Alpha blending. One transparent mesh in front another

Hi.

I have situation like this, where I want to put a curtain in front of a window

When I set the transparency to the curtain, it looks like window glass gets in front of the curtain.

Any idea why is this happening?

This might be helpful:

https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered

Well. I basically had one two meshes attached together. One part was the window glass on the images, and one is window glass on the window across the room. The glitch is happening while they are attached, which kinda makes sense to me, but at the same time I don’t know why is that happening. But I’ve separated those two parts of the windows and now it works fine.

Thanks for the answer tho, I need to research a bit about transparency, because it’s not the first time that it gives me issues.

Okay. Turns out that Alpha Index helps with this. So your answer was helpful indeed. Thank you.