Skip to content

brandonpollack23/sarekt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sarekt

Crates.io

Overview

This is my third attempt to make something in Vulkan. I think I've accumulated enough knowledge and wherewithal to make something worthwhile.

This is a renderer that has Vulkan first as it's backend that I want to keep relatively low level. I think it'll expose a lot at first, and slowly begin wrapping this again in another wrapper I'll call "Shran", another Star Trek character.

Shran wrapper. Get it?

Usage

This readme is minimal. Cargo doc is your friend. This is far from done.

The most up to date documentation/usage you'll get is by checkout out the examples (later is better). So far the best one is 03_vertex_loading.

Sarekt can load arbitrary models, textures, and uniforms and display them.

Textures can be any image format supported by the image crate and will be converted

Only one pipeline and render pass type.

Hero Dependencies

See the dependencies of this project. Seriously the Rust community is just fantastic.

  • ash Rediculously good vulkan bindings with builders and rock solid velocity.
  • vk-mem Solid rust wrapper around an amazing allocation library so I dont have to make GPU malloc all by myself and can get to writing Vulkan code! I fixed a bug and somehow become a contributor to this one
  • vk-shader-macros Shader macros that compile GLSL to SPIR-V and include the bytes for me. Juicy.
  • log Abstract at compile time logging.
  • winit Platform agnostic window and vulkan context creation.
  • slotmap A great generational index store, useful for handles
  • wavefront_obj Model loader for obj
  • gltf Model loader for GlTf
  • image Loading image data.

There are more but these ones I rely on the most, please check them all out.

Name

"Sarek" is the Vulcan father of the character "Spok" of Star Trek. The added t also makes it a portmanteu with rect(angle).

I know and I'm sorry.

Examples

All the examples that are straightforward with no params have no section here, just run'em with cargo run --example NAME

Those that have arguments just pass them like so:
cargo run --example 06_textures -- colors

Example 6, Textures

This is where things finally start to get fun,there's a param to enable color mixing with the texture.

Starting with this example, the application coordinate space is right handed y up for simplicity, the ultraviolet library perspective functions correct it for the appropriate backend.

arguments:

  • colors - turns on the color mixing from raw colors, a simple multiplicative color mix in the default forward shader

Example 7 Depth buffer

Here we can see the depth buffer working in action. Camera moves so you an see the 3d effect.

Flags:

  • fps -- display fps

Example 8 Model loading.

Load a real 3d model (PreBaked lighting only)

Flags:

  • glb -- load glb version of the model.
  • fps -- show fps

Example 9 mip mapping

Enable mip mapping.

Example 10 MSAA

Enable MSAA. Does 2 by default

Flags:

  • 2x -- 2x MSAA
  • 4x -- 4x MSAA
  • 8x -- 8x MSAA
  • noaa -- turn off antialiasing.

About

Backend Agnostic Renderer in Rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages