I'm learning computer graphics by watching the a l a r m i n g l y well produced recorded lectures by Cem Yuksel for University of Utah's Interactive Computer Graphics CS 5610/6610.
This repository contains my attempt to complete the projects associated with the course.
❗ WARNING: Developed and tested ONLY on Metal 3 (MacOS Ventura Beta 4, Xcode 14 Beta 4, MacBook Pro M1 Max). Outside of this setup, I have no idea whether any of this code works.
- Render something!
- Transform model vertex coordinates to to normalized device coordinates
- Toggle between Orthographic and Perspective Projection
- Ambient, Diffuse, and Specular Shading
- Load and render model materials
- Render to a texture, then render that texture to a plane
- Toggle between different texture sampling modes
- Nearest
- Bilinear
- Trilinear
- Anisotropic
- Render an environment (skybox) using a cube texture
- Render model and plane with perfect, mirror-like material
- Render model's reflection onto the plane
Alternate implementation of Project 6 using Ray Tracing.
- Render model and plane using multi-bounce (4) ray tracing
- Unlike original Project 6, the model reflects on itself!
- Render laser pointer to visualize ray tracing
- Render shadows of a model onto itself and a plane below it
- Use a Shadow Map (Depth texture)
Alternate implementation of Project 7 using Ray Tracing.
- Render shadows of a model onto itself and a plane below it
- Use a Ray Tracing
- Normal Mapping
- Displacement Mapping with Tesselation Shaders
- Basic Ray Tracing (Primary Ray) rendering a model's normals
- Uses an Acceleration Structure with embedded normals for each triangle primitive
- Normals (3) are encoded as 2 u32's (unorm 10 10 10 2) with Signed Octohedral encoding
- Goals
- Learn the basics of using the Metal Ray Tracing APIs and XCode's Acceleration Structure tooling.
- Develop
metal-app/ModelAccelerationStructure
API for loading a model's geometry into a Metal Acceleration Structure- Used by X-Project 6 and X-Project 7
Hold on to your butts....
I'm trying to learn new stuff on top of new stuff.
- Rust
- Apple Metal
- metal-rs Crate for Rust/Metal bindings
- Metal 3 techniques used
- Bindless Argument buffers
- Faster Resource Loading with MTLIO
- asset-compiler crate
- Cube Textures (ex. Project 6: Environment Mapping)
- Build/compile time, cube face textures are compiled into a directory of
lz4
compressed textures using Metal 3's MTLIO Compression Context - Run time, cube faces are loaded into a cube texture using Metal 3's MTLIO Command Buffer
- Build/compile time, cube face textures are compiled into a directory of
- Cube Textures (ex. Project 6: Environment Mapping)
- asset-compiler crate
- Coming soon: Offline Native Shader Compilation/Loading
TODO: Document
metal-types
/metal-build
crates and how data structures are shared between Metal and Rust
TODO: Document how
metal-build
providesbuild.rs
support for each project to precompile shaders
TODO: Document
metal-app
, especially RenderPipeline and Binds for simplifying and removing/reducing errors when setting up simple to complex (ex. depth/stencil, multiple sub-passes, many binds) render pipelines.
See performance.md for more in-depth documentation on workflows and tooling for assessing performance.