Shaders Portal by daniel-ilett - 2

Shaders & Effects

A showcase of shader effects to replicate portals in different games.

Unity 2019.2.0f1MIT LicenseUpdated 74 days agoCreated on May 11th, 2019
Go to source

Shaders - Portals

A showcase of shader effects to replicate portals in videogames.

Portals Banner


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.

Buy Me a Coffee at

Shaders Included

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:


The series was announced on December 1st on The series will be developed and articles made public throughout December 2019.

Thank you for following my tutorials.

Show all projects by daniel-ilett