A blog about programming, Rust 🦀, computer graphics and other stuff. I do open source work on GitHub and I try to occasionally answer questions on StackOverflow.
  • Tiled per-triangle soft shadow volumes

    In this post, I want to share a technique for rendering variable penumbra soft shadows in real time by using per-triangle shadow volumes. For each fragment, shadow casting triangles are software-rasterized in shader to determine light occlusion. Culling shadow volumes is done per 16×16 screen tile (similar to “tiled deferred shading”) and uses the mesh clusters of the existing GPU-driven renderer. The resulting shadows are alias-free, work correctly with multiple casters at different distances, and even exhibit interesting real-world artifacts. While I think this is very interesting and promising, it’s still nowhere near production-ready for most games.

    Continue reading
  • Tauri vs Iced vs egui: Rust GUI framework performance comparison (including startup time, input lag, resize tests)

    Recently I found myself in need of doing GUI with Rust, so I researched and experimented a bit. In this post, I want to share the data I collected, as it might help others. I will mostly compare Tauri, Iced and egui as those seem to be popular choices. I spent quite a bit of time performing tests to assess the speed/performance of these libraries, as a snappy UI experience is something I really value.

    Continue reading
  • Generalized Autoref-Based Specialization

    A few weeks ago, dtolnay introduced the idea of autoref-based specialization, which makes it possible to use specialization-like behavior on stable Rust. While this approach has some fundamental limitations, some other limitations of the technique’s initial description can be overcome. This post describes an adopted version of autoref-based specialization – called autoderef-based specialization – which, by introducing two key changes, is more general than the original one and can be used in a wider range of situation.

    Continue reading
  • Rust 2020: Power to the Type System

    This article does not contain any new ideas for #Rust2020, but I still wanted to voice my opinion and support some ideas from other posts. Let’s keep it brief then.

    Continue reading
  • Thoughts on Error Handling in Rust

    A programming language’s solution to error handling significantly influences the robustness, brevity, readability and – to an extent – the runtime performance of your code. Consequently, the error handling story is an important part of PL design. So it should not come as a surprise that the Rust community constantly discusses this topic. Given some recent discussions and the emergence of more and more error handling crates, this article shares some of my thoughts (not solutions!) on this.

    Continue reading
  • Solving the Generalized Streaming Iterator Problem without GATs

    Generic Associated Types (GATs for short) are a long awaited extension to Rust’s type system. They offer a way to work with higher kinded types – a necessity in a couple of situations. A common example is the streaming iterator: an iterator able to return items borrowing from self (the iterator itself). Unfortunately, GATs haven’t even landed in nightly yet. So while we are waiting, we can try tackling the streaming iterator problem without GATs. In this post we explore three possible workarounds for situations where an associated type depends on the lifetime of a &self receiver.

    Continue reading
  • New faces for our lovely bots in #Rust2018

    If you are somewhat active in the Rust community, chances are you have already met Rust’s lovely bots, bors, highfive, and rfcbot. Without these bots, the Rust project couldn’t be developed nearly as quickly or with the same level of confidence as it is now. As a way to acknowledge this and as a #Rust2018 community project, I propose to give them awesome new avatars!

    Continue reading
  • Using the Borrow Checker to make Tic-Tac-Toe safer

    This week’s task of the lecture “Programmieren in Rust” (German) is to build a tic-tac-toe game. After implementing the required features, I tried to use the borrow checker and strong typing to avoid some bugs at compile time – with partial success.

    Continue reading
  • Developing a game with Rust beginners – some thoughts on tools and libraries

    Like last summer, I oversaw a three week programming practical at the University of Osnabrück, Germany – this time focussed on computer graphics. My group created an open-world exploration game called “Plantex”, in which all content is procedurally generated. This means, our game doesn’t need any static assets: the terrain, textures, plants and other objects are generated from a single integer seed. Only one of the 23 students knew Rust before, everyone else learned it during the first few days. In this post, I will share experiences and thoughts from the practical.

    Continue reading
  • Rustfmt and yet another opinion on code style

    In the last few weeks I was extensively using rustfmt in a medium sized project at my university, so I really got to know it. In this post I will describe my impression of the quality of auto-formatting and my experiences with using rustfmt in continuous integration. I will also share some opinions on code style that emerged from working with an auto-formatter.

    Continue reading
  • Building an SQL database with 10 Rust beginners

    This summer I was overseeing a three week university programming practical focussed on the topic of databases. My group’s task was “simple”: build your own SQL database. Considering the complexity of database systems (with SQL parser, network interface and storage engines), one might say that this was already an insane idea. But wait, there’s more! We used the language Rust for every part of the software although none of my team had even heard of the language before. This post describes what happened and what my students think of Rust after working with it for three weeks.

    Continue reading
  • I don't even programming

    Exactly 8 pm. Exactly at 8pm the online sign-up form would be activated, the professor had said. And exactly then his students, including my girlfriend, would be able to sign up for their favourite time slot. This is precisely the level of accuracy you would expect from a German university professor. And this is precisely what did not happen that evening.

    Continue reading