google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.8k stars 1.89k forks source link

Filament Issue when compiling using 1.9.2 #3159

Closed HemanParbhakar closed 4 years ago

HemanParbhakar commented 4 years ago

Describe the bug A clear and concise description of what the bug is. Error : Panic in static filament::MaterialParser filament::FMaterial::createParser(backend::Backend, const void , size_t):512 reason: Material version mismatch. Expected 10 but received 7. Version Androd: api 'com.google.android.filament:filament-android:1.9.2' api 'com.google.android.filament:gltfio-android:1.9.2' implementation files("../libs/libsceneform_runtime_schemas.jar") api "com.google.ar:core:1.19.0" Filament version compiled with 1.9.2 matc --version 10 To Reproduce Steps to reproduce the behavior:

  1. Created a mat file using material { name : "Occlusion material", shadingModel : unlit, colorWrite : false, depthWrite : true }

fragment { void material(inout MaterialInputs material) { prepareMaterial(material); material.baseColor = vec4(0.0); } }

  1. Compile the mat file using

matc -p mobile -a opengl -o output.filamat input.mat

  1. Then set the model using: Renderable renderable; ModelRenderable.builder() .setSource( this, Uri.parse( "https://storage.googleapis.com/ar-answers-in-search-models/static/Tiger/model.glb")) .setIsFilamentGltf(true) .build() .thenAccept( modelRenderable -> { renderable = modelRenderable; com.google.ar.sceneform.rendering.Material.builder() .setSource( getApplicationContext(), R.raw.output ) .build() .thenAccept(new Consumer() { @Override public void accept(Material material) { renderable.setMaterial(material); } });

                    })
            .exceptionally(
                    throwable -> {
                        Toast toast =
                                Toast.makeText(this, "Unable to load Tiger renderable", Toast.LENGTH_LONG);
                        toast.setGravity(Gravity.CENTER, 0, 0);
                        toast.show();
                        return null;
                    });

    } Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

romainguy commented 4 years ago

You are passing Filament an older material file. Make sure you recompile all your materials.

HemanParbhakar commented 4 years ago

i have recompiled it again still same

romainguy commented 4 years ago

It must be another material

HemanParbhakar commented 4 years ago

no its same i have only one material

HemanParbhakar commented 4 years ago

Also how to set this material priority above then that of camera.

romainguy commented 4 years ago

If you are using Sceneform you will probably need to recompile the materials used by Sceneform internally.

HemanParbhakar commented 4 years ago

i have already recompile then given the path of the .filamat file. It's still same. But if i make the version of filament in Android 1.7.1 Also the version with which i am compiling to 1.7.1. then it works not with latest version in both case.

HemanParbhakar commented 4 years ago

on using the 1.7.1 version the element does not perform occulsion.