No announcement yet.

Limit range of global Post Processing material?

  • Filter
  • Time
  • Show
Clear All
new posts

    Limit range of global Post Processing material?

    In our game, I am applying a global post processing material to the player camera (which is first person) that acts sort of like night vision would. As it stands now, this post process completely brightens the view of the player so that anything that isn't obstructed by some mesh is now lit and visible to them. If something is already well lit, the post processing is super bright and "whites out" the player view (just like you would expect with night vision). After some play testing, we realized that this isn't quite what we want. We need to limit the range of this post process so that it only effects a limited range in front of the player.

    I'm assuming you are familiar or at least have heard of the game Outlast. Just in case you haven't, here is a video (I apologized ahead of time for linking to a Markaplier video):

    At about 12:10 in that video, you can see a great example of the sort of effect I am looking for. He enters a room with his night vision camera applied and he can see directly in front of him but after a certain point, his view is just darkness (with far off lights visible). At about 12:26, he walks around with his night vision camera on and displays the effect beautifully.

    In my post process material, I have attempted to play around with pixel depth and scene depth (essentially lerping those values with a black color constant based on some arbitrary number as the "range"). I know this wouldn't be exactly what I wanted (as it would make all of the view beyond a certain point completely black with no regard to lighting), but I figured it was a start. Those things didn't work and it seemed like no matter what I did, the entire view of the player was just completely black. Do those depth values not work since I am applying a global post process rather than some material on a given object in the world?

    Just to be clear, I am not talking about a vignette effect. Also, I tried messing with the blend radius values on my PP volume but with no success. Do you have any tips on how to get that Oulast-like effect? I feel like there is something easy I may be missing here.

    Any advice? Thank you in advance!

    I think you might be over-complicated things a bit trying to design this into a post effect. It looks like they just used a spotlight that is activated with the night vision to provide a little extra short-range light, and then apply the night vision effect. Enough to white-out bright lights but not too much that it whites out objects only illuminated by your spot light.

    Night vision cameras typically have a little IR light on them (visible to the camera but invisible to people) so there is a justification for that kind of effect. The video clip you showed looks like the NV device is a handheld camcorder so I'd expect to see that kind of IR illumination.

    Doing it properly in a post-process is basically just rendering the spot light yourself (based on depth, view angle, surface normal, etc.) which is exactly what the engine is doing with its regular deferred rendering. So I would just let the engine handle it.


      I was actually thinking about the sort of flashlight implementation of this last night. I have not gotten a chance to try it out, but I will attempt to do something like that tonight (simple spotlight on my character with a green tint post process material). Thanks for the input!

      If anyone else has any other ideas, keep them coming.