Porting Night Vision PP Effect from UDK

I was looking to port to UE4.
http://luchadordev.com/tutorials/tutorial02-nv.html

I thought it looked better than anything I was able to make, but I’m not sure how the first part translates into UE4, and wanted to pick your brains. Is the PP chains now handled within the PP volumes because obviously some of those settings have changed and I don’t know what the correlate to. Thanks in advance for any help.

Hi Gibdion,

I’ve taken a little bit of time and gone through and setup material and applied it to a post process and gotten generally the same effect. It could be tweaked more to get more refined look but tutorial is still applicable.

You will no longer need the opacity in the material though. With the Material Attributes bar (all the inputs) selected you’ll change its Material Domain from Surface to Post Process.

Once you’ve got the material setup you only need to place your Post Process in the level and under the Misc tab in the details panel make sure to add element then attach your NightVision Material here.

If you have any questions feel free to ask!

Here is the images from my setup:

The quality on is kinda low so if you need any help just let me know. I used all the same setup and parameters that were used in the tutorial one.

Turns out I was completely missing “Scene Texture”, and had replaced it with “Render Target”. No wonder it never worked. Thanks.

I have noticed though, in particular arrangement, there is no light visible when using material. Where as in the UDK example, you would see light sources rendered as bright white lights, whereas is the UE4 version, it doesn’t seem to be affected at all. Light isn’t rendered. Does Scene Texture not pick up lighting? Are there any another nodes that will pick up lighting that I could add together with the DiffuseColor? I tweaked several settings but haven’t found anything that allows it. I’m still going to look into it some more, but only reason I brought up is because in my sample map I have several materials that are just colors and the normal maps define their texture. With lighting ignored in the SceneTexture node, the materials look flat.

But again, thanks a lot for the help and advice already.

I’ve gone back and added a little bit more to get the effect you were talking about. I wouldn’t say it’s perfect but it’s a start. I’m certainly no materials or post processing wizard so if anyone else with a bit more knowledge sees something wrong or wants to add to I hope they do! :wink:

Here is the result I was able to get with the following tweaks:

Here is the tweak I made:
I added some “add” and “Multiply” nodes for some of the different scene texture choices. and for the constant value circled if you adjust it affect the brightness for the scene. Somewhere between 1.1 and 1.5 look pretty decent for test purposes. You would definitely want to refine to get the look you want. :slight_smile:

So here’s the vid for what I’ve updated.
The video seems a little choppy but I think that is just the capture. Really smooth on my end. For reference on the lighting that is baked. The first room with the chair has a default value of 5000, the other two are set to 1000.

Give a shot and post any updates you get. I’d be curious to see how you implement any changes and if you get a more refined version than my thrown together one here. :slight_smile:

Edit:

Adding image for other users who may want to use and toggle it on and off easily. You can set up the following in the Level Blueprint to easily do so.

What does ScreenTexture PostProcessingInput option do? There are 7 of those (0-6) and I can’t find them described anywhere.

is the total thing. My apologies for the squishiness, wanted to get it all in one screenshot.

particular arrangement didn’t actually render the darkness brighter, just the light. Like particular screenshot. Unfortunately, adjusting the brightness constant only increases the brightness of the light, not the whole scene.

Where as, if I were to just plug the DiffuseColor directly into the Desaturation, and ignore the other three SceneTexture nodes I get the visibility in the dark, but the material ignores lighting. I actually had found out when I stripped all the extra stuff away and just used the SceneTexture nodes. I had a light attached to the player that I could toggle on and off, and with the DiffuseColor only, I wasn’t able to see the light attached to the player, and couldn’t tell if it was toggled on or off. The latter way renders the light, but doesn’t allow visibility in darkness.

I don’t really have any games to look at that have night vision other than Outlast, but I know it was made using the last version of the UE, so whatever post processing effect it was using has to be possible in UE4. I’ll try and work on it some more after work tomorrow, and if I find any more info I’ll post my updates.

I think I fixed it. I don’t know how real night vision works/looks, but I think looks pretty decent. Ignore my green noise. I know thats not the best, the real work is done in the Scene Sample area.

For others wanting NightVision.

I assumed the SceneTexture with the PostProcessing option is the lighting. But I definitely need the DiffuseColor to see in the dark and the AmbientOcclusion to give some dark shadows around the sides for surface definition. Multiplying those together instead of Adding them didn’t make it so bright. PostProcessing0 was the lighting, but I needed to amplify the brightness before adding it into the other SceneTexture, so I switched them. Then I plug it into the Desaturation node, then everything is just like the previous screenshot in my above post. I made the brightness (100) high because I wanted it to be blinding in light. You guys be the judge. Does it look okay?

The left side is night vision on, the right side is off. The top two are with a light in the same room, the bottom two are without.

Is there also a way to add effect to RenderTextures? Like if a designer set up a series of night vision camera around a building. Normally, I would use RenderTarget Textures with SceneCapture2D components, and render that material to a mesh. I don’t know how the SceneTexture expression in the material editor above works. Is it grabbing the render from the main camera, or just the final render on the monitor? I would love to use exact same effect on other cameras. So as I was saying, if you had a series of night vision cameras set up, what ever the camera renders to, would function just the same as the above material. Can “SceneTexture” be used in conjunction to the SceneCapture component or do I have to use a different method to simulate night vision?

So how do I use material? Like how to add it to my view? I assume effect needs to be run on/from the camera but how? How do I activate the effect?

To use material you need a global post process volume in your level. Select it and then scroll to the bottom of the details panel to find “Blendables”, click the small + sign and place material into the slot.

A material like would benefit from having a parameter to turn the effect on/off, since adding it to the blendables section will cause it to be always on. A parameter controlled through blueprint would be the ideal way to toggle the effect.

Hope that helps!

Thanks will start playing with right now.

Alternatively, since you can apply post process to camera in addition to PP volumes, you could simply add and remove post process components to the player camera based on a Key input, like so:

http://7.t.imgbox.com/oF20FJIO.jpg

Here’s an example implementation of the effect discussed in thread that uses approach for turning of and off.