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.34k stars 1.83k forks source link

OpenGL ES 2.0 Couldn't create Engine #7901

Closed zonda-alias closed 14 hours ago

zonda-alias commented 3 weeks ago

Logs eglChooseConfig failed with EGL_BAD_ATTRIBUTE 2024-06-04 17:47:34.464 7261-7261 AndroidRuntime io....ew.sample.modelviewer.compose D Shutting down VM 2024-06-04 17:47:34.481 7261-7261 AndroidRuntime io....ew.sample.modelviewer.compose E FATAL EXCEPTION: main Process: io.github.sceneview.sample.modelviewer.compose, PID: 7261 java.lang.IllegalStateException: Couldn't create Engine at com.google.android.filament.Engine$Builder.build(Engine.java:254) at com.google.android.filament.Engine.create(Engine.java:483) at io.github.sceneview.SceneView$Companion.createEngine(SceneView.kt:940) at io.github.sceneview.SceneKt$rememberEngine$2.invoke(Scene.kt:259) at io.github.sceneview.SceneKt$rememberEngine$2.invoke(Scene.kt:259) at io.github.sceneview.SceneKt.rememberEngine(Scene.kt:262) at io.github.sceneview.sample.modelviewer.compose.ComposableSingletons$MainActivityKt$lambda-2$1.invoke(MainActivity.kt:50) at io.github.sceneview.sample.modelviewer.compose.ComposableSingletons$MainActivityKt$lambda-2$1.invoke(MainActivity.kt:48) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248) at androidx.compose.material3.TextKt.ProvideTextStyle(Text.kt:352) at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:72) at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:71) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.material3.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:64) at io.github.sceneview.sample.ThemeKt.SceneviewTheme(Theme.kt:168) at io.github.sceneview.sample.modelviewer.compose.ComposableSingletons$MainActivityKt$lambda-3$1.invoke(MainActivity.kt:48) at io.github.sceneview.sample.modelviewer.compose.ComposableSingletons$MainActivityKt$lambda-3$1.invoke(MainActivity.kt:47) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:428) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:252) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:251) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:186) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:119) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:118) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:110) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$2.invoke(Wrapper.android.kt:139) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$2.invoke(Wrapper.android.kt:138) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) 2024-06-04 17:47:34.494 7261-7261 AndroidRuntime io....ew.sample.modelviewer.compose E at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:138) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:123) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:90) at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3302) at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3235) at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:725) at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:1071) at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:633) at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:619) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:123) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:114) at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:1289) at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:114) at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:164) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:322) at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.kt:199) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:121) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:114) at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:1364) at android.view.View.dispatchAttachedToWindow(View.java:18370) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3406) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3413) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3413) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3413) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3413) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1774) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1472) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7229) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:952) at android.view.Choreographer.doCallbacks(Choreographer.java:761) at android.view.Choreographer.doFrame(Choreographer.java:696) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:938) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6722) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 2024-06-04 17:47:34.522 7261-7261 Process io....ew.sample.modelviewer.compose I Sending signal. PID: 7261 SIG: 9 2024-06-04 17:47:34.570 1963-2034 InputDispatcher system_server E channel '2680446 io.github.sceneview.sample.modelviewer.compose/io.github.sceneview.sample.modelviewer.compose.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

Smartphone (please complete the following information):

romainguy commented 3 weeks ago

What app are you running? What's the repro case?

pixelflinger commented 3 weeks ago

Which device is this on?

zonda-alias commented 3 weeks ago

Which device is this on?

OpenGL ES 2.0 for Android Device

zonda-alias commented 3 weeks ago

What app are you running? What's the repro case?

sceneview-android

If filament is compatible with OpenGL ES 2.0.

pixelflinger commented 3 weeks ago

filament has very basic support for ES2, in particular it only supports unlit materials.

Which device is it failing on specifically?

zonda-alias commented 3 weeks ago

filament has very basic support for ES2, in particular it only supports unlit materials.

Which device is it failing on specifically?

There is an error message similar to the following:

Filament io.....sceneview.sample.modelviewer I FEngine (32 bits) created at 0xa7a4ac00 (threading is enabled) Filament io.....sceneview.sample.modelviewer D Using ASurfaceTexture Filament io.....sceneview.sample.modelviewer I FEngine resolved backend: OpenGL ConfigStore io.....sceneview.sample.modelviewer I android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 ConfigStore io.....sceneview.sample.modelviewer I android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0 libEGL io.....sceneview.sample.modelviewer E eglMakeCurrent:1105 error 3009 (EGL_BAD_MATCH) Filament io.....sceneview.sample.modelviewer V [ARM], [Mali-450 MP], [OpenGL ES 2.0 3d6a80e], [OpenGL ES GLSL ES 1.00] Filament io.....sceneview.sample.modelviewer V Feature level: 0 Active workarounds: vao_doesnt_store_element_array_buffer_binding allow_read_only_ancillary_feedback_loop Filament io.....sceneview.sample.modelviewer I Backend feature level: 0 Filament io.....sceneview.sample.modelviewer I FEngine feature level: 0 Filament io.....sceneview.sample.modelviewer E Panic in createParser:60 reason: the material was not built for the OpenGL backend Filament io.....sceneview.sample.modelviewer E
libc io.....sceneview.sample.modelviewer A Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 4774 (ple.modelviewer), pid 4774 (ple.modelviewer)

pixelflinger commented 2 weeks ago

Are you using "feature level 0" materials? Again, filament has very limited support for GLES2.0, you must only use feature level 0 materials on these devices.

zonda-alias commented 2 weeks ago

Are you using "feature level 0" materials? Again, filament has very limited support for GLES2.0, you must only use feature level 0 materials on these devices.

Is the "feature level 0" here specific what be to point to?

Is there anything that can be used to check whether the model meets the criteria

"feature level" that is to say "Level Of Detail" ?

pixelflinger commented 2 weeks ago

no, feature level 0 cannot handle glTF. Again, we only have very limited support, and you will need special content for ES2.