Welcome to S4DGE, a Unity extension for rendering of 4D objects and spaces in your games, written in C# and HLSL. It was developed by a group of Software Engineering students at the University of Waterloo as a capstone project.
AUTHORED BY: https://github.com/royi-luo https://github.com/sunny-lan https://github.com/lukeKlassen https://github.com/boonboonsiri https://github.com/RichardYSun
The S4DGE system includes two renderers for 4D Game Objects for comparing and verifying rendered results, though both renders have unique advantages. In general, the Rasterizer will be more performant and combatible with existing projects.
To set up 4D rendering in a unity scene, an additional Camera 4D
should be added to the active camera, with either the Raycast 4D
or Rasterize Camera
script depending on which renderer you will be using. Note that every 4D related object (including lights and the camera) will have a Transform 4D
script which will override their 3D transform
. Check out the demo scenes for the renderer type for examples on how this works, or the Sample Game folder for examples on scripting with S4DGE.
The shape of 4D Game Object is based (usually) on a Tet Mesh Renderer 4D
script with an appropriate tetrahedral mesh file. Similar to a triangle mesh in 3D, a tetrahedral mesh can be used to fully describe 4D objects. Tetrahedral meshes for some regular 4D polytopes are available in the project, along with some more unique parametric shapes.
The raytracing renderer bounces light through the entire scene to determine reflections and shadows. It can naturally determine shadows and reflections as a result.
The rasterizing renderer transforms the mesh into a 3D and then 2D image on screen. It requires extra work behind the scenes for shadows and lighting, but can more efficiently render the image.