How were the portals in Portal created? | Bitwise

preview_player
Показать описание
I'm a professional programmer who works on games, web and VR/AR applications. With my videos I like to share the wonderful world of programming with everyone!

How did valve create their iconic portals? In this video I demonstrate my process of recreating the portals in Portal.

Music in in outro:
Рекомендации по теме
Комментарии
Автор

Wow, what happened? Two years after I stopped posting the youtube algorithm comes along and now this! :D
I guess it's time to start making videos again! Thank you all for the kind comments!

Since 2017, this channel has since been sort of an abandoned project of mine. I can't lie.... that really makes me want to make new content.

DigiDigger
Автор

3:49 "What is distance?"
*Vsauce music plays*

JustRyann
Автор

"Speedy thing goes in, speedy thing comes out."

ErdrickHero
Автор

This is the tutorial I like to see because there is no code in it. It just explain the concept. This is very useful to auto check your method, and lets us thinking about code alone without been affected and atracted by what the guy in the video did in his code. Easy, great looking video !

baboucheone
Автор

jeez, what a great video. never thought i could wrap my head around this, but you explained it perfectly. bravo!

babylonian
Автор

Portal was way ahead of its time, the portals really looked convincing^^

lonelyPorterCH
Автор

You sadly omitted recursive rendering, that is, stuff seen through portals seen through portals seen through portals seen through portals seen through ...

shadamethyst
Автор

Apparently Valve dynamically altered the wall's collision geometry whenever a portal was placed.

Wolfenrahd
Автор

If you listen to the developpers commentary, you learn some other things they did with the portals. If you drop the cube like at 6:44, it takes a lot of stuff to make that work. I think they made a sort of gradient of the effect of both side's gravity...

gigglysamentz
Автор

Me listening to the ending: O ok
DigiDigger: And that cover the basics of portals!
Me:


Edit: just a joke i understood this entire vid and pracically already knew most of it the only thing hard for me is coding and stuff like that

snuvels
Автор

Q: How were the Portals in Portal created.
A: By the portal gun

Q: Who created the portal guns.
A: Aperture science

OrangeUtan
Автор

i also tried this many years ago but i came up with a different solution
instead of rendering the other side of the portal to a texture, i would actually use a stencil buffer to keep track of what part of the frame was portal and what wasn't as well as which portal it was
i would then use a translation matrix to modify the position of everything in the level, set a clipping plane so that nothing that was supposed to be behind the portal would be drawn, and then render the frame again but only in the spots where the stencil buffer indicated there was a portal
the result was a perfectly seamless portal
for the physics, i created a collision object to represent the portal it's self but made it so that if a collision was detected but that point of collision happened within the portal object then it would be treated as if it wasn't a collision at all
and just to make things look nice i used another clipping plane when rendering objects going though portals just so they wouldn't stick out the back

khmnc
Автор

The visual portion does not need to be anywhere near as complicated as proposed. Have the second camera point perpendicular to the plane (or tangent) of the portal and render with an off-center view frustum. This has the exact effect of "projecting" what you should be able to see through the portal onto a planar surface, skipping past all the perspective issues, distance issues, etc. It would also massively simplify recursive portals rendering. This will also be much better for performance as your view frustum will only need to be as big as the portal on your screen, so most of the time the majority of the scene would not even have to be rendered in the portal.

We created this exact same effect many years ago in an intro computer graphics course, albeit in D3D11/OpenGL, but I'm sure Unity supports off-center view frustums as well.

Edit: To make sure I wasn't just speaking out of my ass I just spent an hour replicating the visual effect in Unity. Can't get the camera to natively render off-axis but easily solved by supplying a custom perspective projection matrix. The above method works in Unity.

eclmist
Автор

Interesting, makes sense why there isn’t really any portal rip offs

Sketchy_Dood
Автор

You need Moonrocks to make them work properly

FBI_No.
Автор

In my early days of programming, I really thought the only solution to this was to have 2 identical maps with 2 identical versions of all players and physics objects, one map for each portal. But now I see it's not that bad. Thank you!

mike
Автор

"It's not as easy as you might think"
I was blown away when I first saw it. I think it must be one of the toughest things to program. Honestly, the explanation you gave is actually much easier than what I thought!

RP-dymu
Автор

Like most folks, no idea why this appeared in my recommended but what a FANTASTIC video, thank you!

quepertron
Автор

YouTube is like "Hey this dude didn't upload in 2 years?! Lets give him some love"
YouTubers Daily uploading: 👀

smashenYT
Автор

"teleport from portal 1 to portal 2"
i didnt know this video also covered the basics of time travel

oatmealine