io.ygdrasil:wgpu4k-scenes-js

Webgpu binding to kotlin multiplatform


Keywords
kotlin, library, multiplatform, webgpu
License
MIT

Documentation

WGPU4K: A WebGPU Binding for Kotlin Multi-platform

Tests Static Badge Static Badge Static Badge Static Badge

This project focuses on creating a binding for WebGPU which can support Kotlin on multiple platforms.

Table of Contents

  1. Prerequisites
  2. How to run the demo projects from library sources
  3. Getting started
  4. Compatibility
  5. Backend
  6. Project Phases
    1. Proof of Concept
    2. API Implementation
    3. API Refinement
    4. Production

Prerequisites

  • Gradle 8.8
  • JDK 22+
  • A recent version of Chrome or Firefox Nightly for web browser execution. Check compatibility here.

How to run the demo projects from library sources

git clone https://github.com/wgpu4k/wgpu4k.git
cd wgpu4k
  • On desktop JVM: ./gradlew examples:glfw:run
  • On web js: ./gradlew examples:web-js:jsBrowserRun
  • On web wasm: ./gradlew examples:web-js:wasmJsBrowserRun
  • On desktop native (Mac only and still experimental) ./gradlew examples:native:runDebugExecutableNative

Use page down and page up on your keyboard to switch scene.

Getting started

Documentation will be added later, to start you can check out the minimalist project here or see scenes implemented to end-to-end tests here.

Compatibility

Target Windows Linux MacOs iOS Android
JVM x64 🆗 🆗
JVM arm64 🛠️ 🆗
JS 🆗 ❓️
wasm 🆗️ 🆗️ 🆗️ ❓️ ❓️
native x86 🛠️ 🛠️ 🆗️ 🛠️ 🛠️
native arm64 🛠️ 🛠️ 🆗️ 🛠️ 🛠️

✅ = First class citizen

🆗 = Best effort

❓ = Untested, could work

🛠️ = Unsupported yet, open to contributions

❌ = Not applicable

Backend

On JVM we are using the firefox backend, see the GitHub page to get more information.

Project Phases

Proof of Concept

The current one, the aim of this phase is to test the technology on as many platforms as possible using elementary examples.

API Implementation

The entire API is implemented in this phase.

API Refinement

In this phase, the API is fine-tuned to be more idiomatic to Kotlin.

Production

This is the final phase when the project is ready for production.