wasabia / flutter_gl

cross-platform call OpenGL API by Dart through dart:ffi. Provides OpenGL with Texture Widget on Flutter.
243 stars 60 forks source link

Runing the example with error. #11

Closed rivalnhwc closed 2 years ago

rivalnhwc commented 2 years ago

I tried to run this project on my device, but i got some error:

2022-03-28 18:28:58.750 21107-21107/com.futouapp.fluttergl.example W/FlutterActivityAndFragmentDelegate: A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
2022-03-28 18:28:58.860 21107-21160/com.futouapp.fluttergl.example D/OpenGLRenderer: HWUI GL Pipeline
2022-03-28 18:28:58.885 21107-21107/com.futouapp.fluttergl.example W/Looper: Dispatch took 2430ms on main, h=Handler (android.app.ActivityThread$H) {96d5911} cb=null msg=100
2022-03-28 18:28:58.887 21107-21107/com.futouapp.fluttergl.example W/Looper: Dispatch delayed 1818ms on main, h=Handler (android.app.ActivityThread$H) {96d5911} cb=null msg=149
2022-03-28 18:28:59.008 21107-21160/com.futouapp.fluttergl.example I/OpenGLRenderer: Initialized EGL, version 1.4
2022-03-28 18:28:59.009 21107-21160/com.futouapp.fluttergl.example D/OpenGLRenderer: Swap behavior 0
2022-03-28 18:28:59.029 21107-21160/com.futouapp.fluttergl.example D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2022-03-28 18:28:59.048 21107-21140/com.futouapp.fluttergl.example D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2022-03-28 18:28:59.607 21107-21162/com.futouapp.fluttergl.example I/flutter: Observatory listening on http://127.0.0.1:33373/2wQz_KwT-3I=/
2022-03-28 18:29:05.285 21107-21139/com.futouapp.fluttergl.example I/flutter:  init state..... 
2022-03-28 18:29:08.645 21107-21139/com.futouapp.fluttergl.example I/flutter:  screenSize: Size(958.1, 561.4) dpr: 1.068750023841858 
2022-03-28 18:29:13.610 21107-21184/com.futouapp.fluttergl.example D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2022-03-28 18:29:13.615 21107-21184/com.futouapp.fluttergl.example D/com.futouapp.flutter_gl.flutter_gl.EglEnv:  egl make current 
2022-03-28 18:29:13.936 21107-21139/com.futouapp.fluttergl.example I/flutter:  flutterGlPlugin: textureid: 0 
2022-03-28 18:29:15.678 21107-21139/com.futouapp.fluttergl.example I/flutter: Error compiling shader: 
    Error compiling shader:
    0:1: L0003: Keyword 'attribute' is reserved
2022-03-28 18:29:15.681 21107-21139/com.futouapp.fluttergl.example I/flutter: Error compiling shader: 
    Error compiling shader:
    0:5: L0002: Undeclared variable 'gl_FragColor'
2022-03-28 18:29:15.710 21107-21139/com.futouapp.fluttergl.example E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type 'Null' is not a subtype of type 'int' of 'shader'
    #0      OpenGLContextES.attachShader (package:flutter_gl/openGL/opengl/OpenGLContextES.dart:496:15)
    #1      _MyAppState.initShaders (package:flutter_gl_example/ExampleTriangle01.dart:301:8)
    #2      _MyAppState.prepare (package:flutter_gl_example/ExampleTriangle01.dart:242:10)
    #3      _MyAppState.setup (package:flutter_gl_example/ExampleTriangle01.dart:81:5)
    <asynchronous suspension>
wasabia commented 2 years ago

在MyApp里 换成 ExampleDemoTest 这个demo 那个三角形的demo shader有问题

rivalnhwc commented 2 years ago

好吧,还有另一个问题,是在three_dart的项目里,也是跑example的时候,点进进去是黑的,log是这样的:

这是点开第二个demo,然后回退的log

2022-03-29 11:09:06.271 20799-20830/com.example.example I/flutter: three3dRender.initialize _options: {antialias: true, alpha: false, width: 958, height: 561, dpr: 1.068750023841858} 
2022-03-29 11:09:06.294 20799-21246/com.example.example D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2022-03-29 11:09:06.298 20799-21246/com.example.example D/com.futouapp.flutter_gl.flutter_gl.EglEnv:  egl make current 
2022-03-29 11:09:06.895 20799-20830/com.example.example I/flutter: Important warn: make sure set samples before setRenderTarget  
2022-03-29 11:09:07.136 20799-20830/com.example.example E/mali_so: encounter the first gles_error : 0x0002; gles_state_error_info : <size> is less than 0 (gles_buffer_buffer_data at hardware/arm/maliT760/driver/product/gles/src/buffer/mali_gles_buffer_api.c:220)
2022-03-29 11:09:07.892 20799-20830/com.example.example I/flutter: render cost: 762 
2022-03-29 11:09:07.893 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:07.895 20799-20830/com.example.example I/flutter: {frame: 1.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:07.908 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:07.933 20799-21246/com.example.example I/System.out: Results of compiling source:
2022-03-29 11:09:07.936 20799-21246/com.example.example I/System.out: Results of compiling source:
2022-03-29 11:09:08.010 20799-20830/com.example.example I/flutter: render cost: 59 
2022-03-29 11:09:08.011 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:08.012 20799-20830/com.example.example I/flutter: {frame: 2.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:08.051 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:08.141 20799-20830/com.example.example I/flutter: render cost: 39 
2022-03-29 11:09:08.143 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:08.144 20799-20830/com.example.example I/flutter: {frame: 3.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:08.153 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:08.256 20799-20830/com.example.example I/flutter: render cost: 58 
2022-03-29 11:09:08.258 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:08.259 20799-20830/com.example.example I/flutter: {frame: 4.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:08.277 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:08.357 20799-20830/com.example.example I/flutter: render cost: 37 
2022-03-29 11:09:08.358 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:08.359 20799-20830/com.example.example I/flutter: {frame: 5.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:08.369 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:08.447 20799-20830/com.example.example I/flutter: render cost: 34 
2022-03-29 11:09:08.447 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:08.448 20799-20830/com.example.example I/flutter: {frame: 6.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:08.458 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:08.533 20799-20830/com.example.example I/flutter: render cost: 33 
2022-03-29 11:09:08.534 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:08.535 20799-20830/com.example.example I/flutter: {frame: 7.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:08.544 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:08.635 20799-20830/com.example.example I/flutter: render cost: 47 
2022-03-29 11:09:08.636 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:08.638 20799-20830/com.example.example I/flutter: {frame: 8.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:08.649 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:08.732 20799-20830/com.example.example I/flutter: render cost: 39 
2022-03-29 11:09:08.733 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:08.734 20799-20830/com.example.example I/flutter: {frame: 9.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:08.744 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:08.828 20799-20830/com.example.example I/flutter: render cost: 41 
2022-03-29 11:09:08.829 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:08.831 20799-20830/com.example.example I/flutter: {frame: 10.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:08.840 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:08.942 20799-20830/com.example.example I/flutter: render cost: 58 
2022-03-29 11:09:08.944 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:08.945 20799-20830/com.example.example I/flutter: {frame: 11.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:08.954 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.030 20799-20830/com.example.example I/flutter: render cost: 32 
2022-03-29 11:09:09.031 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.032 20799-20830/com.example.example I/flutter: {frame: 12.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.042 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.116 20799-20830/com.example.example I/flutter: render cost: 31 
2022-03-29 11:09:09.117 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.117 20799-20830/com.example.example I/flutter: {frame: 13.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.127 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.211 20799-20830/com.example.example I/flutter: render cost: 42 
2022-03-29 11:09:09.212 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.213 20799-20830/com.example.example I/flutter: {frame: 14.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.223 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.328 20799-20830/com.example.example I/flutter: render cost: 62 
2022-03-29 11:09:09.329 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.330 20799-20830/com.example.example I/flutter: {frame: 15.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.343 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.439 20799-20830/com.example.example I/flutter: render cost: 52 
2022-03-29 11:09:09.443 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.447 20799-20830/com.example.example I/flutter: {frame: 16.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.450 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.535 20799-20830/com.example.example I/flutter: render cost: 39 
2022-03-29 11:09:09.536 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.537 20799-20830/com.example.example I/flutter: {frame: 17.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.547 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.633 20799-20830/com.example.example I/flutter: render cost: 40 
2022-03-29 11:09:09.634 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.634 20799-20830/com.example.example I/flutter: {frame: 18.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.644 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.718 20799-20830/com.example.example I/flutter: render cost: 29 
2022-03-29 11:09:09.719 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.720 20799-20830/com.example.example I/flutter: {frame: 19.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.729 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.804 20799-20830/com.example.example I/flutter: render cost: 32 
2022-03-29 11:09:09.805 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.806 20799-20830/com.example.example I/flutter: {frame: 20.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.818 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.895 20799-20830/com.example.example I/flutter: render cost: 34 
2022-03-29 11:09:09.896 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.897 20799-20830/com.example.example I/flutter: {frame: 21.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.906 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:09.985 20799-20830/com.example.example I/flutter: render cost: 36 
2022-03-29 11:09:09.985 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:09.986 20799-20830/com.example.example I/flutter: {frame: 22.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:09.996 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:10.074 20799-20830/com.example.example I/flutter: render cost: 34 
2022-03-29 11:09:10.075 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:10.076 20799-20830/com.example.example I/flutter: {frame: 23.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:10.085 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:10.161 20799-20830/com.example.example I/flutter: render cost: 33 
2022-03-29 11:09:10.162 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:10.163 20799-20830/com.example.example I/flutter: {frame: 24.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:10.173 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:10.253 20799-20830/com.example.example I/flutter: render cost: 36 
2022-03-29 11:09:10.253 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:10.254 20799-20830/com.example.example I/flutter: {frame: 25.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:10.264 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:10.337 20799-20830/com.example.example I/flutter: render cost: 30 
2022-03-29 11:09:10.337 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:10.338 20799-20830/com.example.example I/flutter: {frame: 26.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:10.348 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:10.422 20799-20830/com.example.example I/flutter: render cost: 31 
2022-03-29 11:09:10.422 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:10.424 20799-20830/com.example.example I/flutter: {frame: 27.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:10.434 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:10.515 20799-20830/com.example.example I/flutter: render cost: 38 
2022-03-29 11:09:10.516 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:10.517 20799-20830/com.example.example I/flutter: {frame: 28.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:10.526 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:10.601 20799-20830/com.example.example I/flutter: render cost: 32 
2022-03-29 11:09:10.602 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:10.603 20799-20830/com.example.example I/flutter: {frame: 29.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:10.612 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:10.706 20799-20830/com.example.example I/flutter: render cost: 43 
2022-03-29 11:09:10.707 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:10.709 20799-20830/com.example.example I/flutter: {frame: 30.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:10.718 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:10.809 20799-20830/com.example.example I/flutter: render cost: 32 
2022-03-29 11:09:10.811 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:10.812 20799-20830/com.example.example I/flutter: {frame: 31.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:10.822 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:11.164 20799-20830/com.example.example I/flutter: render cost: 31 
2022-03-29 11:09:11.165 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:11.166 20799-20830/com.example.example I/flutter: {frame: 32.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:11.176 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:11.288 20799-20830/com.example.example I/flutter: render cost: 33 
2022-03-29 11:09:11.289 20799-20830/com.example.example I/flutter: {geometries: 2, textures: 1}
2022-03-29 11:09:11.290 20799-20830/com.example.example I/flutter: {frame: 33.0, calls: 32, triangles: 2080.0, points: 0, lines: 0}
2022-03-29 11:09:11.298 20799-20830/com.example.example I/flutter:  render: sourceTexture: 3 three3dRender.textureId! 1
2022-03-29 11:09:11.381 20799-20830/com.example.example I/flutter:  dispose ............. 
2022-03-29 11:09:11.389 20799-20799/com.example.example E/libEGL: eglDestroySurface:838 error 300d (EGL_BAD_SURFACE)
wasabia commented 2 years ago

可以再试试 使用github最新代码