Skip to main content

ent_opengl 0.1.0-dev.3 copy "ent_opengl: ^0.1.0-dev.3" to clipboard
ent_opengl: ^0.1.0-dev.3 copied to clipboard

The OpenGL ES renderer of Ent Engine: the shared renderer core drawing through OpenGL ES 3, on ANGLE (Metal) on macOS and on the system's OpenGL ES on Android.

ent_opengl #

The OpenGL ES renderer of Ent Engine: OpenGlRenderer draws through OpenGL ES 3, on ANGLE (Metal) on macOS and on the system's OpenGL ES on Android. It exports all of ent, EntView and OrbitControlsListener, so an app depends on ent_opengl only.

It draws what ent_flutter's Flutter GPU renderer draws, from the same renderer core and the same shaders, and is checked against the same reference frames. Use it where Flutter GPU does not run, such as Android phones where Impeller falls back to OpenGL ES.

Requirements #

  • Flutter 3.47.6 or later. Flutter GPU does not need to be enabled.
  • macOS: ANGLE comes from the wrangle package, bundled with the app (arm64 and x64).
  • Android: OpenGL ES 3.0, API level 24 or later.
Platform Status
macOS Verified on an M1
Android Verified on a Galaxy S10 (Mali-G76)
iOS, Windows, Linux, web Not supported in this version

Getting started #

  1. Depend on ent_opengl.

  2. List the shader variants the app draws with, in a registry file as for ent_flutter (its README, step 2), and name it under ent_opengl, whose build hook compiles them:

    hooks:
      user_defines:
        ent_opengl:
          shaders: ent_shaders.json
    

    An app that uses Flutter GPU on some platforms and OpenGL ES on others depends on both renderer packages, names the same file under each, and says in it which renderer draws where, so each platform carries only its renderer's shaders:

    {
    	"renderers": {
    		"ios": "ent_flutter",
    		"macos": "ent_flutter",
    		"android": "ent_opengl"
    	},
    	"variants": ["basic"]
    }
    
  3. Install the platform services, create the renderer and show the scene:

    FlutterPlatform.install();
    final renderer = await OpenGlRenderer.create(antialias: true);
    
    EntView(
      renderer: renderer,
      scene: scene,
      camera: camera,
      onFrame: (elapsed) => cube.rotation.y = elapsed.inMicroseconds / 1e6,
    );
    

    EntView shows the frames in a Flutter Texture widget. It does not own the renderer: the app disposes it.

example/main.dart is this as a whole app, and the repository's examples/opengl is a bigger one, with the integration tests. Flutter's widgets define Color and Texture too: import them with hide Color, Texture.

How it draws, which way its rows run, how frames reach the screen and how it compares with the reference frames is in docs/opengl.md.

Tests #

flutter test --enable-impeller --enable-flutter-gpu
cd ../../examples/opengl && flutter build macos --debug && flutter test integration_test/parity_test.dart -d macos

The host tests compare its frames with Flutter GPU's, which needs the flags, and run the parity scenes on ANGLE.

License #

MIT, © 2026 KAMORA Ltd.; see LICENSE.

0
likes
0
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

The OpenGL ES renderer of Ent Engine: the shared renderer core drawing through OpenGL ES 3, on ANGLE (Metal) on macOS and on the system's OpenGL ES on Android.

Repository (GitHub)
View/report issues

Topics

#graphics #rendering #opengl

License

unknown (license)

Dependencies

code_assets, ent, ent_impeller, ent_renderer, ffi, flutter, hooks, vector_math, wrangle

More

Packages that depend on ent_opengl

Packages that implement ent_opengl