Skip to content
项目

pr0g/unity-portal-rendering

在 GitHub 查看

关于

Super small example of using offscreen render targets to achieve a portal effect in Unity

设计与媒体

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

unity-portal-rendering

Overview

Super small example of using off-screen render targets to achieve a portal effect in Unity.

alt text

Info

Please see this accompanying blog post http://tomhulton.blogspot.co.uk/2015/08/portal-rendering-with-offscreen-render.html for an explanation of the techniques involved.

  • UPDATE (2020/07/22,23): Upgraded Unity project, minor desktop camera improvements, fixed minor bug with Teleport.cs, renamed main branch.
  • UPDATE (2019/01/28): Added touch screen camera controls when running on device.
  • UPDATE (2019/01/21): Added teleportation (so moving through a portal will spit you out the other side).

Note: There's an artefact you'll encounter when moving through a portal where the near clip plane of the camera will clip with the portal texture quad. You wouldn't get this if using the portal stencil buffer technique but unfortunately with render buffers there's no clean way around it. The logic can still be applied if you'd like to use it elsewhere.

Controls

Desktop

WASD - Camera forward/backward/strafe
EQ - Camera adjust height
Right Mouse Button + Mouse Move - Look around
C - Cycle between main camera and portal camera views

Device

One Finger, Hold + Move - Look around
One Finger, Double Tap + Hold - Move forward
Two Fingers, Pinch - Move forward/backward
Two Fingers, Pan - Move up/down/left/right (Camera space)
Three Fingers, Tap - Cycle cameras

Extra

I highly recommend checking out this excellent YouTube video on Portals by Sebastian Lague.

It covers quite a few more details that you might need for a full game and also comes with its own GitHub repo.

The video also kindly gives a shout out to the original article posted along with this repo! 😄

探索相关项目

加载中…