User:Lactozilla/Portal

From SRB2 Wiki
Jump to navigation Jump to search

A portal is a non-interactive connection between separate two parts of a map. There are two types of portals: line portals, which are two-way connections between linedefs; and sector portals, which are one-way connections that are applied to the floor or ceiling plane of a sector.

Line portal

Player looking into a series of line portals.

A line portal is created using Linedef type 40. The linedefs must be of equal length and point to sectors of equal floor-to-ceiling height, but they can be at any angle and height relative to each other. The tag of the linedef determines which linedef to link the portal to in the renderer; portal linedefs with the same tag are linked with each other.

Sector portal

Player looking through a sector floor portal.

A sector portal is created using Linedef type 6. They can be displayed on the floor or ceiling plane of a sector, or both. Sector portals are more elaborate, and can be divided into six different categories:

  • Normal view portal: Its setup is similar to a line portal, in which two linedefs that share the same tag must be defined. Unlike a line portal, this is an one-way connection, so the same portal can be seen through different sectors by using the same tag as the original portal.
  • Skybox portal: The sector becomes a portal to the current skybox, if it exists. The skybox is displayed even if F_SKY1 is not being used as a texture on the plane the portal is being viewed through.
  • Horizon portal: The effect is similar to the one of Linedef type 41. The sector's planes extend into the horizon, hence its name.
  • Plane portal: The effect is similar to the one of a horizon portal, but the planes have a fixed distance from the camera. This can be used to create a faux-skybox.
  • Link to sector: This directly makes a portal to the plane opposite of the sector the portal is seen through; if the target sector has the portal applied to its floor, the portal is linked to the viewed sector's ceiling plane, and if the target sector has the portal applied to its ceiling, the portal is linked to the viewed sector's floor plane.
  • Link to Object: When tagged to a Thing, the view seen through the portal is defined by the Object spawned by the Thing.