Jump to content
  • Advertisement
Sign in to follow this  

Valve Portals: How its made?

This topic is 3576 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, I ve just started the Valve Portal game and I found it really interesting. I m curious to know how they do the portals mechanism (in Portal or Prey). Any theories would be nice to hear! thx

Share this post


Link to post
Share on other sites
Advertisement
The game logic techniques behind the portals were already available back in Unreal Tournament (or even Unreal, though I can't remember). For rendering, although this is not necessarily how they would do it in Valve, I suspect this is the correct solution: the elementary rendering principle is that once the two portals exist, you render what is next to the player, then you render the portal opening to the stencil buffer, then you render what's outside the other portal (using the transform that maps one portal on top of the other in additional to the correct world transform) to the pixels where the stencil buffer was set, and add some chrome to the opening so that it looks technological-ish. Of course, if the portals can see each other (or if you can see the two openings at once) you can recurse for the rendering until no more portals are visible or a recursion limit is hit.

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
The game logic techniques behind the portals were already available back in Unreal Tournament (or even Unreal, though I can't remember).

The original Unreal had portal rendering. It even had a few "impossible portals" (ie. position warping ones like in Portal) in it's deathmatch levels.

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
For rendering, although this is not necessarily how they would do it in Valve, I suspect this is the correct solution: the elementary rendering principle is that once the two portals exist, you render what is next to the player, then you render the portal opening to the stencil buffer, then you render what's outside the other portal (using the transform that maps one portal on top of the other in additional to the correct world transform) to the pixels where the stencil buffer was set, and add some chrome to the opening so that it looks technological-ish.


Yes this is pretty much exactly how they do it, at least based on what they mention in the developer commentary.

Share this post


Link to post
Share on other sites
Quote:
the elementary rendering principle is that once the two portals exist, you render what is next to the player, then you render the portal opening to the stencil buffer, then you render what's outside the other portal (using the transform that maps one portal on top of the other in additional to the correct world transform) to the pixels where the stencil buffer was set, and add some chrome to the opening so that it looks technological-ish. Of course, if the portals can see each other (or if you can see the two openings at once) you can recurse for the rendering until no more portals are visible or a recursion limit is hit.


It does make sense but it seems to have more to it… at least, we have two technological concepts here, teleportation of an object from one place to another and having a viewing window to one place from another… in my opinion, what’s makes the union of those concepts so amazing is that it feels like going through walls instead of jumping from one place to another… so logically, in our case, we’re in both sides of the portals at some point… so the cloning concept has to be involve.

Share this post


Link to post
Share on other sites
Quote:
Original post by golgoth13
It does make sense but it seems to have more to it… at least, we have two technological concepts here, teleportation of an object from one place to another and having a viewing window to one place from another… in my opinion, what’s makes the union of those concepts so amazing is that it feels like going through walls instead of jumping from one place to another… so logically, in our case, we’re in both sides of the portals at some point… so the cloning concept has to be involve.


No cloning—you only exist in one place at a time. However, the topology of the game world is not our usual euclidean topology.

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
No cloning—you only exist in one place at a time. However, the topology of the game world is not our usual euclidean topology.


AFAIK this isn't correct, for the companion cubes/etc they needed to duplicate the physics so that when holding the cube in the portal it collides with objects on either side of it..

Share this post


Link to post
Share on other sites
If you have Portal turn on the Developer Commentary and play through the game. At one point they give a nice explanation about on how the portals work object wise. IIRC they have a physics 'bubble' around the portal which has different rules for objects inside of it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!