f3d
f3d copied to clipboard
OBJ Incorrect coloring with vertex colors
Describe the bug A obj dataset with vertex colors is incorrectly textured
To Reproduce Steps to reproduce the behavior: 0. female02.zip
- Open the file using
f3d --dry-run female02_vertex_colors.obj
Expected behavior
System Information:
- OS: Linux and Windows
F3D Information
Paste the content of f3d --version
:1.3.1 and master
This one may not be about the vertex colors.
-
female02_vertex_colors.obj
has both textures and seemingly random vertex colors. F3D renders only the vertex colors -
female02.obj
has only textures. F3D does not render the textures.
If we change some vertex colors to known values, for example make all vertices with positive coords red (sed -r 's/(v [.0-9]+ [.0-9]+ [.0-9]+) [.0-9]+ [.0-9]+ [.0-9]+/\1 1 0 0/g' female02/female02_vertex_colors.obj > female02/female02_vertex_colors_red.obj
f3d will render this:
which makes sense, except for the lack of textures, which would be the actual bug
meshlab render for comparison:
Ha ! then VTK does not suport both texture and color, but it should, is that correct ?
Honestly no idea.
According to http://paulbourke.net/dataformats/mtl/: "During rendering, the map_Kd value is multiplied by the Kd value." Assuming the per-vertex colors in the .obj
are to be considered equivalent to the per-face Kd
values in the .mtl
then they should indeed be blended but I don't know what the correct output would be. It could also be another unspecified corner-case.
There is a similar ParaView issue for this here: https://gitlab.kitware.com/paraview/paraview/-/issues/21257
With an actual VTK code in it to make it work.
Do you think this one matters @Meakk ?
@Meakk
Blending between texture and vertex color makes sense, so there's a bug here in my opinion. However, it's definitely not critical.