Portal系列游戏里的传送门是如何实现的



"[David Kircher] 要表现玩家穿过传送门的视野,我们必须使用虚拟摄影机,这台摄影机是从传送门对面拍摄,藉此表现独立的影像。为了取得正确的影像及有效率的处理表现,我们只呈现透过对面传送门的有限视野能看见的景像,排除位于虚拟摄影机及对面传送门平面之间的物品。"
"[David Kircher] When rendering the player's view through a portal, we must render a separate image using a virtual camera which looks out of the opposite portal. To obtain a correct image and efficient rendering performance, we render only what is visible through the limited field of view of the opposite portal and exclude objects which lie between the virtual camera and the plane of the opposite portal."

"[David Kircher] 在开发游戏的前几个月,我们将透过传送门的视野渲染为两种画面外的纹理。这种方法很容易付诸实行,而且和许多绘图硬件兼容。不幸的是,这种方式与反锯齿技术并不兼容,而且必须消耗大量的显存才能处理数个传送门的循环视野。因为这些缺点,我们更换了系统,新系统在样板缓冲区的协助下,能以循环的方式将传送门画面提供给画面暂存缓冲区,分离对应于相关传送门的像素。这套系统更有效,因为它与反锯齿技术兼容,而且不需消耗任何额外的显存即可产生屏画面外纹理。"
"[David Kircher] For the first few months of development, we rendered the views through portals to two offscreen textures. This approach was easy to implement and was compatible with a wide range of graphics hardware. Unfortunately, this method was incompatible with antialiasing and consumed a large amount of video memory in order to handle recursive views through several portals. Because of these disadvantages, we switched to a system which renders portal views recursively into the frame buffer with the aid of the stencil buffer to isolate pixels corresponding to a given portal. This is a more effective scheme because it is compatible with antialiasing and does not consume any additional video memory for offscreen textures."


"[David Kircher] 这是一个绝佳的地点,可以欣赏一下传送门的循环本质。如果你将传送门放在这个走廊的每一侧,你会发现传送门似乎永无止尽,有点像是在全部都是镜子的大厅一样。事实上,在任何串连的传送门中,我们最多支持九种循环的传送门视野。我们在循环中,在最后的传送门上复制之前出现的画面,达成无限循环的效果。当然这样并不完美,但是这样的效果经济又实惠。"
"[David Kircher] This is a great spot to appreciate the recursive nature of portals. If you place a portal on each side of this hallway, you'll notice the portals seem to go on forever, similar to the effect you get in a hall of mirrors. In actuality, we support a maximum of nine recursive portal views down any chain of portals. We achieve the impression of infinite recursion by copying part of the previously rendered frame onto the final portal in the recursive chain. It's not absolutely perfect, but it's inexpensive and effective."

这个链接内详细描述了绘制和物理力互递的过程。
posted @ 2016-01-09 04:30  小黑萌刀  阅读(617)  评论(1编辑  收藏  举报