utupub.fi
Type-safe(r) model of geometry in 3D graphics
This thesis investigates the use of type-level techniques for reducing programming errors in 3D graphics programming, in particular as relates to the representation of geometry and coordinate transformations. Existing theoretical and practical work...
The thesis provides background on 3D graphics, type systems, and Rust, and reviews related literature and practical work. As its primary contribution it presents a case study of the geometry API of my software renderer library, Retrofire, which is more strongly typed than almost all similar APIs while striving for good developer experience and minimal time or space overhead.
Abstract:
This thesis investigates the use of type-level techniques for reducing programming errors in 3D graphics programming, in particular as relates to the representation of geometry and coordinate transformations. Existing theoretical and practical work on the subject is fairly scarce, and a review of several popular 3D programming APIs reveals that none attempt to alleviate or prevent such errors either at runtime or compile time.
A case study of Retrofire, a software 3D rendering library written in the Rust programming language, is presented. Retrofire employs generic types (parametric polymorphism), traits (type classes), and tag (phantom) types to rule out many of the identified programming errors at compile time, with a goal of minimal or zero impact on runtime performance.
The library is evaluated from the viewpoints of performance and developer experience. The conclusion is that the API is useful and helps prevent bugs in real-world programming, but more experience in writing complex applications with Retrofire is required for deeper understanding of its ergonomics. The library also appears to attain its goal of minimal performance overhead compared to a more conventional API; questions requiring further study include optimal memory management and use of SIMD vector operations.
11 posts - 4 participants
Read full topic
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Maplike - Crate with traits for abstract containers and operations on them | 2 | 7 | 06-07-2026 |
| 2 | [Project Announcement] tinyxml2-rs: A high-performance, drop-in Rust implementation of TinyXML2 | 5 | 7 | 01-07-2026 |
| 3 | Looking for contributors: Rust transparent proxy & protocol parsing project | 5 | 7 | 08-07-2026 |
| 4 | LiberSystem - the new OS written in Rust | 0 | 5 | 07-07-2026 |
| 5 | Mqtt-typed-client 0.2: a type-safe async MQTT client on top of rumqttc | 5 | 7 | 08-07-2026 |
| 6 | CPUX - retained-mode GUI framework | 0 | 5 | 01-07-2026 |
| 7 | Chainything : A DAG-based pipeline execution engine & visual UI (with AI generation) | 2 | 7 | 29-06-2026 |
| 8 | Multicalc 0.6.0: a no_std multivariable calculus library now looking for contributors | 5 | 7 | 28-06-2026 |
| 9 | Announcing logisheets-rs: a Rust spreadsheet engine with XLSX support | 7 | 8 | 07-07-2026 |
| 10 | Test That! 0.5: A powerful test assertion library for Rust | 5 | 7 | 28-06-2026 |