18 releases

0.3.5 Apr 28, 2024
0.3.4 Jan 28, 2024
0.3.3 Oct 1, 2023
0.3.2 Sep 29, 2023
0.1.8 May 24, 2023

#84 in Graphics APIs

BSD-2-Clause

7MB
8K SLoC

Mepeyew

Version Badge Docs Badge License Badge Downloads Badge

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! mepeyew wraps multiple graphics APIs like wgpu, but has an very explicit API similar to Vulkan's.

Hello Triangle Outlined Cube PBR Spheres

Platform Support

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.

Getting Started

Add this to your Cargo.toml:

mepeyew = "0.3"

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.

To get started with using mepeyew, check out the examples here on Github. They assume that you already understand graphics programming.

Platform Dependent Nastiness

Unfortunately, not everything can be fully abstracted away! Please read the docs before continuing!

Using on MacOS

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

Using on the Web

Be sure to see the documentation regarding WebGpuInit and WebGpuInitFromWindow.

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.

Of course, you can use wasm-pack, trunk, or whatever else you'd like.

Road Map

This project is mostly complete, but there are still bugs and changes that may come. The API is designed to be stable, but I can't guarantee anything of course.

  • Basic Uniforms
  • Textures
  • Shader Attachments
  • Documentation
  • v0.1 Release!
  • WGSL and Naga
  • WebGPU
  • Depth Buffers
  • Stencil Buffers
  • MSAA
  • More Attachment Formats
  • Dynamic Viewport + Scissor
  • Dynamic Uniforms
  • Shader Storage Buffer Objects
  • Compute
  • Blending and Culling
  • Mipmaps and LOD
  • Instancing
  • Replace Shader Uniform Frequency
  • More Documentation
  • (Debug, Clone, Copy, Hash, PartialEq, Eq)-ify Everything
  • v0.2 Release!
  • Cubemaps
  • Async / Await
  • WebGpu Resizing
  • Remove prelude
  • v0.3 Release!

Dependencies

~0–12MB
~140K SLoC