Skip to content

Source code for the Enter The Matrix and Begind the Matrix Videos

Notifications You must be signed in to change notification settings

ogoguel/EnterTheMatrix

Repository files navigation

Behind The Matrix Shader Source Code

Shader code used in boths matrix video

Shader Library

XPARCommon.ginc

Useful functions to be to be reused in shader

  • Depth to Distance
  • Depth to World Position
  • UNITY_EDITOR emulation : when the #define is used, a rendertexture can be used to simulate a depth camera. In that case, the texture contains the depth (and not the distance as it is for a physical camera) but the library does the conversion between the two modes
PortalCommon.ginc

Specific functions to display a portal in the scene

  • PORTALDOOR : outside view
  • PORTALWALL : inside view
  • _Portal : rendered texture of the portal frame

Shaders

Depth Buffer Shader Worlspace Shader Triplanar Shader
Display the depth buffer Display a grid on top of the mesh in the worldspace coordinate Display a triplanar texture on top of the mesh, with portal support

Sample Unity Project

Sample Unity project using the Universal Render Pipeline and ARFoundation. (Using a light version of the Triplanar shader)

TriPlanar Shader

Next:

More shaders & samples to come

References:

About

Source code for the Enter The Matrix and Begind the Matrix Videos

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published