This page is created automatically. Click here to view this shader on Shadertoy.

This is an experiment to create an "AR shader" by implementing the mainVR-function and using the WebCam texture as background. If you view this shader with the Shadertoy iOS app[1], you can walk around and enter the portal.

If you don't have an iOS device (or if you don't have the app installed) you can find a screen capture of the shader in action here:

Common tab: The VR-scene is shaded using analytical area lighting. I have used code of dys129 shader "Analytic Area Light" to implement this technique:

Buffer A: Buffer A keeps track of the camera-position and calculates if the user has entered the portal.

Image tab: A raymarcher is used to render the VR scene.

Source code

You can find (the full source of) Portal - iOS AR on Shadertoy.