Wednesday, 23 September 2009

Night Vision effect

Implementing the night vision effect is pretty simple.

What we have to do is:
  1. Read current frame buffer content,
  2. Sample a noise texture using time variant texture coordinates (I modify them by adding sin(milliseconds / 1000.0f) to them),
  3. Add both vectors,
  4. Multiply everything with green colour i.e. (0.0f, 1.0f, 0.0f) vector.
I used this simple procedure to achieve this in nGENE (well jpg compression made it look worse than it really does):



2 comments:

  1. Here is a demo based on your idea: Night Vision Demo.

    ReplyDelete
  2. I sample the scene at 1/4 resolution because most NVG sensors are a fairly low resolution. The blurry result helps to enhance the noise.

    ReplyDelete