Hey, everyone!
I’m having some trouble getting an opacity texture to work with the PBR material. I’ve searched the wiki a bit and I found one property called useAlphaFromAlbedoTexture, but it doesn’t seem to have any effect, so I’m just using material.opacityTexture = new BABYLON.Texture(“media/alphatest.png”) etc. the same as I would for a standard material. Unfortunately the see-through portions of the texture just turn from black to white and there’s no transparency at all. I’ve tried switching the alpha mode as well, and it doesn’t seem to be doing anything either. Here are some screenshots:
And you can see what I’m going for in the bottom picture. It’s a pretty cool technique that’s been around for a while where you’ve got alpha mapped polygons hovering over some non-alpha mapped polygons with a similar texture so you can have furry looking carpets and more realistic looking shrubbery and what not. I definitely recommend messing around with it!
Anyway, I’m exporting it as a GLB with all of the textures packed in with it, however my current node setup isn’t recognized, which is kind of expected since it’s a very…Blender way of handling transparency for lack of a better term
So my questions are 1. how can I get a PBR material to read its alpha from an opacity texture correctly through code and 2. is there a way for the GLTF exporter to export alpha maps correctly out of the box? I thought I remembered reading somewhere that it has something to do with the transmission property, but I’m not 100% sure.
Here’s a playground I found on the wiki for standard material opacity textures, but I’ve edited it to be a PBR material. 2 of the models turn black and 2 of the models turn completely invisible when switched to a PBR material without any real modifications besides switching “diffuse” to “albedo”
https://www.babylonjs-playground.com/#1MSIXB#11
Any help would be appreciated, and thank you for reading my essay of a question!