Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snowycoder/cg23-voxelrenderer
Voxel Rendered developed for the Mobile Programming course ad UniMoRe
https://github.com/snowycoder/cg23-voxelrenderer
Last synced: 5 days ago
JSON representation
Voxel Rendered developed for the Mobile Programming course ad UniMoRe
- Host: GitHub
- URL: https://github.com/snowycoder/cg23-voxelrenderer
- Owner: SnowyCoder
- License: mit
- Created: 2023-12-06T09:55:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-03T15:25:34.000Z (about 1 year ago)
- Last Synced: 2024-11-12T09:14:22.557Z (2 months ago)
- Language: Rust
- Size: 2.71 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Voxel Renderer
This is my entry for the "Mobile Programming" exam developed in 2023 for UniMoRe.
The initial files are based on ![rust-mobile examples](https://github.com/rust-mobile/rust-android-examples/tree/main/agdk-winit-wgpu),
while using [learn-wgpu](https://github.com/sotrh/learn-wgpu) to, well, learn wgpu.## Features
- Instance-based rendering
- .vly format parsing
- .vox format parsing
- Blinn-Phong shader
- Android & Desktop support
- Runtime texture palette generation## Not implemented (yet)
- Face merging
- Raytracing
- Web support
- Transparency## Libraries
Original project requirements specify it's not possible to use any additional libraries like game engines or rendering abstraction layers.
Here's a list of the used libraries and their purpose
- `log`, `env_logger`, `android_logger`: Log handling helpers
- `winit`: Window initialization on multiple platforms
- `wgpu`: WebGPU-like interface and implementation
This is the only library that could be described as an abstraction layer, but the project has already been discussed in person with the professor
- `cgmath`: Linear Algebra helper
- `ply-rs`: .ply format parser
- `bytemuck`: Helper for serializing data to send to the GPU
- `nom`: Parser framework (for .vox and .vly formats)
- `anyhow`: Error handling helper
- `pollster`: Very lightweight async runtime
- `jni`: Java Native Interface library, used to retrieve the model to render from Android## What is vly format?
A simple voxel serialization format similar to ply but simpler, developed specifically as a challenge for this project.
You can find more precise requirements in [ProgettoCG2324.pdf](ProgettoCG2324.pdf)## Build Instructions
Android:
```bash
export ANDROID_NDK_HOME="path/to/ndk"
export ANDROID_HOME="path/to/sdk"rustup target add aarch64-linux-android
cargo install cargo-ndkcargo ndk -t arm64-v8a -o app/src/main/jniLibs/ build
./gradlew build
./gradlew installDebug
adb shell am start -n co.realfit.agdkwinitwgpu/.MainActivity
```Desktop:
```bashcargo run --features desktop -- models/christmas.vly
```Note: add `--release` in cargo parameters to enable compiler optimizations