but looks all shiny and bumpy in babylonjs. I suspect it has something to do with vertex shading. Is there a way to render the model so it looks more like the windows 3d rendering? I tried turning off mesh.useVertexColors = false, but that made no difference. This is what babylon renders.
Oddly, if I import this obj into blender and save a glb, then babylon renders the glb just fine, so what is different ? What other knobs can I try to fix this?
Looking at the picture I would assume that probably normals are inverted.
Do you have the same result when you load your .obj file into Sandbox and save it as GLB?
You don’t need to provide the code (which may contain some errors as well) for the Sandbox, only the model. If you’ll open the Inspector, you’ll be able to check, tweak and export your model as GLB or Babylon format.
Anyway, it is difficult to give the right answer to your question without seeing the model. Considering that GLB from Blender is fine, I would assume that your .obj file has some parameters which are rendered differently in different renderers.
OBJ format doesn’t have strict standard. According to the spec, options are supposed to precede the texture filename. However, at least one vendor generates files with options at the end - this is just one of numerous examples of OBJ format problems.
Just switch out these lines to see the difference between the 2 models, which should otherwise be identical. The glb was created by direct import of obj into Blender followed by export of glb, no other changes made (except centering the model on the origin - which I’ve done in the .obj by applying a transform).
// var fileName = "shed.glb" // good rendering
var fileName = "scene_texture.obj" // bad rendering
if you run these side by side you will see something like this screenshot: sidebyside where the good one is on the left and the overly bumpy plastic looking one is on the right…