peterwmwong / uou-interactive-graphics

Interactive Computer Graphics CS 5610/6610 with Rust and Metal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Project 1: Hello World

  • Render something!

Project 1

Project 2: Transformations

  • Transform model vertex coordinates to to normalized device coordinates
  • Toggle between Orthographic and Perspective Projection

Project 2

Project 3: Shading

  • Ambient, Diffuse, and Specular Shading

Project 3

Project 4: Textures

  • Load and render model materials

Project 4 Teapot Project 4 Yoda

Project 5: Render Buffers

  • Render to a texture, then render that texture to a plane
  • Toggle between different texture sampling modes
    • Nearest
    • Bilinear
    • Trilinear
    • Anisotropic

Project 5 Checkerboard Project 5 Yoda

Project 6: Environment Mapping

  • Render an environment (skybox) using a cube texture
  • Render model and plane with perfect, mirror-like material
  • Render model's reflection onto the plane

Project 6 Teapot

X-Project 6: Ray Traced Reflections/Environment Mapping

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

X-Project 6 Ray Traced Teapot

Project 7: Shadow Mapping

  • Render shadows of a model onto itself and a plane below it
  • Use a Shadow Map (Depth texture)

Project 7 Yoda

X-Project 7: Ray Traced Shadows

Alternate implementation of Project 7 using Ray Tracing.

  • Render shadows of a model onto itself and a plane below it
  • Use a Ray Tracing

X-Project 7 Yoda

Project 8: Tesselation

  • Normal Mapping
  • Displacement Mapping with Tesselation Shaders

Project 8

X-Project: Ray Tracing

X-RT Yoda

Implementation

Hold on to your butts....

I'm trying to learn new stuff on top of new stuff.

Common Project Architecture

TODO: Document metal-types/metal-build crates and how data structures are shared between Metal and Rust

TODO: Document how metal-build provides build.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.

Performance

See performance.md for more in-depth documentation on workflows and tooling for assessing performance.

About

Interactive Computer Graphics CS 5610/6610 with Rust and Metal


Languages

Language:Rust 88.7%Language:Metal 7.7%Language:C 1.6%Language:C++ 1.4%Language:Shell 0.6%