Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Other Portals with only one camera?

Discussion in 'Scripting' started by Meaningless-Trinket, Jun 12, 2023.

  1. Meaningless-Trinket

    Meaningless-Trinket

    Joined:
    Apr 25, 2020
    Posts:
    77
    I have some idea how it's possible to do teleporting portals with only one camera.

    The level is sector based.

    You have two sectors that are invisible and both behind portal plane object and with one portal you copy the other sector and put it's transform behind the portal and other rooms are copied.

    When you enter the invisible sector behind the portal you are teleported to the real one.

    I think I can use portal planes for clipping geometry or a scan line renderer.

    I'm thinking about visibility portals and teleporting portals.
     
  2. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,378
    But why do it that way?

    That method sounds super limiting on where portals can be placed, requires duplicating large numbers of objects, and more. All for what reason though? To avoid having another camera? Why would that matter?
     
    Bunny83 and Kurt-Dekker like this.
  3. Bunny83

    Bunny83

    Joined:
    Oct 18, 2010
    Posts:
    3,495
    Exactly. A second camera simply renders the scene again from a different perspective. Thanks to frustum culling, objects outside the view frustum won't be rendered anyways. I can highly recommend this talk by the valve employee Dave Kircher. He does all the technical parts in that talk.