Portal 1

Overlord Engine

The basis for our was engine created by our teachers Thomas Goussaert and Mathieu Dellaere.
  • Animations
  • Ambient Occlusion
  • Font Rendering & Text Rendering
  • Geometry Shaders & Texture Shaders
  • Particles
  • Picking
  • Post-Processing
  • Shadow Mapping
  • Skinning

Portal

To remake portal I had to create a system that allowed me to link portals together, move & render portal cameras correctly and include teleportation.
The engine has 4 different draw loops: 1. The Shadow Draw, 2. The Main Draw, 3. The Portal Draw (everything inside a portal), 4. The Post-Processing Draw.
During the portal draw I redraw my scene from the perspectives of both camera's via render textures, allowing for the illusion of portals. These cameras are positioned and rotated correctly before the draw happens in the Update.

I finished this project in 4 months, 1 of which was working on the game and 3 months on the engine. I worked roughly 10 hours a week on this project.


Progress Shots

My Experiences

Portal 1

Unity: Simple Portals

I started my project with a prototype in Unity. The first thing I did was creating a simple screen that had a camera linked to it. When the player moves, the portal-camera moves in the same way, except relative to it's portal rather than to the player. With this working I made sure that what the portal-camera saw was displayed onto a second screen that worked in the same way.

Portal 2

Unity: Mapped Portals

The next thing I had to was map the camera correctly to the screen, by using a shader. The shader took what the camera saw and cut out the parts outside of the portal, leaving the parts inside of the portal and creating the illusion of a portal.

Portal 3

Unity: Teleporting

The final thing I did in my prototype was implementing teleportation. To do so I teleported (moved) the player to the other portal once it's camera passed the initial portal's screen (by using the dot product between the camera and the portal). After I also made sure that the player was rotated along the forward of the second screen. That way they can succesfully walk out of the portal.

Portal 4

Overlord: Mapped Portals

With our prototype out of the way, it was time for me to translate all of it into the custom Overlord Engine. Since Overlord is not a Visual Engine, this was not an easy task. I started in the same way as my prototype and created two screens with cameras that move in the same way as the player, but relative to their portals.

Portal 5

Overlord: Shooting!

After the camera's were working, I started to work on shooting the portals. To do this I used a simple raycast and some rotation math to make sure the portal followed the normal of the surface it was one. I managed to make this work in no time.

Portal 6

Overlord: Teleporting

My dreaded enemy this project was the teleportation, implementing this into Overlord was quite tough, but with a bunch of math I managed to do it. First I check then if the player crossed the portal (via the dot product). Next I teleport (move) the traveller to the other portal. Finally I rotate the traveller so that it is facing outwards relative to the portal they just travelled to (the portal is behind them).