Mara's Portfolio
About Me
Hi, my name is Mara and I am primarily a C++ developer with experience in games and embedded systems. I feel most at home doing deep dives into debugging problems and anything where I can have a metric to optimize (frame time, compile time, export time, etc.). I put out fires wherever and whenever they come up and try to help my team be productive by improving the tools they work with. Graphics are a particular fondness of mine, as evidenced by many pretty pictures below. I am comfortable with D3D11 and HLSL, familiar with many graphics concepts and techniques at a high level and have a general idea of how D3D12 works and regularly help out people in the DirectX Discord.
Languages | German (Native/C2), English (C1) |
---|---|
Programming Languages | C, C++, HLSL, x86 assembly (SSE/AVX), C#, Java |
APIs | Direct3D 11, Win32, Direct3D 12, CUDA |
Software | Visual Studio, Git, Optick, RenderDoc, Nsight, PIX |
HLSL Constant Buffer Packing Rules & Layout Visualizer (2024)
I wrote an article about HLSL constant buffer packing rules, which also includes a custom HLSL parser and visualizer so users can check the memory layout of their own structures. The rules for constant buffers are fairly unusual and often confusing because they do not only rely on type alignment and effectively allow other variables into preceding padding in some cases. Most explanations I could find were extremely hand-wavy about those rules, so I decided to make this the one true source for HLSL memory layouts. The entire site was written from scratch (just like this page) except for the code editor (Monaco) and a string compression library.
W3D Hub - Game Engine Programmer (Volunteer Team, 2018-2024)
W3D Hub is a non-profit team of volunteers developing standalone games based on reverse engineering the engine of Command & Conquer: Renegade. All games are 3D online multiplayer first-person shooters including vehicle gameplay. At this point the code base weighs over 600 thousand lines of C++ code and has over 20 years of history. As a volunteer team, people come and go and take breaks, so the number of active developers varies around 10-15 at any given point in time, with about half of those being programmers.
I worked on enhancing core systems across the entire engine, including rendering (D3D11), networking and physics and also the associated tools like the level editor, asset cooking tool (C#) and a 3ds Max plug-in. I also supported other developers, designers and artists with in-game design and debug tools, advice on performance-optimizing assets as well as how to use Git safely and effectively. Goals and requirements for new features and improvements were discussed as a team and I helped research trade-offs of various solutions.
Most of the code was poorly understood and undocumented, so I used my deep analysis skills to establish why it was originally written in the specific way it was and what changes could be made to it regarding either new features or bugfixes. Sometimes the code was freshly reverse-engineered and without variable names. My goal is always to leave the code in a better state than I find it, so I frequently added code comments to explain the "why" of the design or note other important information to prevent future bugs. Debugging complex issues was my specialty, often including unreproducible crashes from user-provided crash dumps. I employed several external tools to help improve the engine, including static code analysis, Address Sanitizer (once it was released for MSVC) and integrating profiling tools (Optick, VTune, plus custom in-game profiler). Introducing multi-threading was a challenge due to the original code not taking threads into consideration at all, so every function in the entire call graph had to be vetted for e.g. static variables or other non-thread-safe constructs.
I ported the engine and tools to 64-bit and fixed an innumerous amount of crashes, memory leaks and possible buffer overflows. I contributed to the implementation of clustered forward lighting and instancing into the aging renderer and introduced data compression into our asset pipeline. I optimized not just parts of the player-facing engine, but also made several artist workflows significantly faster, e.g. static light baking, asset export from 3ds Max, pathfind data generation and enabling modifying gameplay parameters directly in-game. Occasionally I would dip into gameplay code, e.g. implementing the mouse-based control scheme for CTOL aircraft via a PID controller and new logic for spell-like "weapons" that shoot immediately when selected and have cooldowns. I also improved C++ project build times by 50-100% (wall clock time, CPU time in the compiler was improved up to 220%) through removing unneeded includes, moving inline function declarations to cpp files and forward declaration (cautiously using the PImpl pattern in some cases).
[REDACTED] Robotics Lab - Student Research Assistant (2016-2018)
The first project at the robotics lab was a motor control application in C for brushless DC motors utilizing the real-time operating system PXROS-HR on the Infineon Aurix TriCore platform with cooperative multi-threading. My task was to figure out how to coordinate the various hardware timer modules in a way that resulted in specific PWM patterns on the physical pins connected to the motors, while also triggering ADC measurements from the motors and an interrupt service routine on the CPU cores computing the PWM duty cycles for the next period from those measurements, all in sync with sub-microsecond precision. After the implementation, I documented my approach and the various characteristics and features of the hardware used so that others could expand on it, the above pictures are part of that documentation.
Later on I would work with a fellow student on an autonomous mobile robot (pictured above) including both the embedded motor control side and higher level tasks running on Linux on a Raspberry Pi, using the ROS (Robot Operating System) C++ framework. This involved merging the images of multiple 2D LiDAR scanners to map the surrounding area, combining odometry data from three separate wheel motors with an inertial measurement unit and the map to estimate the current position, velocity and orientation and coordinating the motors to drive towards a goal position and orientation in the most efficient way. The three wheels could each rotate around their own axis separately, which made reconstructing linear and angular velocity for whole-robot odometry challenging. Since direct analytic solutions for inverse kinematics tend to only work for one or two specific movement patterns like turning in place, moving linearly or a circular curve and our particular wheel setup was not commonly found in literature, I devised a least-squares fit algorithm where based on the input speed and angle of each motor, it tries to iteratively find a linear and angular velocity that would result in those input values.
The topic of my (unfinished) thesis project was making the robot find specific patterns in its LiDAR data to detect charging stations and/or other robots of the same type and autonomously approaching them for docking. The patterns were realized using retro-reflectors since the laser scanner not only records distance but also reflection intensity. I performed a series of measurements characterizing the reflection properties of various materials in the scanner image to devise an ideal intensity threshold for detecting retroreflectors and how accurate the distance measurements are. The docking maneuver itself is based on devising an initial target position parallel to the pattern / docking station and subsequently linearly approaching from there with dynamic corrections based on sensor data.
MiniRayTracer - CPU Path Tracer (2016-2018)
A CPU path tracer written in C++ based on the mini-book series Ray Tracing in One Weekend. Enhancements beyond the book contents include vector-style SIMD acceleration, tile-based multi-threading, live preview, triangle meshes, tone mapping, correct transmission/refraction, no dynamic allocations and ordered BVH traversal. I went a bit overboard with OOP here to fit with the original book's design, maybe I'll improve that at some point...
CUDA Mandelbrot Set Explorer - University Project (2017)
A Mandelbrot set visualizer using CUDA and C++, displayed via an OpenGL-based GUI or command line bitmap file output. I used C++ template specialization to generate optimized GPU kernels for each combination of fractal type, coloring variant and floating-point type. This was a university project and received a grade equivalent of 96%.
The supported fractal type are:
Mandelbrot set: | zn+1 = zn2 + c |
Cubed Mandelbrot: | zn+1 = zn3 + c |
Arbitrary exponent: | zn+1 = znx + c |
Burning Ship: | zn+1 = (|Re(zn)| + i|Im(zn)|)2 - c |
The program exposes quite a lot of parameters that can result in very interesting visuals, especially when animated (see below).
Tank Wars - University Game Project in Unity (2016)
As part of my university studies, I formed a team with two fellow students to make a small top-down shooter game in Unity (C#). It is based on a Flash game called Bubble Tanks and features an infinite world of small arenas where the difficulty and number of enemies increases with distance from the starting position. We utilized sparse arrays for generating the world in small chunks, the decorator pattern to dynamically apply modifiers to different base weapons and object pooling to minimize stutters. We were not graded on audiovisual quality and had several other projects due in the same semester, hence the bare-bones graphics in the video above, but the end result was still a 94% grade.
"Insight" Spectator UI for Natural Selection 2 (2012)
A UI modification for Natural Selection 2 written in Lua, enhancing the spectator and broadcast experience of the game. I established how to send detailed game information from the server exclusively to spectator clients and designed the initial UI before teaming up with another programmer and an artist to further enhance the visual design and capabilities. I also briefly worked on a first-person spectator mode that was subsequently made impossible by an engine update. This mod was eventually acquired by Unknown Worlds Entertainment and shipped officially with the full release of the game.
WelcomeBot - University Robotics Project (2016)
As a team of 6 people, we were assigned a project at the university robotics lab to automatically adjust a tablet mounted to a robotic arm to an appropriate height and angle towards the person standing in front of the robot, so that they can interact with it comfortably. We used OpenCV to detect a person's face in the camera image from the tablet (in the photo above we just attached a webcam for testing) and a LiDAR scanner attached to the robot determined the distance to the person in front of it. Through a lot of measurements and some basic linear algebra and trigonometry, the height and relative position of the person are calculated in order to rotate the robot and adjust the arm towards the person. The logic for all of this was integrated into the ROS (Robot Operating System) C++ framework running on Linux. This project led to two of us receiving the offer for the aforementioned job as student research assistants and a 98% grade.
RPC Directory Service - University Distributed Systems Project (2018)
In this university project using Java, we created a system where a distributed network of nodes (different computers, applications) can communicate with each other through services (remote procedure calls, RPC) and perform computation or data retrieval. A central registry owns the database of nodes and services available to everyone, where registering a node or service is itself realized as calling a service on the registry, so everything uses the same underlying mechanisms. Data marshaling is configurable per-service and the entire protocol is designed to be versionable and backwards-compatible. The network communication happens directly via basic TCP sockets and can optionally be tunneled through the registry via an internal wrapper service, which can also automatically handle different protocol versions and marshaling on both ends. The team consisted of 6 people and I was responsible for the protocol design and the entire corresponding backend implementation. The final grade was a perfect 100% score.
Offline Renders for W3D Hub (2018)
The team at W3D Hub received new assets for our game Red Alert: A Path Beyond in 2018, some of them for brand new units and gameplay mechanics, so I wanted to celebrate that by making some promotional renders in Blender, some of them reminiscent of cutscenes from the original Red Alert game (MiG cinematic shot, Cruiser cinematic shot). The fire/smoke and water shaders (the latter is pictured above) evolved a lot over the course of making these renders. I had never used Blender or really any 3D software like this before, so for 5 days of work I think these are pretty good results.