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

glTF extension CESIUM_RTC is not supported which causes texture to not be loaded #1705

Open
Saijin-Naib opened this issue Nov 13, 2024 · 17 comments

Comments

@Saijin-Naib
Copy link

Saijin-Naib commented Nov 13, 2024

Describe the bug
When loaded in f3d v2.5.0, a file using CESIUM_RTC extension is not loaded correctly

To Reproduce
Steps to reproduce the behavior:

  1. Open the file:
    odm_textured_model_geo.zip
  2. Observe it does not render fully
  3. Output in console:

image

  1. Expected output (from https://gltf-viewer.donmccurdy.com/)

image

Warning: In vtkGLTFDocumentLoaderInternals.cxx, line 1362
vtkF3DGLTFDocumentLoader (0x5638f3bc06a0): glTF extension CESIUM_RTC is used in this model, but not supported by this loader. The extension will be ignored.

Original issue below:

Describe the bug
When loaded in f3d v2.5.0 with DRACO support, a DRACO-encoded GLB does not render.

To Reproduce
Steps to reproduce the behavior:

  1. Open the file:
    odm_textured_model_geo.zip
  2. Observe it does not render
  3. Test the same file here: https://gltf-viewer.donmccurdy.com/
  4. Verify report:
Validation report

    Format: glTF 2.0
    Generator: draco_decoder
    Stats:
        9 draw calls
        0 animations
        9 materials
        142397 vertices
        223185 triangles
    Extensions:
        CESIUM_RTC
        KHR_draco_mesh_compression
        KHR_materials_unlit

    NOTE: Extensions above are present in the model, but may or may not be recognized by this viewer. Any "UNSUPPORTED_EXTENSION" warnings below refer only to extensions that could not be scanned by the validation suite, and may still have rendered correctly. See: [three-gltf-viewer#122](https://github.com/donmccurdy/three-gltf-viewer/issues/122).

Report generated by[KhronosGroup/glTF-Validator](https://github.com/KhronosGroup/glTF-Validator/) 2.0.0-dev.3.9.
Info	Message	Pointer
UNSUPPORTED_EXTENSION	Cannot validate an extension as it is not supported by the validator: 'CESIUM_RTC'.	/extensionsUsed/0
UNSUPPORTED_EXTENSION	Cannot validate an extension as it is not supported by the validator: 'KHR_draco_mesh_compression'.	/extensionsUsed/1
UNUSED_OBJECT	This object may be unused.	/bufferViews/0
UNUSED_OBJECT	This object may be unused.	/bufferViews/1
UNUSED_OBJECT	This object may be unused.	/bufferViews/2
UNUSED_OBJECT	This object may be unused.	/bufferViews/3
UNUSED_OBJECT	This object may be unused.	/bufferViews/4
UNUSED_OBJECT	This object may be unused.	/bufferViews/5
UNUSED_OBJECT	This object may be unused.	/bufferViews/6
UNUSED_OBJECT	This object may be unused.	/bufferViews/7
UNUSED_OBJECT	This object may be unused.	/bufferViews/8

Expected behavior
The DRACO-encoded GLB renders properly.

System Information:

  • OS: Alpine Linux Edge x86_64
  • GPU and GPU driver: Intel N3450, Intel i915/MESA

F3D Information
Paste the content of f3d --version:

f3d --version
F3D 2.5.0

F3D - A fast and minimalist 3D viewer
Version: 2.5.0.
Build date: 2024-11-13 06:52:25.
Build system: Linux 64-bits.
Compiler: GNU 14.2.0.
External rendering module: OFF.
Raytracing module: OFF.
VTK version: 9.3.1.
Copyright (C) 2019-2021 Kitware SAS.
Copyright (C) 2021-2024 Michael Migliore, Mathieu Westphal.
License BSD-3-Clause.
By Michael Migliore, Mathieu Westphal and Joachim Pouderoux.

Additional context
The same file renders in Blender, MeshLab, CloudCompare, and WebODM's PoTree viewer.

@mwestphal
Copy link
Contributor

I confirm that this file does not render as expected in F3D:

a

While it works fine in https://gltf-viewer.donmccurdy.com/

a

@mwestphal mwestphal changed the title Possible Bug: DRACO-encoded GLB Does Not Render DRACO-encoded GLB Does Not Render textures Nov 13, 2024
@Saijin-Naib
Copy link
Author

Saijin-Naib commented Nov 13, 2024

I confirm that this file does not render as expected in F3D:

I don't even get an empty-texture model!
image
I also do not note any errors printed to the console aside from:

Configuration file for "config" could not be found

@mwestphal
Copy link
Contributor

I also do not note any errors printed to the console aside from:

Use --verbose

@jo-chemla
Copy link
Contributor

jo-chemla commented Nov 13, 2024

I can confirm this is the same from my side, for gltf meshes with draco + KTX2 compression (KHR_texture_basisu extension with etc1s compression), which are not rendering in f3d while they render in donmccurdy gltf-viewer or viewer.needle.tools

There are no obvious errors in the verbose output of f3d with the OP provided draco-compressed file, but there is error glTF extension KHR_texture_basisu is required in this model, but not supported by this loader. Aborting for my draco+ktx2 compressed meshes.

Should I open a dedicated issue for KTX2 texture compression support (the same way it was done for KHR_texture_transform here #1696) or should this simply be added to #608?

Found a reader for "mesh-5.0.1-mini.1.etc1s+draco.glb" : "GLTFDraco"
Loading 3D scene: mesh-mini.1.etc1s+draco.glb

ERROR: In vtkGLTFDocumentLoaderInternals.cxx, line 1339
vtkF3DGLTFDocumentLoader (00000105DDD1FC50): glTF extension KHR_texture_basisu is required in this model, but not supported by this loader. Aborting


ERROR: In vtkGLTFImporter.cxx, line 395
vtkF3DGLTFImporter (00000105D1B386D0): Error loading model metadata


ERROR: In vtkGLTFImporter.cxx, line 837
vtkF3DGLTFImporter (00000105D1B386D0): The GLTF model is nullptr, aborting.

@mwestphal
Copy link
Contributor

Should I open a dedicated issue for KTX2 texture compression support (the same way it was done for KHR_texture_transform here #1696)

Lets create a dedicated issue, Ill then add it to #608.

@jo-chemla
Copy link
Contributor

Thanks, just did it here: #1707

@mwestphal
Copy link
Contributor

@Saijin-Naib have you been able to run with --verbose ?

@Saijin-Naib
Copy link
Author

Yes, just now sorry:

f3d ~/Public/WebODM_MEDIADIR/project/1/task/0a5fd217-591d-40f8-b6c9-d9f64cd3e9f3/as
sets/odm_texturing/odm_textured_model_geo.glb --verbose
========== Initializing ==========
Loading plugin "alembic"
  Version: 1.0
  Description: Alembic support (version 1.8.7)
  Readers:
    Alembic
Loading plugin "assimp"
  Version: 1.0
  Description: Assimp support (version 5.4.3)
  Readers:
    Filmbox
    Collada
    AutoCAD DXF
    Object File Format
    DirectX File Format
    3D Manufacturing Format
Loading plugin "draco"
  Version: 1.0
  Description: Draco support (version 1.5.7)
  Readers:
    Draco
Loading plugin "exodus"
  Version: 1.0
  Description: VTK Exodus support
  Readers:
    Exodus II
Loading plugin "native"
  Version: 1.0
  Description: Native VTK I/O support
  Readers:
    Autodesk 3D Studio
    CityGML
    DICOM
    GL Transmission Format
    MetaImage
    Nearly Raw Raster Data
    Wavefront OBJ
    Polygon
    Point Cloud
    Standard Triangle Language
    TIFF
    VRML
    VTK Legacy
    VTK XML UnstructuredGrid
    VTK XML PolyData
    VTK XML ImageData
    VTK XML RectangularGrid
    VTK XML StructuredGrid
    VTK XML MultiBlock
    3D Gaussian splats
Loading plugin "occt"
  Version: 1.0
  Description: OpenCASCADE support (version 7.8.1)
  Readers:
    STEP ISO 10303
    Initial Graphics Exchange Specification
    Open CASCADE BRep
Configuration file for "config" could not be found
========== Configuring engine ==========
Engine configured
========== Loading 3D file ==========
Found a reader for "/home/USERNAME/Public/WebODM_MEDIADIR/project/1/task/0a5fd217-591d-40f8-b6c9-d9f64cd3e9f3/assets/odm_texturing/odm_textured_model_geo.glb" : "GLTF"
Loading 3D scene: /home/USERNAME/Public/WebODM_MEDIADIR/project/1/task/0a5fd217-591d-40f8-b6c9-d9f64cd3e9f3/assets/odm_texturing/odm_textured_model_geo.glb

ERROR: In vtkGLTFDocumentLoaderInternals.cxx, line 1305
vtkGLTFDocumentLoader (0x7fcecf853290): glTF extension KHR_draco_mesh_compression is required in this model, but not supported by this loader. Aborting


ERROR: In vtkGLTFImporter.cxx, line 387
vtkGLTFImporter (0x7fcecf859b10): Error loading model metadata


ERROR: In vtkGLTFImporter.cxx, line 796
vtkGLTFImporter (0x7fcecf859b10): The GLTF model is nullptr, aborting.


No animation available in this file
ERROR: In vtkGLTFImporter.cxx, line 581
vtkGLTFImporter (0x7fcecf859b10): The GLTF model is nullptr, aborting.


No camera available in this file



Scene bounding box: 1,-1,1,-1,1,-1

Camera position: 0,0,1
Camera focal point: 0,0,0
Camera view up: 0,1,0
Camera view angle: 30


========== Rendering ==========
Render done

@mwestphal
Copy link
Contributor

mwestphal commented Nov 13, 2024

F3D is not built with draco support afaict, what is the output of f3d --scan-plugins ?

@Saijin-Naib
Copy link
Author

Saijin-Naib commented Nov 13, 2024

F3D is not built with draco support afaict, what is the output of f3d --scan-plugins ?

This is my package for Alpine, which I built with DRACO:

f3d --scan-plugins
Found 6 plugins:
 - exodus
 - native
 - alembic
 - assimp
 - draco
 - occt

@mwestphal
Copy link
Contributor

Humm, what about this:

f3d --load-plugins=draco odm_textured_model_geo.glb ?

@jo-chemla
Copy link
Contributor

Just tried the above command, which says for me that the draco plugin is already loaded (I installed f3d 2.5.0 via winget install f3d).

What's weird is that the following sample assets with draco compression and png textures do load: Duck, Avocado, BoomBox, and Lantern. Could this be caused by the CESIUM_RTC glTF extension in the case of the OP mesh file?

Warning: In vtkGLTFDocumentLoaderInternals.cxx, line 1362
vtkF3DGLTFDocumentLoader (00000252230B5660): glTF extension CESIUM_RTC is used in this model, but not supported by this loader. The extension will be ignored.

@Saijin-Naib
Copy link
Author

Saijin-Naib commented Nov 13, 2024

Humm, what about this:

f3d --load-plugins=draco odm_textured_model_geo.glb ?

f3d --load-plugins=draco ~/Public/WebODM_MEDIADIR/project/1/task/0a5fd217-591d-40f8
-b6c9-d9f64cd3e9f3/assets/odm_texturing/odm_textured_model_geo.glb --verbose
========== Initializing ==========
Loading plugin "alembic"
  Version: 1.0
  Description: Alembic support (version 1.8.7)
  Readers:
    Alembic
Loading plugin "assimp"
  Version: 1.0
  Description: Assimp support (version 5.4.3)
  Readers:
    Filmbox
    Collada
    AutoCAD DXF
    Object File Format
    DirectX File Format
    3D Manufacturing Format
Loading plugin "draco"
  Version: 1.0
  Description: Draco support (version 1.5.7)
  Readers:
    Draco
Loading plugin "exodus"
  Version: 1.0
  Description: VTK Exodus support
  Readers:
    Exodus II
Loading plugin "native"
  Version: 1.0
  Description: Native VTK I/O support
  Readers:
    Autodesk 3D Studio
    CityGML
    DICOM
    GL Transmission Format
    MetaImage
    Nearly Raw Raster Data
    Wavefront OBJ
    Polygon
    Point Cloud
    Standard Triangle Language
    TIFF
    VRML
    VTK Legacy
    VTK XML UnstructuredGrid
    VTK XML PolyData
    VTK XML ImageData
    VTK XML RectangularGrid
    VTK XML StructuredGrid
    VTK XML MultiBlock
    3D Gaussian splats
Loading plugin "occt"
  Version: 1.0
  Description: OpenCASCADE support (version 7.8.1)
  Readers:
    STEP ISO 10303
    Initial Graphics Exchange Specification
    Open CASCADE BRep
Plugin "draco" already loaded
Configuration file for "config" could not be found
========== Configuring engine ==========
Engine configured
========== Loading 3D file ==========
Plugin "draco" already loaded
Found a reader for "/home/USERNAME/Public/WebODM_MEDIADIR/project/1/task/0a5fd217-591d-40f8-b6c9-d9f64cd3e9f3/assets/odm_texturing/odm_textured_model_geo.glb" : "GLTF"
Loading 3D scene: /home/USERNAME/Public/WebODM_MEDIADIR/project/1/task/0a5fd217-591d-40f8-b6c9-d9f64cd3e9f3/assets/odm_texturing/odm_textured_model_geo.glb

ERROR: In vtkGLTFDocumentLoaderInternals.cxx, line 1305
vtkGLTFDocumentLoader (0x7f20e4e9a290): glTF extension KHR_draco_mesh_compression is required in this model, but not supported by this loader. Aborting


ERROR: In vtkGLTFImporter.cxx, line 387
vtkGLTFImporter (0x7f20e4eb0b10): Error loading model metadata


ERROR: In vtkGLTFImporter.cxx, line 796
vtkGLTFImporter (0x7f20e4eb0b10): The GLTF model is nullptr, aborting.


No animation available in this file
ERROR: In vtkGLTFImporter.cxx, line 581
vtkGLTFImporter (0x7f20e4eb0b10): The GLTF model is nullptr, aborting.


No camera available in this file



Scene bounding box: 1,-1,1,-1,1,-1

Camera position: 0,0,1
Camera focal point: 0,0,0
Camera view up: 0,1,0
Camera view angle: 30


========== Rendering ==========
Render done

No change in behavior, unfortunately.

This line looks salient (to my very limited knowledge):

ERROR: In vtkGLTFDocumentLoaderInternals.cxx, line 1305
vtkGLTFDocumentLoader (0x7f20e4e9a290): glTF extension KHR_draco_mesh_compression is required in this model, but not supported by this loader. Aborting

Would that explain the mesh not loading? Is that an issue with how my distro has DRACO built/packaged, and why it does not view anything here but @mwestphal got at least an untextured mesh?

Alpine APKBUILD for DRACO:
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/testing/draco/APKBUILD

@mwestphal
Copy link
Contributor

Found the issue:

# Needs https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10884
if(VTK_VERSION VERSION_GREATER_EQUAL 9.3.20240214)
  f3d_plugin_declare_reader(
    NAME GLTFDraco
    SCORE 90
    EXTENSIONS gltf glb 
    MIMETYPES model/gltf-binary model/gltf+json
    VTK_READER vtkF3DGLTFReader
    VTK_IMPORTER vtkF3DGLTFImporter
    FORMAT_DESCRIPTION "GL Transmission Format"
    CUSTOM_CODE "${CMAKE_CURRENT_SOURCE_DIR}/gltf.inl"
  )
endif()

In order to get access to glTF + draco you need a more recent VTK (9.3.20240214) .
I wish there was a way to inform user of the issue though.

This issue should stay open anyway because the texture is not loading in the file you shared.

@Saijin-Naib
Copy link
Author

Ah, excellent find! It looks like vtk is in the RC phase for 9.4, so I will wait and re-build against that.

In the meanwhile, I am opening an MR against our DRACO to ensure it is built with mesh/pointcloud compression support enabled as well, to see if that improves things.

Does the CESIUM_RTC line look salient from jo-chemla?

@mwestphal
Copy link
Contributor

Does the CESIUM_RTC line look salient from jo-chemla?

Indeed! Ill update the issue accordingly

Thanks for all your debugs @jo-chemla @Saijin-Naib !

@mwestphal mwestphal changed the title DRACO-encoded GLB Does Not Render textures glTF extension CESIUM_RTC is not supported which causes texture to not be loaded Nov 14, 2024
@mwestphal mwestphal added this to F3D Nov 14, 2024
@mwestphal mwestphal moved this to Investigate in F3D Nov 14, 2024
@mwestphal
Copy link
Contributor

I've update the issue and added it in the list: #608

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Investigate
Development

No branches or pull requests

3 participants