Meshes with PBR from Blender with artifacts

Hi all!
I’m trying to build my scene in Blender 2.8 and then export to Babylon with minimal changes.

But I see different artifacts with textures and in meshes order (one mesh visible thought another).

Adding OCCLUSION_TYPE_STRICT to all meshes makes scene looking little better.
I attached scene with archive — Яндекс.Диск

I think you should share your .blend, it seems that all these artefacts comes from your export settings. I can already seen that you have an automatic texture baking during export, which probably make you loosing control about your materials tweaks.

Hi Vinc3r and tnx for reply

Here is the blend file (3.2 MB)

I just take a quick look on your materials, and you have a precomputed 3D workflow: your materials are procedurals & complexes, this is why the exporter use baking, trying to keep your objects as they are.

But IMO you’ll better have to use static textures (why not generated using your current nodes), and just link them into the Principled node, that’s all.

If I export Export with PBR Materials (Backed and Principled node) - I still got artifacts like in my first post
If I export without PBR Material option - i got ugly shades, but no artifacts ( (ugly shades i can delete with removing all lights )) )

Maybe it’s a normal idea - Bake all and then export without PBR materials.

Sorry I have to bring this up again, because I face the same issues.
I have no problem when exporting without PBR and have breaking faces with PBR Export enabled.
This also occurs in the Sandbox.

In the Sandbox is a switch for “Need Depth Prepass” and if I enable it, the preview Checker looks fine.
So I tried forcing this using:

scene.onNewMaterialAddedObservable.add(function(mat) {
mat.material.needDepthPrePass = true;

This leads to BabylonJs stopping the import of the mesh:
BJS - [18:10:45]: Unable to import meshes from moon9pbr.babylon: importMesh of moon9pbr.babylon from Blender version: 2.80 (sub 60), exporter version: 6.0-beta 11

Any ideas?

could you share a link to Sandbox ? (Playground ?)

Hardly the most recent Blender or the Blender Exporter. The version of Blender I downloaded 2 weeks ago was “sub74” and may have changed since then, and the exporter is currently6.1.1” and I believe @JCPalmer has been making lots of changes to PBR materials over that time

You might want to try the latest editions of everything … and then report results

cheers, gryff :slight_smile:

Ah yes, I will try that first thing on Monday.
Sadly I have to go through Admins for that’s why I stayed with a Blender Version that worked fine in all other regards… But yeah of course. Sorry. I will report back!

The update fixed this problem.Thanks guys!

Exporting with the normal-map connected will fail me.
This is the Error the Browser throws:
Error: WebGL warning: drawElements: Vertex fetch requires vertex #188401, but attribs only supply 141301.
When not connecting the normalmap everything works out fine.
188401 is the actual number of vertecies I have.

Any ideas anyone?

Thanks so much!

Whatever this normal map problem is, it not should not be PBR / Std issue. Does the statistics section of the export logfile echo these same numbers?

This is what the log prints:

Exporter version: 6.1.1, Blender version: 2.80 (sub 74)
========= Conversion from Blender to Babylon.js =========
Scene settings used :
inline textures : false
Material Type : PBR
Positions Precision : 4
Normals Precision : 4
UVs Precision : 4
Vert Color Precision: 3
Mat Weight Precision: 2
texture directory : H:****\v9noAnimations
Python World class constructor completed
WARNING: No active camera has been assigned, or is not in a currently selected Blender layer
processing begun of mesh: lander
processing begun of material: mat_Lander
processing texture col
texture type: diffuseTexture, mapped using: “UVChannel_1”
processing texture met
texture type: metallicTexture, mapped using: “UVChannel_1”
processing texture rough
texture type: value not meaningful 2, mapped using: “UVChannel_1”
Custom split normals with tangents being used
num positions : 188402
num normals : 188402
num tangents : 188402
num uvs : 376804
num uvs2 : 376804
num colors : 753608
num indices : 438678
WARNING: # of 0 area faces found: 1108
========= Writing of JSON file started =========
========= Writing of JSON file completed =========
========= end of processing =========
elapsed time: 1 min, 46.134 secs

Ah, do you really want custom split normals? Also, where is the normal map being used? Provide a screen shot of your nodes in the Shader Editor

To be honest I just had no idea what CustomSplit Normals were. I assumed is was like the missing Camera warning. After getting rid of them everything works fine.

Thank you so much for your help! This forum is so amazing!

Guys, I want to return to PBR Materials. Tried to bake textures and use via Principled node. If export without PBR Materials - I have no artifacts and scene look not bad, except that I am only learning)) ( — Яндекс.Диск)

Scene with PBR Materials (I attached — Яндекс.Диск) and meshes with prebaked textures showing with artifacts.
But the lighting and shadows look much better.

Please help me to understand, what I do wrong with the scene