: The portal rendering and level building is separate.
: The level converter isn't ready, but the new level format and portal
: rendering is ready.
: https://github.com/huriettic/portalrenderingexperimental
I can explain how the experimental portal rendering works.
Start() and Awake() run one time and Update() runs every frame.
Load() loads the text file containing the level information.
There are three class objects.
Polyhedron contains indexes to a list of Faces.
Polyhedron has planes indexes to check if the player is inside it.
Polyhedron has portals indexes to know which face is a portal.
Polyhedron has render indexes to know what faceMesh to render.
Polyhedron has Collision indexes to know what faceMesh to collide with the player.
Face contain vertices and ints to Plane, portals, rendering and collision.
Face has a int to FaceMesh list.
FaceMesh contain triangles and vector2 UVs for textures.
There is a list of level meshes that match FaceMesh list and a list of level objects from GetlLists().
CreatePolygonPlane() makes a list of mathematical planes that match the list of face objects.
A mathematical plane is made with three vertices going in clockwise order.
Playerstart() gets the player starts and sets the current polyhedron the player is in.
Controller() moves the player and camera.
GetPolyhedrons() checks for the polyhedron the player is in and gathers the polyhedrons the player is in contact with then it does collision.
ReadFrustumPlanes() puts the mathematical planes in the main camera before the GetPortals() function.
GetPortals() has a for loop that renders level mesh objects and gets portals to go to the next polyhedron to render.