User Tag List

Results 1 to 11 of 11

Thread: Porting Night Vision PP Effect from UDK

  1. #1
    0

    Porting Night Vision PP Effect from UDK

    I was looking to port this 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.

  2. #2
    1
    Unreal Engine Support
    Join Date
    Apr 2014
    Posts
    2,442
    Hi Gibdion,

    I've taken a little bit of time and gone through and setup this 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 this 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!

    Tim

    Here is the images from my setup:

    Name:  nightvision.JPG
Views: 1478
Size:  89.0 KB

    The quality on this 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.
    Name:  NightVisionMaterial.JPG
Views: 1503
Size:  167.4 KB
    Tim Hobson | Learning Resources | Epic Games
    UE4 Documentation
    Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
    _____________________________________________
    Follow me on Twitter @TimHobsonUE4 | My Personal Website
    Photons Be Free: Mini-Tutorials and other Curiosities

  3. #3
    0
    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 this particular arrangement, there is no light visible when using this 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 this 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.
    Last edited by Gibdion; 08-07-2014 at 08:19 AM.

  4. #4
    1
    Unreal Engine Support
    Join Date
    Apr 2014
    Posts
    2,442
    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!

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

    Name:  NVBrightLights.JPG
Views: 1347
Size:  52.6 KB

    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 this 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.

    Name:  NVMaterial.JPG
Views: 1325
Size:  94.3 KB


    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 this 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.

    Tim

    Edit:

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

    Name:  ToggleNV.JPG
Views: 1322
Size:  114.4 KB
    Last edited by Tim Hobson; 08-07-2014 at 11:12 AM.
    Tim Hobson | Learning Resources | Epic Games
    UE4 Documentation
    Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
    _____________________________________________
    Follow me on Twitter @TimHobsonUE4 | My Personal Website
    Photons Be Free: Mini-Tutorials and other Curiosities

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

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

    Name:  NVMatFull.png
Views: 1329
Size:  364.1 KB

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

    Name:  NVDark.png
Views: 1333
Size:  455.4 KB

    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 this 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.
    Last edited by Gibdion; 08-07-2014 at 11:06 PM.

  6. #6
    0
    I think I fixed it. I don't know how real night vision works/looks, but I think this looks pretty decent. Ignore my green noise. I know thats not the best, the real work is done in the Scene Sample area.
    Name:  NVFixedMAT.png
Views: 1361
Size:  159.7 KB

    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.
    Name:  NVFixed.jpg
Views: 1380
Size:  100.7 KB

  7. #7
    0
    Is there also a way to add this 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 this 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?

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

  9. #9
    0
    Mythic

    Join Date
    Apr 2014
    Posts
    2,222
    Quote Originally Posted by KillerSneak View Post
    So how do I use this material? Like how to add it to my view? I assume this effect needs to be run on/from the camera but how? How do I activate the effect?
    To use this 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 this material into the slot.

    A material like this 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!
    [Free Community Project/Plugin] WIP Dynamic Ocean & Calendar Based Sky
    New Features:: Highly accurate sun/moon position, and lunar phase calculations built into the plugin (base class for the SkyDome blueprint)
    In Progress: Weather simulation w/ volumetric clouds

  10. #10
    0
    Quote Originally Posted by DotCam View Post
    To use this 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 this material into the slot.

    A material like this 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 this right now.

  11. #11
    0
    Quote Originally Posted by DotCam View Post
    A material like this 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.
    Alternatively, since you can apply post process effects 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:



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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •