Computer graphics has gotten to the point where you can't just draw pixels onto the screen directly anymore. Instead, rendering APIs are used for drawing in order to efficiently utilize the hardware. Each platform has its own set of preferred APIs (DirectX on Windows, Metal on MacOS, etc), where said platform has its own little quirks and tricks.
Built in rust, mepeyew
is meant to hide away these quirks in a nice and neat package while
trying to give you as much power as possible!
| Hello Triangle | Outlined Cube | PBR Spheres |
| :------------------------: | :-----------------------------: | :-------------------: |
| |
|
|
You can run mepeyew
on Windows, MacOS, Linux, and the Web.
Currently, we support Vulkan and WebGpu.
In terms of shading languages, we support Glsl, Spirv, and Wgsl all with the help of naga.
Add this to your Cargo.toml
:
mepeyew = "0.2"
This enables mepeyew
with the following features:
vulkan
webgpu
surface_extension
naga_translation
If you do not plan on using these features, disabling them will decrease your dependency count.
Hey, welcome to the world of graphics programming. I'm deeply sorry, but in this strange world, there is no such thing as "basic usage". I'd like to put the classic triangle example code, but that would completely fill your screen. Instead, I'd recommend checking out the examples here on Github.
Unfortunately, not everything can be fully abstracted! Please read the docs before continuing!
MacOS does not natively support Vulkan, so you will need to install LunarG's Vulkan SDK from here. Then, you will need the following exports to proper compile.
VULKAN_SDK=$HOME/VulkanSDK/<version>/macOS
DYLD_FALLBACK_LIBRARY_PATH=$VULKAN_SDK/lib
VK_ICD_FILENAMES=$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json
VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d
Currently, initializing WebGpu requires async which is currently not supported.
Because of this, we use the WebGpuInitFromWindow
extension as a workaround.
You can see its use in the examples.
The easiest way to get setup is to create an extra workspace member in your
Cargo.toml
.
[workspace]
members = [
"run_wasm"
]
Then, implement run_wasm
exactly as shown in this repo.
This is very important as this project depends on my fork of run_wasm
and
NOT the original crate.
This project is a work in progress! The API is designed to be stable, but I can't guarantee anything of course.