ACMX2 Android is the mobile build of the ACMX2 interactive visualizer. It runs a local, GPU-accelerated shader/3D visual pipeline inside Android WebView and packages the native visual engine as WebAssembly assets.
Project page: https://lostsidedead.biz/acmx2-android.html
the C++ WebAssembly module code: https://github.com/lostjared/MX2.Graphics.Demo/
Current bundled app/runtime version: v1.8.0
The Android host loads the visualizer ACMX2 Interactive Visualizer v1.8.0 at startup.
ACMX2 Android is a fullscreen visual effects app that lets you:
- Render realtime GLSL effects and model-based visuals
- Cycle and select shader presets
- Use camera input or video file input
- Edit and compile custom GLSL ES 3.0 fragment shaders live
- Build ordered multi-pass shader chains
- Control uniforms (speed, amplitude, color, transform, camera controls)
- Record output (WebM/MP4) and save snapshots to Gallery
The app uses a layered runtime:
- Core rendering/visual logic is provided by a C++ engine compiled with Emscripten and shipped as:
acmx2/app/src/main/assets/visualizer/MX_app.wasmacmx2/app/src/main/assets/visualizer/MX_app.jsacmx2/app/src/main/assets/visualizer/MX_app.data
- The JavaScript layer calls exported engine APIs through
Module.*(examples inindex.html:Module.getShaderCount,Module.getShaderNameAt,Module.compileCustomShader,Module.setUniform,Module.nextShaderWeb,Module.prevShaderWeb,Module.saveImage,Module.resize).
acmx2/app/src/main/assets/visualizer/index.htmlcontains the UI and runtime logic.- It pre-initializes a
webgl2context (fallback towebgl) and uses GLSL ES 3.0 shader code/templates (#version 300 es) for custom shader editing. - JS handles:
- UI state and controls
- camera/video ingestion
- shader list population
- multipass shader ordering
- recording pipeline and optional FFmpeg.wasm conversion
- On Android WebView, WebGL2 maps to an OpenGL ES 3 class backend.
- The Emscripten runtime in
MX_app.jsexplicitly handles GLES/WebGL2 compatibility and context setup. - In practice: the visual engine renders through the WebGL2/OpenGL ES3 path when available.
acmx2/app/src/main/java/biz/lostsidedead/acmx2/MainActivity.javahosts the visualizer in a fullscreenWebView.WebViewAssetLoaderserves local assets fromhttps://appassets.androidplatform.net/assets/visualizer/index.html.- Java configures permissions (camera/mic), immersive mode, file picker, and cache behavior.
- Java exposes
AndroidInterfacemethods via@JavascriptInterfaceso JS can save images/videos through Android MediaStore.
- C++: high-performance rendering/engine logic
- JavaScript: fast iteration UI + shader tooling + browser APIs
- Java: Android lifecycle, permissions, storage, and WebView host integration
- OpenGL ES 3 / WebGL2: GPU rendering backend on device
This design keeps the rendering engine portable while still integrating cleanly with Android-native features.
Based on the current packaged app/runtime:
- Runtime/versioned boot flow for
v1.8.0 - Fullscreen immersive WebView host and local asset loading
- Custom GLSL ES 3.0 shader editor with compile/apply and templates
- Multipass shader chain UI (ordered passes, enable/clear workflow)
- Camera and video-file input workflows
- 3D model selection and touch controls (rotate/pinch/pan)
- Recording options (WebM + MP4 path with native support or FFmpeg.wasm conversion fallback)
- Android save bridge for snapshots and chunked video export to Gallery
minSdk = 30targetSdk = 36- Java 11 toolchain for the Android project
Permissions used:
CAMERARECORD_AUDIOMODIFY_AUDIO_SETTINGSINTERNETWRITE_EXTERNAL_STORAGE(maxSdkVersion 32)
From this repository folder:
cd acmx2
./gradlew assembleDebugDebug APK output:
acmx2/app/build/outputs/apk/debug/
For release builds:
cd acmx2
./gradlew assembleReleaseacmx2/app/src/main/java/.../MainActivity.javaAndroid host app + JS bridgeacmx2/app/src/main/res/layout/activity_main.xmlfullscreen WebView layoutacmx2/app/src/main/assets/visualizer/index.htmlJS UI/runtimeacmx2/app/src/main/assets/visualizer/MX_app.jsEmscripten loader/runtime glueacmx2/app/src/main/assets/visualizer/MX_app.wasmcompiled C++ engineacmx2/app/src/main/assets/visualizer/MX_app.datapackaged shader/model/data assets
- This Android app packages a prebuilt visual runtime (
MX_app.*) as assets. - If the C++ engine is updated, regenerate and replace the
MX_app.js/.wasm/.databundle before shipping a new app release.
