Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Binary PLY - Wrong texture display #5553

Open
afavray-modjaw opened this issue Apr 25, 2024 · 7 comments
Open

Bug: Binary PLY - Wrong texture display #5553

afavray-modjaw opened this issue Apr 25, 2024 · 7 comments
Labels
Bug Global flag to mark a deviation from expected behaviour PLY Bugs related to the PLY format

Comments

@afavray-modjaw
Copy link

Describe the bug
When loading some specific binary PLY, the textures displayed are wrong. It seems to use the texture file (which is weird btw) colors but not the correct position.

But it's fine in other 3D viewer soft, like in Exocad or Meshlab.

We notice this bug on several meshes, all coming from the same Intra Oral Scanner company (but not on all meshes).

To Reproduce
Steps to reproduce the behavior:

Open this mesh WrongTexture.zip into Assimp Viewer, see the wrong texture appear.

Or, try loading it directly with Assimp and notice the wrong texture display.

Expected behavior
Correct texture display, like in Exocad or in Meshlab.

Screenshots
In Assimp Viewer (wrong texture)
assimp_display

In Exocad (perfect texture)
exocad_display

In Meshlab(good texture, but with strange red points)
meshlab_display

Platform (please complete the following information):

  • OS: Windows
  • Version:
    • last version available on master: Assimp 5.4.2077888392 amd64 msvc shared singlethreadedsingle
    • Assimp 5.2.0

Additional context
NA

@afavray-modjaw afavray-modjaw added the Bug Global flag to mark a deviation from expected behaviour label Apr 25, 2024
@afavray-modjaw
Copy link
Author

Log in Assimp Viewer:


Info, T32956: Load WrongTexture\UpperJaw.ply
Debug, T32956: Assimp 5.4.2077888392 amd64 msvc shared singlethreadedsingle :
Debug, T32956: START total
Info, T32956: Found a matching importer for this file format: Stanford Polygon Library (PLY) Importer.
Debug, T32956: START import
Info, T32956: Import root directory is 'WrongTexture'
Debug, T32956: PLY::DOM::ParseInstanceBinary() begin
Debug, T32956: PLY::DOM::ParseHeader() begin
Info, T32956: Found unknown property semantic in file. This is ok
Info, T32956: Found unknown semantic in PLY file. This is OK
Debug, T32956: PLY::DOM::ParseHeader() succeeded
Debug, T32956: PLY::DOM::ParseElementInstanceListsBinary() begin
Debug, T32956: PLY::DOM::ParseElementInstanceListsBinary() succeeded
Debug, T32956: PLY::DOM::ParseInstanceBinary() succeeded
Debug, T32956: UpdateImporterScale scale set: 1
Debug, T32956: END import, dt= 0.204092 s
Debug, T32956: ValidateDataStructureProcess begin
Debug, T32956: ValidateDataStructureProcess end
Debug, T32956: START preprocess
Debug, T32956: END preprocess, dt= 0.0007357 s
Info, T32956: Entering post processing pipeline
Debug, T32956: START postprocess
Debug, T32956: MakeLeftHandedProcess begin
Debug, T32956: MakeLeftHandedProcess finished
Debug, T32956: END postprocess, dt= 0.0003505 s
Debug, T32956: START postprocess
Debug, T32956: FlipUVsProcess begin
Debug, T32956: FlipUVsProcess finished
Debug, T32956: END postprocess, dt= 0.0002385 s
Debug, T32956: START postprocess
Debug, T32956: FlipWindingOrderProcess begin
Debug, T32956: FlipWindingOrderProcess finished
Debug, T32956: END postprocess, dt= 0.0018503 s
Debug, T32956: START postprocess
Debug, T32956: RemoveRedundantMatsProcess begin
Debug, T32956: RemoveRedundantMatsProcess finished
Debug, T32956: END postprocess, dt= 1.24e-05 s
Debug, T32956: START postprocess
Debug, T32956: FindInstancesProcess begin
Debug, T32956: FindInstancesProcess finished. No instanced meshes found
Debug, T32956: END postprocess, dt= 0.0012663 s
Debug, T32956: START postprocess
Debug, T32956: GenUVCoordsProcess begin
Debug, T32956: GenUVCoordsProcess finished
Debug, T32956: END postprocess, dt= 8.5e-06 s
Debug, T32956: START postprocess
Debug, T32956: TransformUVCoordsProcess begin
Debug, T32956: TransformUVCoordsProcess finished
Debug, T32956: END postprocess, dt= 1.01e-05 s
Debug, T32956: START postprocess
Debug, T32956: TriangulateProcess begin
Debug, T32956: TriangulateProcess finished. There was nothing to be done.
Debug, T32956: END postprocess, dt= 7.2e-06 s
Debug, T32956: START postprocess
Debug, T32956: FindDegeneratesProcess begin
Debug, T32956: FindDegeneratesProcess finished
Debug, T32956: END postprocess, dt= 0.0691182 s
Debug, T32956: START postprocess
Debug, T32956: SortByPTypeProcess begin
Info, T32956: Points: 0, Lines: 0, Triangles: 1, Polygons: 0 (Meshes, X = removed)
Debug, T32956: SortByPTypeProcess finished
Debug, T32956: END postprocess, dt= 1.53e-05 s
Debug, T32956: START postprocess
Debug, T32956: FindInvalidDataProcess begin
Info, T32956: FindInvalidDataProcess finished. Found issues ...
Debug, T32956: END postprocess, dt= 0.0031285 s
Debug, T32956: START postprocess
Debug, T32956: Skipping OptimizeMeshesProcess
Debug, T32956: END postprocess, dt= 5.9e-06 s
Debug, T32956: START postprocess
Debug, T32956: SplitByBoneCountProcess begin
Debug, T32956: SplitByBoneCountProcess early-out: no meshes with more than 60 bones.
Debug, T32956: END postprocess, dt= 1.11e-05 s
Debug, T32956: START postprocess
Debug, T32956: SplitLargeMeshesProcess_Triangle begin
Debug, T32956: SplitLargeMeshesProcess_Triangle finished. There was nothing to do
Info, T32956: SplitLargeMeshesProcess_Triangle finished. Meshes have been split
Debug, T32956: END postprocess, dt= 1.38e-05 s
Debug, T32956: START postprocess
Debug, T32956: Generate spatially-sorted vertex cache
Debug, T32956: END postprocess, dt= 0.0152172 s
Debug, T32956: START postprocess
Debug, T32956: GenVertexNormalsProcess begin
Info, T32956: GenVertexNormalsProcess finished. Vertex normals have been calculated
Debug, T32956: END postprocess, dt= 0.0614248 s
Debug, T32956: START postprocess
Debug, T32956: CalcTangentsProcess begin
Info, T32956: CalcTangentsProcess finished. Tangents have been calculated
Debug, T32956: END postprocess, dt= 0.0837968 s
Debug, T32956: START postprocess
Debug, T32956: JoinVerticesProcess begin
Debug, T32956: Mesh 0 (unnamed) | Verts in: 251654 out: 251654 | ~0%
Debug, T32956: JoinVerticesProcess finished
Debug, T32956: END postprocess, dt= 0.0947704 s
Debug, T32956: START postprocess
Debug, T32956: END postprocess, dt= 0.0002313 s
Debug, T32956: START postprocess
Debug, T32956: SplitLargeMeshesProcess_Vertex begin
Debug, T32956: SplitLargeMeshesProcess_Vertex finished. There was nothing to do
Debug, T32956: END postprocess, dt= 9.7e-06 s
Debug, T32956: START postprocess
Debug, T32956: LimitBoneWeightsProcess begin
Debug, T32956: LimitBoneWeightsProcess end
Debug, T32956: END postprocess, dt= 7.8e-06 s
Debug, T32956: START postprocess
Debug, T32956: ImproveCacheLocalityProcess begin
Debug, T32956: Mesh 0| ACMR in: 1.01496 out: 0 | average ACMR 100
Debug, T32956: ImproveCacheLocalityProcess finished.
Debug, T32956: END postprocess, dt= 0.0547546 s
Info, T32956: Leaving post processing pipeline
Debug, T32956: END total, dt= 0.596291 s

@tellypresence
Copy link
Contributor

tellypresence commented Apr 26, 2024

One of the textures in the attached WrongTexture is only 1x1 pixel, and the other appears to be have horizontal bands where pixels are magnified by different factors, is that expected?

UpperJaw-0Note: 1x1 texture (single pixel)
UpperJaw-1Texture appears to have horizontal bands with different magnfications, so individual pixels are e.g. 4x large in top band, 2x large in middle band etc

@tellypresence
Copy link
Contributor

tellypresence commented Apr 26, 2024

Can you attach a sample model (with textures) which renders correctly in assimp for comparison?

@afavray-modjaw
Copy link
Author

Thanks for your reply.

This yellow texture is used to define pixel with missing texture, see bellow preview in Meshlab:
image

In Assimp viewer:
image

I also find this 1x1 texture strange but I have a mesh without this texture which is not working too:
OneWrongTexture.zip

So I don't think this is related.

@kimkulling kimkulling added the PLY Bugs related to the PLY format label May 7, 2024
@kimkulling
Copy link
Member

I tried this out with a different assimp-based viewer and there, the textures are looking right. Maybe the assimp-viewer is just broken?

@afavray-modjaw
Copy link
Author

I don't think the assimp-viewer is broken, since we have the same issue in our application using Assimp.
Which assimp-based viewer are you using? Maybe it's just an import option or preprocessing.

@kimkulling
Copy link
Member

There is only one default material in use. I am currently investigating why this is the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Global flag to mark a deviation from expected behaviour PLY Bugs related to the PLY format
Projects
Status: No status
Development

No branches or pull requests

3 participants