Hello everyone! Due to popular demand finally I’m releasing project sources of the Unity3D Indie Portal Effect. In two words, the technique is based on using multiple cameras (3 in this case) and then selectively drawing just Z-values of the portal gates in the 1st pass so that they leave opening in the rest of geometry due to Z-test. This is followed by the 2nd and 3rd passes which clear Z-values of the portal gates and allow the scene to be drawn in the openings from 2 other cameras. The order of drawing things is managed by camera ordering and render queues ordering. On top of that there is a script positioning the 2 helper cameras appropriately relative to the portal gates and to the main camera. Walking through the portals is handled separately by the teleportation script. Currently it works only for the player but there’s been some effort to teleport rigid bodies as well. I hope you make some really cool games/demos/etc. with this, I’d like to think, smart technique. It requires no stencil, no render to texture, just plain old shaders and multiple cameras. Pretty neat, huh? I insist you let me know if you create something with this technique!!! I’m very very curious to see it put to good use!!! Giving me some credit also wouldn’t hurt 😉 Enjoy!
Binary (Win32): unity_portal_effect.zip
Project Sources: unity_portal_effect_source.zip