Shaders - Portals
A showcase of shader effects to replicate portals in videogames.
This project is all about portals. Stepping outside of pure shader work and into the world of C# scripting, this series goes a lot more in-depth with the link between scripting and shaders than my previous work, highlighting the importance of making both sides work together.
This project goes in-depth with: cubemaps, stencil buffers, oblique near-plane projection, linear algebra and local/world space transformations, screenspace texture sampling, raycasting, rigidbodies and collision.
This project includes shaders for:
- A Spyro-style portal effect including a cubemap-based rendering of the world on the other side of the portal;
- A Manifold Garden-style placeable portal that renders a non-recursive view through the other portal in realtime using the stencil buffer, an oblique projection matrix and smart camera placement;
- A Portal-style portal that builds on the previous version, adding recursion and using screenspace texture sampling instead of the stencil buffer.
This project was created using Unity 2019.2.0f1. It should work on other versions of Unity, although the project may need upgrading or downgrading.
This project, and the corresponding tutorial series, were written by Daniel Ilett.
This project uses the following assets:
- “Skybox Volume 2 (Nebula)” by Hedgehog Team, Unity Asset Store
- “Robot Sphere” by Razgrizzz Demon, Unity Asset Store
- “Low Poly Hand Painted Dungeon Arch” by BitGem, Sketchfab
The series was announced on December 1st on danielilett.com. The series will be developed and articles made public throughout December 2019.
Thank you for following my tutorials.