However, after many attempts I still can not get my model to have a face with transparent areas according to its texture.
On Blender I tried to enable PBR Transparency mode: Alpha test & Blend as well as Blend. No effect. BTW… existing Blender tips is VERY different than 2.8 and former exported made for 2.79 crashes crashes on 2.79. So I am only using 2.8 with latest exporter.
O BJS I tried to enable Alpha by getting material reference with no luck:
var mat = arch.material;
mat.hasAlpha = true;
Also tried other possible settings like:
mat.backFaceCulling = false;
mat.diffuseTexture.hasAlpha = true; // get error here as there is no diffuseTexture in this mat.
mat.needAlphaBlendingForMesh(true);
mat.alphamode = BABYLON.Engine.ALPHA_COMBINE;
Then I decided to follow a working solution for a cube:
So I created a material and tried to apply to my mesh. It seems that BJS did not take in consideration the existing UV Mapping and applied wrong mapping:
var mat = new BABYLON.StandardMaterial("newMat", scene);
mat.diffuseTexture = new BABYLON.Texture("blender/arch.png", scene);
mat.diffuseTexture.hasAlpha = true;
mat.backFaceCulling = false;
arch.material = mat;
We’ll need your .blend with your object (or if you can’t share it, a simple Cube using the same setup will be OK too). Bonus if you try to integrate it inside a playground
I am having so many problems that I am switching engines as I have a dead line.
To mention a few:
Following camera get inverted rotation related to the model. Parenting a free camera did not work. So I hacked a freecamera by “manually” translating/orbting around my model
Dynamic texture gets wrong UV Map once re-applied to a model.
As your folder is kind of… messy I have no idea about which objects & materials are problematic, please be more specific. As I said, a simple cube showing your issue is enough to help.
Very appreciated your reply. I really missed this doc, thanks a lot for pointing out. Once I deploy my game I will resume reimplementing it in BJS as I really want to learn it. You guys are definitely doing an amazing job.