Problem with opacity texture

Hi, I’m sorry to contact you so often, but time is running out, and I don’t know what to do. I was given an opacity texture, I applied it, but my legs were painted white and that’s all ((Help please
https://jsfiddle.net/ahoxq4gz/3/

Hiya M!

I hope it’s OK with you… that I made a test in the BJS Playground app.

https://playground.babylonjs.com/#KK23QT

Something odd is happening at line 33 - opacityTexture.getAlphaFromRGB = true

I changed it to false in line 34.

Now we can study it, and do more tests, and listen for more comments.

2 Likes

Everything is fine with me) Thanks for the answer. getAlphaFromRGB, I took from this topic PBR Alpha Map - Questions & Answers - HTML5 Game Devs Forum
And it works, but not as it should, the legs are not transparent ((

Pinging @sebavan as he already dug into pixi :slight_smile:

1 Like

The problem is not with pixi :slight_smile: Babylon.js Playground @MartynovOleg, would be great to use pg when it is possible as it helps us a lot for debugging.

It also works as expected:

Basically, you are setting a full white texture meaning fully transparent on the legs which are on the OPAQUE mode so you would see the canvas background itself. In PBR you need to first choose a blend mode (it has the prio over anything else to enable a lot of various cases) and then if you rely on an opacity texture, it would be interesting to not have it full constant or you could simply play with the alpha property.

1 Like

Thanks a lot) I used spector js for debugging once, but completely forgot about it. In this case, I tried to render the pixy picture and then the model, and in theory if her legs are transparent, and judging by your picture it is, I should have seen the picture through her legs, but they are still white and that’s it) Well now I will try to debug.

1 Like

I get this result, my legs are transparent but the pixie picture is ignored, I don’t know why ((Do I need to select the blend mode? I just do not quite understand what you were talking about ((

It was necessary to set the transparencyMode parameter to 2 (ALPHABLEND)
Thank you all))

Sorry, I didn’t notice at first. Now my shoulders are transparent. I don’t quite understand what the problem is ((Damn, the problems do not end there, solve this one and that’s it ((
image

Are they just not part of the same mesh ??? so reusing the same material ???

1 Like

Moreover, if you turn the model sideways, then the shoulders are normal ((

Yes, you’re right, it’s the same mesh. If not for this, the problem would be solved by the usual dispose. But they don’t want to redo the model for me ((. Amm, should I ask that they make a normal opacity texture? “so reusing the same material ???” - what do you mean ?

As it is one mesh, it uses the same setup so you can not sort the mesh correctly you need here to split your mesh to achieve what you try .

1 Like

Oк, I understood )