A complete Android app example/template that uses androidx.webgpu library.
The repository serves as a starting point for Android developers who want to explore using WebGPU for high-performance graphics and computation within a familiar Kotlin/Android environment. WebGPU is designed to be the modern successor to older APIs like OpenGL ES.
This example uses the latest 1.0.0-alpha03 version. It renders a simple cube, a camera can be rotated around using touch gesture. It also demostrates how to work with:
- WebGPU configuration + integration with Compose UI
- Matrices calculation
- Creating GPU buffers(vertex/index), both for uniform and vertices purposes
- Simple diffuse lighting
- A few tweaks around androidx.webgpu
- Antialiasing + depth features are in progress
I recommend to install a couple plugins for Android Studio :
- WGSL plugin if you want to play with shaders.
- Wavefront OBJ viewer helps to render the OBJ format right from the Studio.
P.S. Thanks to the article for the inspiration.
P.S.S. Compose Multiplatform + Rust WGPU template can be found here