Model exported from blender with backface culling off looks bad in babylon as if option was on

Good day, I have a mesh in blender that looks good with backface culling off, because then the normals are pointing in both directions and all looks great,
renders and previews all looking great in blender.

I export it sucessfully to babylon format, but then in babylon it appears invisible from below. Which is exactly what happens in blender when backface culling option is on. And yet i had it off in blender. What can I do in babylon to have two sided faces so that it doesnt appear invisible from below the model?
this is very important for my project, please let me know if there are workarounds so that I can disable this backface culling in the mesh in babylon

thank you very much

I have tried to do something like this:

var mat = new StandardMaterial(“dog”, scene);
mat.diffuseTexture = new Texture(
https://upload.wikimedia.org/wikipedia/commons/8/87/Alaskan_Malamute%2BBlank.png”,
scene
);
mat.backFaceCulling = false;
mymodel.material = mat;

but it still looks invisible from below,
there is a texture exported from blender after baking a shader, I wonder if somehow I need to locate and apply the same to that texture, thank you for any help

I was selecting the wrong mesh, now selecting the right one and applying a new material and doing
mat.backFaceCulling = false;
it works now,

but now i need to apply it not to a new material, but to the material that already arrives from the blender exporter, how can I select the material already assigned after loading the model so that I can apply to it the
mat.backFaceCulling = false;?

thank you :slight_smile:

found it
scene.meshes[0].material.backFaceCulling = false;

There is a custom exporter property for backface culling in the Material section, so that it gets exported that way without any code.

Yes, I know Blender has one for culling just above, but I ignore. Having the Default be False is just too un-acceptable. There are also a number of exporter properties related to PBR opacity. Again Blender has those, but they do not fit into our system very well.

2 Likes

thank you very much for your explanation :slight_smile: