Babylon.js: Add OBJLoader Tests

Created on 11 Apr 2019  路  6Comments  路  Source: BabylonJS/Babylon.js

We could use some rudimentary tests for the OBJ loader to test correctness.

Most likely this can be as simple as creating a visual test that loads a number of OBJ assets of varying complexity into a single scene.

in progress loaders obj

Most helpful comment

Visual tests like those for glTF would be a great addition. I have suggested that for the new feature request for "smoothing groups" (it's not a GH issue, but in forum). I have permission to use that asset that was shared - it has multiple smoothing groups, so was already going to add that as a visual integration test:
https://forum.babylonjs.com/t/box-with-3-mirrors-tracing-each-other/2277/3

My perspective is that it would be good to get OBJ files with different materials - many options are not implemented as you are discovering. Most issues in forum are related to wrong parameters/order and not rendering/materials.

Also, I added some actual rudimentary tests on scene loader recently as well for ObjFileLoader. ie:
https://github.com/BabylonJS/Babylon.js/commit/a8c0be2086634f52a670afc92a855a4327f61671

All 6 comments

@bghgary , @deltakosh , @PatrickRyanMS , @brianzinn
I'm interested in getting your perspectives, are there any usecases or frequent issues we may want to make sure we're covering?

Visual tests like those for glTF would be a great addition. I have suggested that for the new feature request for "smoothing groups" (it's not a GH issue, but in forum). I have permission to use that asset that was shared - it has multiple smoothing groups, so was already going to add that as a visual integration test:
https://forum.babylonjs.com/t/box-with-3-mirrors-tracing-each-other/2277/3

My perspective is that it would be good to get OBJ files with different materials - many options are not implemented as you are discovering. Most issues in forum are related to wrong parameters/order and not rendering/materials.

Also, I added some actual rudimentary tests on scene loader recently as well for ObjFileLoader. ie:
https://github.com/BabylonJS/Babylon.js/commit/a8c0be2086634f52a670afc92a855a4327f61671

I'm willing to add visual unit tests, but where to get some free for use .obj files?

Is there a tool that could be used to convert an existing asset we already use (gltf for eg) to .obj?

File linked by @brianzinn can't be used as it is using smoothing groups that are not supported by the current loader (or it can be used but we should remove the smoothing group definitions).

I guess we should only add the one we already have in either playgrounds/scenes or on the web site. This already be a nice safe guard against regression ?

Ok. I could find:

  • Playground/scenes/StanfordBunny.obj
  • Playground/scenes/Box/Box.obj
  • Assets/meshes/Chair/Chair.obj

I think a single unit test with the 3 meshes is ok, no need for 3 tests?

yup perfect !!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

projectSHAI picture projectSHAI  路  38Comments

azchatlanin picture azchatlanin  路  17Comments

individ2016 picture individ2016  路  39Comments

PatrickRyanMS picture PatrickRyanMS  路  18Comments

yvele picture yvele  路  18Comments