OBJ import fails without texture coordinate indices

After some investigation why the .obj files I created in Rhino wont load in vvvv, I noticed that it appears that Mesh(DX11.GeometryAssimp) cant seem to handle OBJ files without texture coordinate indices, even though they are optional.

According to this Wikipedia article on the OBJ Format:

As texture coordinates are optional, one can define geometry without them, but one must put two slashes after the vertex index before putting the normal index.

The format for the indexes then becomes:

"f v1//vn1 v2//vn2 v3//vn3 ... "

Whereas if vt is specified it would be:

"f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3 ..."

Both .obj files open correctly in any other software.

Attached is a small patch that shows whats happening and the difference in the code.

obj_indices.zip (5.7 KB)

i guess it’s the shader that can’t handle such a geometry because it doesn’t match the vsInput struct. You can check with the ‘Layout valid’ pin coming out of the shader node

Hm, your right, should have checked it. Shader says: Geometry is missing semantics: TEXCOORD

But the thing is that it shouldnt matter if the texture coordinates are missing, since they can be deducted from the data thats there.

Granted, this might not be the most important issue, but if every 3D software under the sun can handle it, so should vvvv.

UVcoords.gfx in the noodles pack will add UV to objects without them

@seltzdesign

https://docs.mcneel.com/rhino/5/help/en-us/fileio/wavefront_obj_import_export.htm

It seems that a lot of options are available when exporting .obj files form rhino. Did you try different settings?

Nodes like Gouraud and such have a “NoTexture” technique.

Thanks everyone for your suggestions. I have exported the geometry again from Rhino with texture mapping on. Also had to unweld with an angle of 0 and weld again, to get the polygonal look.

Didnt see the NoTexture method on Gourad, as I only chose that for the example patch here. Actually using Superphysical, which doesnt have the NoTexture method as far as I am aware. But then Superphysical looks better with some textures anyways.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.