As part of my research work using the Microsoft HoloLens, I recently had to find a way to render different imagery to each eye (for example, running a shader with a different texture for geometry depending on whether I was viewing it with the left or right eye).
Initially, I had tried the approach discussed by davidlively in the Unity forums, where we take advantage of the fact that OnPreRender() is called twice every frame when rendering in stereo. In this approach, we keep track of a variable for the active eye (0 for left, 1 for right), and alternate between those values (and update a flag in a shader) on each call of OnPreRender(). However, while this is said to work for the Oculus Rift, the HoloLens is different (some pre-optimization?) and this approach had no effect.
Thanks to huntertank on the HoloLens forum for mentioning an approach that seems to work: in Unity, create two separate Camera objects, and make sure they are placed on separate layers. In the Camera settings in the Inspector, set “Target Eye” to Left for one eye, and Right for the other. Attach a script with an OnPreRender() function to each Camera, and in that OnPreRender() function set the uniform value in your shader to left or right.
The result of this is that I can, for example, render scene geometry in red in one eye and render it in blue in the other eye.