Extra texture channel and Post Process materials for VR

Hey guys.

Im trying implement realistic NVG.
If there any ideas how to implement it easier I will be glad to hear.

What already done:

  • NVG works only in the monocular area without affecting peripheral vision, just like real NVG tubes in front of eye.
  • Red turns white as the wave is close to infra-red
  • Anything closer than a meter has a strong defocus

What I want to add:

  • Modularity, the ability to choose a monocular or binocular glasses (if implement through the post process)
  • Fake infrared spectrum, for realistic IR illumination, weapon red dot sights, lasers and IR reflective materials.
  • Bloom for bright sources
  • Optimization -_- especially for blur. (spiral blur based on depth map)

I made two versions, as a post process material and as surface material.

Cons of the post process material: the material is duplicated in both eyes, I can’t make a monocular system where the effect will work in one eye.
Pros: all translucent sprites will work correctly since im using scene texture.

Cons of the surface plane in front of the camera: jitters when FPS dropping and issue with displaying decals behind a nvg plane.
Pros: you can choose on which eye you want nvg effect.

Generally there are a couple of questions.

  1. Is it possible to regulate the post process for each eye separately for VR?
  2. How can you cheaply implement bloom in a material?
  3. is it possible to make a new channel for materials? For example, if Id like to make effect of a thermal image or make realistic infrared range, it will be impossible without additional texture channel of heat emission.

Hi, for your 1st question, the answer is yes, with limitations though. I used to make a binocular microscope in VR, and display a different PostProcess mask to give the illusion of “tunnel vision”.
Define the effect/mask for each eye, and use a Custom Material Expression as alpha into a Lerp as defined :

return ResolvedView.StereoPassIndex;