Reputation: 1153
I've been trying to load a GLB file but it seems that its texture won't load even though I have the PNG file in the same assets folder.
Here's the code:
val GLTF_ASSET = "model.glb"
ModelRenderable.builder()
.setSource(
this, RenderableSource.builder().setSource(
this,
Uri.parse(GLTF_ASSET),
RenderableSource.SourceType.GLB
)
.setScale(0.5f)
.setRecenterMode(RenderableSource.RecenterMode.ROOT)
.build()
)
.setRegistryId(GLTF_ASSET)
.build()
.thenAccept {
loadModel(it)
}
.exceptionally {
val builder = AlertDialog.Builder(this)
builder.setMessage(it.message)
.setTitle("error!")
val dialog = builder.create()
dialog.show()
return@exceptionally null
}
I'm getting this message in the logs:
W/ImpView: 1 textures declared in source assets were not found:
2019-10-17 17:30:48.453 22579-22682/com.example.arcore_test W/ImpView: missing: '49264a5c-5cb7-44cf-bc52-04c4d26f0457.png'
2019-10-17 17:30:48.453 22579-22682/com.example.arcore_test W/ImpView: (use -I to add other search folders)
2019-10-17 17:30:55.806 22579-22579/com.example.arcore_test W/Filament: setMaterialInstanceAt() on primitive 0 of Renderable at 1: declared attributes [POSITION, TANGENTS, UV0] do no satisfy required attributes [POSITION, TANGENTS, COLOR, UV0]
2019-10-17 17:30:55.806 22579-22579/com.example.arcore_test W/Filament: [instance=1, primitive @ 0] missing required attributes (0xf), declared=0xb
2019-10-17 17:30:55.806 22579-22579/com.example.arcore_test W/Filament: setMaterialInstanceAt() on primitive 1 of Renderable at 1: declared attributes [POSITION, TANGENTS, UV0] do no satisfy required attributes [POSITION, TANGENTS, COLOR, UV0]
2019-10-17 17:30:55.806 22579-22579/com.example.arcore_test W/Filament: [instance=1, primitive @ 1] missing required attributes (0xf), declared=0xb
2019-10-17 17:30:55.807 22579-22579/com.example.arcore_test W/Filament: setMaterialInstanceAt() on primitive 2 of Renderable at 1: declared attributes [POSITION, TANGENTS, UV0] do no satisfy required attributes [POSITION, TANGENTS, COLOR, UV0]
2019-10-17 17:30:55.807 22579-22579/com.example.arcore_test W/Filament: [instance=1, primitive @ 2] missing required attributes (0xf), declared=0xb
2019-10-17 17:30:55.807 22579-22579/com.example.arcore_test W/Filament: setMaterialInstanceAt() on primitive 3 of Renderable at 1: declared attributes [POSITION, TANGENTS, UV0] do no satisfy required attributes [POSITION, TANGENTS, COLOR, UV0]
2019-10-17 17:30:55.807 22579-22579/com.example.arcore_test W/Filament: [instance=1, primitive @ 3] missing required attributes (0xf), declared=0xb
2019-10-17 17:30:55.807 22579-22579/com.example.arcore_test W/Filament: setMaterialInstanceAt() on primitive 4 of Renderable at 1: declared attributes [POSITION, TANGENTS, UV0] do no satisfy required attributes [POSITION, TANGENTS, COLOR, UV0]
2019-10-17 17:30:55.807 22579-22579/com.example.arcore_test W/Filament: [instance=1, primitive @ 4] missing required attributes (0xf), declared=0xb
2019-10-17 17:30:55.807 22579-22579/com.example.arcore_test W/Filament: setMaterialInstanceAt() on primitive 5 of Renderable at 1: declared attributes [POSITION, TANGENTS, UV0] do no satisfy required attributes [POSITION, TANGENTS, COLOR, UV0]
2019-10-17 17:30:55.807 22579-22579/com.example.arcore_test W/Filament: [instance=1, primitive @ 5] missing required attributes (0xf), declared=0xb
2019-10-17 17:30:55.808 22579-22579/com.example.arcore_test W/Filament: setMaterialInstanceAt() on primitive 6 of Renderable at 1: declared attributes [POSITION, TANGENTS, UV0] do no satisfy required attributes [POSITION, TANGENTS, COLOR, UV0]
2019-10-17 17:30:55.808 22579-22579/com.example.arcore_test W/Filament: [instance=1, primitive @ 6] missing required attributes (0xf), declared=0xb
Upvotes: 1
Views: 3109
Reputation: 5392
This typically means in the GLTF file you have declared a resource texture and the path to use that texture is not valid.
Confirm your GLTF file was packaged properly with the textures included.
It appears to me that you are treating this like the SFB files or DAE files where you have the textures separately in image files. Have your designer export them as packaged textures and you should be fine.
https://www.khronos.org/blog/art-pipeline-for-gltf
Upvotes: 2