A WIP map engine written in Rust using WGPU.
The initial goal of the project is to learn a new cross-platform tech stack to build a mobile and Linux KMS-ready map engine. The project focuses on rendering and navigation features, including dead reckoning and map matching.
I'm writing about the tech I've learned here
Running on macOS, Android, iOS and Linux via KMS
The stack leverages the following approaches and libraries:
- Map vector graphics renderer written in Rust using WGPU as a low-level cross-platform graphics API and with RustyBuzz support as a vector font shaper for TextRenderer.
- Uses custom tiles, a simple tiles generator and a tile server, separate repo. The server is running in free AWS EC2 Cloud.
- Kotlin/Compose Multiplatfom, uniffi-rs and gobley projects enable fast and seamless integration with Android/iOS mobile apps(Android is priority for now)
- Slint UI is used for native platforms (macOS and Linux)
- Rust Valhalla client is used a routing clieng/engine
- Create a baseline POC with initial architecture
- Complete README and examples
- Initial rendering to texture
- Better integration with SlintUI
- A GPU-driven dotted line rendering
- Initial SSAO(Screen Space Ambient Occlusion)
- Running on pure Linux via KMS with Slint UI
- Simple shadow mapping
- Integration with WESL
- Initial MVT tiles support
- In progress General Renderer refactoring
- In progress Initial CPU renderer
- Integrate a simple search
- Move the custom tile generator to the cloud
- Implement an initial geometric Map-matching POC
- Software Dead-reckoning
- CI for KMP mobile SDK + Screenshot rendering
- Move TextRenderer to the separate repo
- Explore Mesh Shader
- Post-processing AA(SMAA)
In root folder:
cargo run --package winit-run --release
- Make sure the latest Xcode is installed!
- Open "kmp" folder in AndroidStudio and just Run "demo" app or execute:
./gradlew :composeApp:installRelease && adb shell am start -n "com.shashlik.demo/com.shashlik.demo.MainActivity"
Open "kmp/iosApp" project in XCode and just Run it
The current version has been tested on a Raspberry Pi 4 with Raspberry Pi OS Lite. It works via KMS and doesn't require a window subsystem.
Prerequisites for the Linux device:
- Enable SSH
- Install and configure Vulkan:
sudo apt install mesa-vulkan-drivers vulkan-tools libvulkan1
- Install additional required libraries:
sudo apt install libfontconfig1 libgbm1 libinput10 libxkbcommon-x11-0
Prerequisites for the building machine:
- Install cross-rs
cargo install cross --git https://github.com/cross-rs/cross --branch main --force - Install Docker
Execute kms_deploy.sh script:
chmod +x kms_deploy.shTARGET_HOST=admin@raspberrypi.local ./kms_deploy.sh. Note: Replace with your actual device user and address.
- Add dependency to the version catalog
[versions]
shashlikMap = "0.2.1"
[libraries]
shashlikmap = { module = "io.github.shashlikmap:mapshared", version.ref = "shashlikMap" }
In build.gradle.kts(KMP or Android):
implementation(libs.shashlikmap)
- Include Composable function
ShashlikMap { _, _ -> }anywhere in your Compose UI
@Composable
fun App() {
MaterialTheme {
ShashlikMap { _, _ -> }
}
}- Note: Android app will ask for locations permissions.
- Tileset on the Web Service is generated only for Japan and USA(Bay Area)
- Android app might not work on Android Emulator with hardware GPU acceleration. Try to change GPU mode to
Softwareone. - Debug build performance is significantly lower than Release build.