Vorpal Engine

Vorpal Engine is a videogame engine made by two people, with its focus on graphics programming techniques, while being extremely user-friendly.

The main inspiration for the Vorpal Engine was the following video by CodeParade. Inspired by that demo, I wanted to create a games engine that could support portals as well as implement those portals in VR.

The finished project has both features working (although under some limitations). Here is how they work:

Portal Rendering

Portal Rendering works by rendering the scene from the point of view of the player if they to be placed at the other side of the portal.

This is process that happens each frame to render a scene with portals:

The current recursion level is set to the maximum of bounces allowed between portals.

An occlusion culling query is issued so the portals outside of the main scene view don’t perform useless draw calls.

A framebuffer is filled with the scene drawing taken from the point of view of the camera if it were to be placed at the other side of the portal, and cropped to the size of the portal.

From that scene render, the process is repeated so now every portal visible in the scene rendered in the framebuffer, also renders the scene.

This process runs indefinitely until either there are no portals left to render from in one of the views, or the current recursion level reaches 0 (if there were any portals visible from this last framebuffer, this are draw with a pink texture representing the missing texture).

VR Rendering

The VR rendering pipeline, fundamentally, is based around drawing the scene two times from different slightly offset points of view, with different MVP matrices being used for each of the eyes rendering.

In our case, the following process is followed to render a VR scene:

Main VR view:

A framebuffer is created for each of the eyes.

In each framebuffer, the scene is identically draw but each eye gets its own MVP (model, view, projection) matrix from the eye point of view.

The controller Axis (rays that go from the controllers outwards) are rendered directly on top of each of the textures.

Similarly , the controller models and poses are obtained from .json binding files (located at data/openvr ) which, automatically load all the information using the OpenVR SDK backend.

The framebuffers are submitted to the VR headset as textures created by the VRcompositor, again, using the OpenVR SDK backend.

Companion Window view:

The framebuffers are reused to render each of the eye views, displayed in a split screen manner. This setup replaces the typical rendering of the window. Then ImguiUI is then rendered on top of it.

The complete features of the engine are:

    Graphics techniques

  • Blinn-Phong Lighting
  • Forward rendering
  • Shadow-Mapping
  • Deferred rendering
  • Portals
  • VR implementation
  • Billboards
  • SSAO
  • Blur
  • Quality Of Life

  • ECS
  • Jobs system (Multithreading)
  • Camera (Game mode and play mode decoupled)
  • Resource Manager
  • Pseudoscripting subsystem & Playmode
  • User friendly UI
  • Scene Saving
  • Input abstraction