zirman / arcore-filament-example-app

ARCore Filament Example App
MIT License
95 stars 15 forks source link

[Question]: How to create *.mat files #14

Closed Drjacky closed 2 years ago

Drjacky commented 2 years ago

I realized you have depth.mat, flat.mat, shadow.mat and textured.mat. I'm wondering how did you create those files?(that then we can build .filamat files with the help of the shell script).

zirman commented 2 years ago

It's built using matc from files in ./app/src/main/materials/. You can download compiled binaries for matc here: https://github.com/google/filament/releases

Make sure you download the version compatible with filament in build.gradle.

Copy matc into the root of the project and run this script https://github.com/zirman/arcore-filament-example-app/blob/master/build-materials.sh.

Drjacky commented 2 years ago

Okay, I'm confused! We have(how?) filamat files which after we use the build-materials.sh/matc, we get mat files? Or We have mat files(how?) which after we use the build-materials.sh/matc, we get filamat files?

Either way, how we get the first files?

Drjacky commented 2 years ago

I'm asking this because of two things: 1- When I replace your GBL with mine, I get this error after run:

    reason: uniform named "alpha" not found
2021-11-09 14:32:27.401 7841-23509/com.example.app E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2021-11-09 14:32:27.404 7841-23509/com.example.app E/libc: Access denied finding property "persist.vendor.camera.privapp.list"
2021-11-09 14:32:27.414 7841-23553/com.example.app E/Filament: Unable to parse glb file.
2021-11-09 14:32:27.421 7841-23482/com.example.app E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2021-11-09 14:32:27.422 7841-23482/com.example.app E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2021-11-09 14:32:27.437 7841-7841/com.example.app E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.app, PID: 7841
    java.lang.NullPointerException
        at com.example.app.renderer.ModelRenderer$1$filamentAsset$1.invokeSuspend(ModelRenderer.kt:49)

2- If I want to update filament dependencies, I need to run the build-materials.sh Otherwise, I get an error:

reason: Material version mismatch. Expected 12 but received 11.