Projects


Some of my personal programming projects.

Source code can be found on GitHub or Bitbucket.


PlayStation 2 Homebrew

Reverse engineering and retro-programming are two areas of interest, so in early 2015 I did some experimenting with homebrew development for the PlayStation 2 Console, using only the freely available tools and software provided by the PS2 DEV community. One of the outcomes of this project was the demo that you can see in the images above, which I call “The Dungeon Game”. It is a third-person action game, inspired by classics like Diablo and Dungeon Siege.

Gameplay recorded from the PCSX2 Emulator:


Debug Draw Library

Debug Draw is an immediate-mode-ish, renderer agnostic, lightweight debug drawing API for C++. It is a single source file Public Domain library that provides simple and fast lines, points and text drawing for visual debugging of 3D scenes and games. Its main goal is to be as easy as possible to integrate with your own code, so it consist of a single header file that can also act as the implementation (when a given preprocessor macro is defined), so you should be able to just drop the file into your project’s directory, #include it and be done. Integrating with the renderer of your choice should also be easy, all you have to do is implement a small interface class and give the library a pointer to your implementation. The library is designed around a procedural style similar to the old fixed-function OpenGL, but it batches draw calls under the hood for better performance. Memory footprint is also small and configurable by the user code.


NTB - Minimal debug GUI

A small experiment on writing a simple debug UI for graphics applications. Initially the goal was to write a portable and renderer agnostic replacement for AntTweakBar.

This was before ImGui and “immediate mode UIs” became sort of an industry standard, so this project is now obsolete. It was implemented using a statefull widget tree which is not very friendly to debug and extend. The front-end is quite simple and only exposes windows, panels and variables.


Moon Lang - Custom scripting language

Moon is a custom scripting language that borrows some of its syntax from Lua and Rust. It supports functions, structures, enums, ranges, arrays, imports, and all that good stuff you’d expect. It is also much more strongly-typed than Lua, but not as much as Rust. The C++ interface is also meant to be simple and easy to use. The Virtual Machine is stack-based and uses a tiny set of bytecode instructions.

I started this project just to learn how to use Flex and Bison to write a simple compiler font-end, but I ended up taking it to a nearly production-grade stage. The language is fairly complete and usable, but it lacks some basic support libraries.

The name Moon is just a play on the meaning of Lua (Moon in Portuguese). I chose the name on purpose to make it clear this is a lame rip-off on the syntax of the popular scripting language, even though in the end it turned out into a Lua/Rust hybrid syntax.


WebGL Lightsaber and WebGL demos

To celebrate the announcement of a new Star Wars movie (Episode VII - The Force Awakens), I wrote a browser based WebGL Lightsaber app. It features the iconic Lightsaber sounds and mouse/touch interaction. Other technical bits: glow effect for the laser blade (AKA Light Bloom), trail rendering with Polyboards, anisotropic shading for the handle (brushed metal shader) and screen space anti-aliasing using FXAA. The project also includes a tiny WebGL rendering framework and a couple other demos.


Space Sim Game

Project from my Game Development degree in Brazil. My inspiration here was in games like Freelancer and Wing Commander. It is playable on PC and Mac, using keyboard/mouse or an Xbox controller. It supports multiplayer in split-screen mode with another local player. Initially I had intended to also support online multiplayer, but I never got around finishing the net code before submitting the project. This game was written mostly in C++, with a few bits of C and Lua as well.

It uses Core OpenGL 3+ for rendering. The space backgrounds and planets you can see in the images above are just cubemaps, not actual geometry. The asteroids and props are actual 3D models. Never got around implementing sound either, so playing it is a silent, self-reflection experience.


Oldschool Space Shooter Game

Abbreviated OSSG, this is a side scrolling space shooter game for iOS. It was made for a class assignment in my Game Development degree in Brazil. It uses the Objective-C version of the Cocos2D library, plus some raw OpenGL-ES for the 3D elements. The in-game background scene is animated with planets and randomly spawned asteroids. The main game itself is comprised of 2D sprites drawn as overlays on top of the 3D background. This game was my first experience with iOS dev and Objective-C programming. Short gameplay video here.


Virtual Texturing on iOS with OpenGL-ES

Project from my Game Development degree. I implemented a “traditional” Virtual Texturing (VT) system on OpenGL-ES for the iOS/Apple platform. Virtual Texturing, or “MegaTextures” as it was popularized by John Carmack when still working at idSoftware, is an advanced texture atlasing technique that implements a texture streaming setup analogous to Virtual Memory, thus allowing for very large texture data sets, in the tens of Gigabytes range.

Virtual Texturing is an interesting approach to the management and use of large texture databases for real-time applications, however, it is also very hard to get it right and working fast enough to be shippable, so it is only really worth the trouble for games and applications that need to render a lot of hi-res texture data. I can see some use for it on mobile platforms though. Mobile devices still have limited main memory but fair amounts of fast offline storage, plus fast Internet connections to allow for on-the-fly downloading of textures.

Here’s a short video captured on the iOS Simulator. It runs at a very low frame-rate on the Simulator, but seeing it in action gives a better idea of how the system works.


Simple 3D scene editor

This one was an assignment of a Graphics Programming unit I took in the one year Study Abroad scholarship I participated during 2012/13. The goal was to create a simple GUI editor that allows the user to place and perform simple edits in 3D models loaded from file. The program also saves the work and allows loading preexistent scene files to enable incremental edits by the user. The User Interface was built using Qt and QtCreator. It also uses the ASSIMP model loading library to provide support for a large number of 3D model file formats. One of the perks of using Qt was being able to deploy the application on Mac, Windows and Linux.


First Person Shooter Game and framework

Project done around the third semester of my Game Development degree, circa 2011. The assignment was to apply a set of common OOP design patterns to any piece of software you wrote. So I decided to code a tiny framework for first person games to use as test case for the design patterns. The game itself was quite crude, just basically a level where you could move around in first person and shoot at monsters. The framework did feature a couple cool things such as loading and rendering of animated DOOM3 MD5 models (this before DOOM3 went Open Source, if I’m not mistaken), procedural terrain generation and some cheesy fire and flame effects done with billboards and a Fragment Shader. In implementing the first person camera was when I found out about the depth hack trick that is used by all FPS games to avoid the weapon model from poking into scene geometry. This was originally developed around the Visual Studio 2008 IDE with a rather Windows-centric programming style, C++98, fixed function OpenGL and lots of raw pointers.


adf2mp3 Command-line tool for GTA Vice City

Grand Theft Auto - Vice City might not be the most well known GTA episode but it certainly has the best sound tracks and radio stations in the whole franchise, IMO. A while back I did some sniffing around in the game assets and found out that it was quite easy to extract the radio station tracks from the game, so that they could be played on an external media player. Then I wrote a command-line tool to perform the conversion from proprietary ADF format to universally playable MP3. Here’s a blog post with more info about it.


Miscellaneous

Besides what’s listed above I also have several other older and less interesting projects that are not worth mentioning here in full. Most were class assignments from different units and disciplines of my Games course, such as a simple RayTracer or a network tic-tac-toe game. The ones I have kept because they had some interesting code fragments or solved interesting problems are now available on my Bitbucket page.


This Website

Jekyll was the main tool used to build this site, but there’s also jQuery, Bootstrap, Rouge for code syntax highlighting (previously I was using Highlight.js) and some plain-old HTML and CSS (SASS actually).

Site proudly hosted by GitHub Pages.