This request keeps coming back. It's not standard, but I'm thinking that with the current design of OBJLoader implementing vertex colors support shouldn't affect performance much.
https://stackoverflow.com/questions/44241008/load-obj-file-with-original-colors-without-mtl#
@jonnenauha what do you think?
Are you asking if I have time to implement this or just if its a good idea? :)
Yes fairly easy to add, few optional captures to the regexp is probably not that impactful for perf. I can look into implement ing it too. Do you have links to any test assets?
Was just asking if it was a good idea... 馃槆 I'll look for test assets.
@mrdoob, @jonnenauha Just saw your tweet and downloaded the OBJ referenced in the stackoverflow post:
https://biizii.com/models/emmy3d_1.obj
OBJLoader2 could support this as well. I have some additional enhancements in the pipeline anyway...
x y z r g b?
why not x y z hex(argb)?
@matrix3d this is about supporting obj extensions not strictly in the spec that are out in the world and people use. We don't want to start inventing our own and encourage more fragmentation. This could lead three.js users to use hex/rgb in their assets and soon other renderers/readers/loaders would get bug issues like this one why dont they support "the three.js way" :)
OBJ has no specific vertex colour definition. The convention x y z r g b has been adopted but is not widely supported, so many exporters / importers ignore OBJ vertex colours. I think if you need vertex colours best is to use PLY instead.
It's working. Work achieved by https://github.com/Sean-Bradley/objVertexColors shown here https://biizii.com/objVertexColors.html is now possible with OBJLoader2 and WWOBJLoader2:
https://kaisalmen.de/proto/test/objloader2/main.src.html
https://kaisalmen.de/proto/test/wwobjloader2/main.src.html
See:
https://github.com/kaisalmen/WWOBJLoader/commit/61696b982b4f21ca3cc04afc61653dbf3be311d5
This is a preview with debug logging. DoubleSide is enforced. The model belongs to Sean Bradley.
PR wile come next week as I need to verify/polish/document other corrections and enhancements.
I need to check I did not introduce regressions in the examples, then PR will follow hopefully tonight.
The other updates to OBJLoader2 and WWOBJLoader2 will come at a later point in time and require feedback beyond this scope (I extracted a generic web worker mesh provider).
Is there an official example (https://threejs.org/examples/) of how to use this?
@JetStarBlues No, but I just tried dragging this obj into https://threejs.org/editor/ (which uses OBJLoader and vertex colors are imported correctly.

Hmm, I see. Thanks!