Hi everyone, welcome to this week's Devlog.
This week we'd like to try something a little different, and talk about some of the technical details behind one of our more important non-Euclidean mechanics. To show you how the sausage is made, i'm gonna hand this update over to Regolith's lead programmer Conor Calam.
How its made: World Portals
Hi I'm Conor, the lead programmer and technical designer behind Project Regolith. Today I'm going to demonstrate the inner workings of a mechanic we've internally dubbed "World Portals". To give a quick demonstration of what I mean, here's an example that you see in our Trailer from a few weeks ago:
World Portals serve a handful of functions in the game - In some cases as part of puzzles, and in others just as a fun little nod to the events behind Outpost Rhea's destabilization, and in others still as a way for us as developers to play with your heads a little. Another example that everyone may be familiar with by now is the reflected ceiling from our Hydroponics Demo, and it serves as a better point for how World Portals can play into gameplay beyond a single visual trick:
"But how do they work?" I hear you ask. The short answer is: Unity's Render Texture system, a custom screen-space shader, some calculations made in code, and an extra render pass all working in tandem to help build the illusion of a continuous space. The long answer gets a little more complicated. And to start explaining it, I'll have to pull back the curtain a little more. Here's what the Hydroponics ceiling looks like BEFORE any of our lighting, post-processing, or Portal rendering is applied to it:
It all begins with a blank plane. The first step is linking this plane to it's twin at the opposite player's room, then calculating the position of our portal rendering camera relative to the player's position compared to the plane. After that, a snapshot of what that "fake" camera can see is run through a custom screen-space shader, which adjusts what the camera "sees" to better line up with the environment that the portal is linked to. Lastly, the "fake" camera's projection is sent to a Render Texture, where it is then applied to the plane, resulting in the illusion that we see in-game!
Thanks to Conor for that explanation!
We hope this has been an interesting look into one of our most prominent non-Euclidean mechanics and/or you enjoyed a look into the world of game development. Let us know what you think of this style of post for future updates! In a couple of weeks time we'll be back to our regularly scheduled programming, where we talk about our final approach to PAX, Steam Next-Fest, and SXSW Sydney... But until then, take care of yourselves! -Ryan Discord - Twitter - Instagram - LinkedIn - YouTube
Comments