Update [Wed 6th Sep, 2023 13:00 BST]: It's been over a year since we last checked in on James Lambert's impressive Portal demake Portal 64 and a lot has changed in that time (which we felt was worth highlighting).
The demake now has a main menu/pause menu (with saving & loading options), the ability to customize the control scheme to use two N64 controllers, security cameras, and vertex lighting. Chell has also been implemented too, along with a bunch more test chambers to play through.
If you fancy giving the latest build a try, you can grab it now from Lambert's GitHub as a patch. Though, bear in mind, you'll need access to a copy of the original Portal on PC in order to run it. This is a measure that the developer has taken to hopefully prevent the project from being DMCA'd by Valve in the future.
It's an incredible project and one that will likely have you wondering how it is at all possible that the developer has managed to replicate the game's Portal mechanic on hardware released 11 years prior to Portal's launch. Well, in his most recent video, Lambert finally spilled the beans on how he managed to pull it off, breaking down the process in fairly in-depth detail.
According to his explanation, the effect that he has achieved uses the same technique that is behind rendering split-screen in multiplayer games, except that here the two screens overlap as opposed to being positioned one on top of the other. He explains that this can create some issues with objects from the two views leaking into one another, but luckily he has come up with a workaround. As he goes on to say, he uses the Z-Buffer (a chunk of memory that keeps track of how far away pixels are from the camera) to prevent distant items from being drawn over those that are meant to be closer, doing this by rendering the portal view in the second half of the buffer range. Then from here, he creates a hole in the wall and places a transparent overlay over the top of it, to prevent objects behind the wall from rendering over the top of the portal view.
You can watch the full video below to see how this works in practice and also to see a short explanation of how Lambert has recreated the emancipation grid from the end of the companion cube levels. So far, the demake looks incredibly impressive, with this latest explanation doing nothing to blunt our amazement of what Lambert has been able to achieve.