Home Unreal Engine

Trying to fake DOF in scene, not game (help!)

jod13
triangle
Offline / Send Message
Pinned
jod13 triangle
No matter what I do, I can't get DOF to work with any camera type, any scene, even in the ones I download from Unreal's learning section. I can make the entire screen blurry or the entire screen clear, but absolutely no deviation between a foreground and background, where some things are clear and others are blurred. I really just need to differentiate between a few things up front and a few in the back, so I've been trying to achieve a similar effect with post processing, a plane with a blurring material or a UI panel but nothing has worked so far. Post processing has no effect unless it's unbound (I know that's not right and it's not supposed to, I've used post processing in the past to only effect particular areas, but I can't get anything to respond or show any effect of post processing regardless of location unless unbound is checked and it's applied to everything in the scene), the UI doesn't seem to work in any scene setup (only appearing after hitting "play" for game mode, which I'm not doing, I'm directly rendering a video based on my scene) and none of the plane materials I've tried have worked (either because of the post processing limitation or because, after I set it up how tutorials suggested, it didn't blur anything or work). No matter how I set post process up, using DOF there does nothing, not even blurring the whole scene, regardless of whether it's unbound or not. I don't know how to fix the DOF issue and I am perfectly willing to use a workaround, but after spending all week on this, I really don't have a solution, and I'm running out of time. Any and all advice would be appreciated.  

Replies

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    The cinematic camera has a really good dof. Have you tried looking at some youtube tutorials about it? It has a focus distance parameter and an aperture parameter. These 2 are enough to make nice dof. The smaller the aperture value is, the more blur you get. If these parameters are not working for you, you may be at low or medium quality settings so the dof doesn't show.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    I have some more notes:
    - Why unbound post process volume wouldn't be a correct approach? It just means you apply the post process to the entire scene, and not to a specific area.
    - Post process does work in the editor , you don't need to hit play.
    - When you are rendering a video using sequencer or render queue, it actually goes in game.

    Can you reproduce this issue in a blank new project? If you can, I can take a look at it if you upload it somewhere and share a link to it.
  • jod13
    Offline / Send Message
    jod13 triangle
    Obscura said:
    I have some more notes:
    - Why unbound post process volume wouldn't be a correct approach? It just means you apply the post process to the entire scene, and not to a specific area.
    - Post process does work in the editor , you don't need to hit play.
    - When you are rendering a video using sequencer or render queue, it actually goes in game.

    Can you reproduce this issue in a blank new project? If you can, I can take a look at it if you upload it somewhere and share a link to it.
    Thanks for replying! Like I said, though, that doesn't work. All of my visuals are max quality, all Epic settings and I've made sure every option is checked for high quality relating specifically to DOF outside those settings. It's not showing up in renders or high quality screenshots, either, so it's definitely not working but not showing up; everything is always 100% clear without one thing being in focus and others being unfocused, even when Depth of Field layers and Debug Focus Plane clearly show things that should be showing as blurry. Both unbound post process DOF and cinematic camera DOF don't work for this; either the whole screen is blurry or the whole screen is clear, absolutely nothing will differentiate between fore- and background. I've tested this in both my scene, new test scenes (blank and default set up) and downloaded learning scenes directly from Unreal - none of them work with either version of DOF differentiation, no matter how drastically I edit the aperture, F stop, DOF settings, etc. I can get other post processing effects to work, such as color correction, but not DOF; even unbound post processing doesn't show any blurring like it should, and camera DOF can only sometimes achieve full screen blur with really low terrible focus settings. It's the exact opposite of what I need - I can't have the whole scene be blurry, I need that differentiation between the front stuff and the further stuff. I've rendered once or twice using sequencer's render settings, but it just exported a video for me; I only know the basic settings and am trying to set up 4k. How do I upload/share my test file? I haven't been able to get it to work in any files I've had, though I don't know how useful it will be to you; I've specifically created new test files to follow the documentation and hour long video discussing cameras and DOF, but none of it worked, and that exact Unreal file wasn't available (I downloaded the Virtual Camera and Sequencer ones, since those seemed most similar to the tutorial ones and already had cameras and Sequencer timelines set up with DOF capabilities, though it didn't show up for me). The hour long video discussing DOF and cinematic abilities even showed the developer being unable to use the eyedropper tool, but DOF worked for him. When I have his exact settings and a similar set up, I get no results. I've read and watched every document, tutorial and issue report I can find on this, and I've found other people with issues, but no solutions (and usually not enough information to identify a specific root problem or whether it's the same as mine). The only "fix" I've seen anyone mention is going back to much older versions of Unreal that used circle DOF and bokeh :( 
  • jod13
    Offline / Send Message
    jod13 triangle
    I've also tried making a plane that will slightly blur the things behind it, but none of them worked (I tried 3 different material types, but the only one that worked was a motion blur that doesn't work or look like DOF or gaussian at all), and while UI can blur things, that only seems to work and appear in play mode, showing up as invisible in the scene itself. I've tested with fog too, and while that can darken further things a bit, it doesn't really help much. Everything I found in the Unreal store was UI based, showing up in the game mode rather than the scene, and trying to artificially create DOF in the rendered video would take a ton of time and effort masking out tons of frames, so I'm really trying to avoid it if possible. Unfortunately, I've had the exact same results in every scene I've tested; even if my camera was somehow broken or wrong, it should have showed up when I downloaded the Unreal learning scenes, since they certainly knew how to do it correctly, but it doesn't show up there, either. 
  • BagelHero
    Offline / Send Message
    BagelHero interpolator
    I'm certain you've already done your own searching (as you've said as much and I think I caught you in the comments of a forum post on this subject), but just to confirm that you've tried these things specifically and they have no effect/relation to what you're doing:






  • jod13
    Offline / Send Message
    jod13 triangle
    I think it should all be packaged in here; the file was too big for polycount, so it's google drive. https://drive.google.com/file/d/1aoBVVTg8rm0QzUtKPQON3lB9LRKUTeQK/view?usp=sharing

    I used this file to copy a few tutorials and mess around a bit, but it's not big, just two objects and a floor plane to try and get DOF visible. Like I said before, if I lower the setting a ton I can get the whole scene blurry, but nothing I did differentiated between the two objects in clarity, even though the settings and levels should have shown a difference. 
  • jod13
    Offline / Send Message
    jod13 triangle
    BagelHero said:
    I'm certain you've already done your own searching (as you've said as much and I think I caught you in the comments of a forum post on this subject), but just to confirm that you've tried these things specifically and they have no effect/relation to what you're doing:

    Hey, thanks for the suggestions! Yes, I've actually looked into those posts specifically, but sadly they didn't help. I don't think the VR issue is the one I'm having, since I did see that a few times and I'm not using any of that, but I did try editing the ini just in case (to no effect). I did comment on that Unreal post with my account there, but didn't get any responses (not surprising since the posts tended to be a few years old) and the console command also didn't help (I tried several variations I saw in different posts both on Unreal forums and elsewhere, but sadly, none of them seemed to change anything). All my settings are Epic, too, though I did try Cinematic and lowering the quality before pumping it back up to Epic just to make sure that wouldn't help. I did also make a similar post asking for advice on Reddit before posting to Polycount, but that got buried with no responses, so I thought maybe I'd have better luck here. It's been two weeks now with this issue, and I still can't get DOF to differentiate between objects at all (and I know my laptop isn't an issue because I've got strong graphics capabilities and can set the whole screen to blur, I just can't get it to differentiate between a foreground and background like it's supposed to). I've also rebooted Unreal multiple times, restarted my computer, made new scenes and downloaded Unreal learning scenes that have cine cameras set up which should be capable of DOF effects. No dice :( The only thing I haven't done is download a much older version of Unreal, since I don't have the time to reanimate everything in my scene and I can't send the sequencer cinematic backwards to many versions ago when DOF was handled by Circle DOF and Bokeh (which reportedly had fewer issues for some, though it's now been replaced and removed). 
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter


    I made this screenshot in your project. I did nothing special. I made a new level, added some cubes and a cinematic camera. Adjusted the focal length, the aperture and the focus plane and I got the foreground and the background cubes blurred. Using higher focal length will allow you to get stronger dof. You can also decrease the min fstops parameter in the lens settings section. This will allow you to have stronger dof on smaller focal length.
  • jod13
    Offline / Send Message
    jod13 triangle
    Obscura said:


    I made this screenshot in your project. I did nothing special. I made a new level, added some cubes and a cinematic camera. Adjusted the focal length, the aperture and the focus plane and I got the foreground and the background cubes blurred. Using higher focal length will allow you to get stronger dof. You can also decrease the min fstops parameter in the lens settings section. This will allow you to have stronger dof on smaller focal length.
    If you downloaded my scene, then you saw that I already had a camera set up with the objects in much the same way that should have done something similar and they did NOT show DOF at ALL when the layers and settings said they should (both camera DOF and post process). I had screenshots included as well for what I was seeing and settings just in case it looked different when opened elsewhere, but you didn't say what it looked like for you. I have pumped up settings to their literal max with no effect. I understand that other people are able to get it to work in their own programs as per tutorials, but as you can see in my screenshots in the zip file it ISN'T working on mine. I'm sorry, but you making a new scene and saying that it works when you make new things with new settings really doesn't tell me anything. I'm not sure if you looked at the settings I had when you opened my scene, but they're not the only settings and tests I've tried; I'm happy to try and copy your exact settings or download your scene but I haven't been able to mimic that DOF even using Unreal's learning camera scenes that I didn't make, so it isn't like I haven't ever tried a new camera or upped the f stops or used a higher focal length. I'm not trying to be rude, but I'm not a complete idiot, I didn't test and research this for two weeks straight and never raise or lower those settings. I have tried the things you're saying, they just don't WORK in my unreal scenes, or the learning scenes I downloaded for unreal, which I specifically tested just in case I had done something wrong on my own cameras. Just showing that you were able to get DOF to work with absolutely no information on how or why my scene wasn't showing it is just as unhelpful as all the tutorials, but when I do and copy the exact same settings and don't get any DOF visuals at all. I believe you that you were able to get it to work just fine making something new, plenty of people are using DOF with no issue, but that doesn't fix my scene or address the issue that I've made literally 7 new files (and downloaded 2 from Unreal) and not a single one is able to get DOF to work or look like your screenshot, which is the basic tutorial functionality I've been copying with no results for weeks. Do you have any specific information on the actual scene I provided or settings, rather than something new that behaves completely differently that I can't replicate? Or screenshots of your camera settings I could mimic? Because based on everything else I've tried, my expectation would be that if I download your scene that has DOF working it wouldn't work for me, simply because that's what's happened with all the official unreal stuff I've downloaded from their learning section, but I don't understand why. I don't understand why you'd go through the trouble of downloading my scene if you were just going to completely ignore it and make something new; if I'm missing something I apologize, and I do want to understand, but I don't see how you saying "well it worked for me elsewhere" with no further information is supposed to help when doing those same things doesn't work for my scenes, as I've said above.
  • jod13
    Offline / Send Message
    jod13 triangle
    As far as I've been able to see, the minimum focal length is 0, which can allow the f stop to drop from 1.2 to 0. The focal length seems to cap at 999999984306749440.0 mm, with the f stop max capping at 9999999980506447872.0 (default being 2.8). Those numbers change the Lens Settings to Custom. Diaphragm Blade doesn't seem to actually do much so I've mostly left it alone, to my understanding it isn't really super relevant to DOF. I get the full screen blur when the Current Aperture is between .001 and .2 (.0 being completely clear and above .2 becoming equally clear), and then no matter how high I pump it, nothing changes. My Focus Method is Manual and Manual Focus Distance is set towards the middle of things so that there should be a blur on the very front and back items, though I've shifted it around testing. Show > visualize > depth of field does seem to change and correlate with the MFD, I just don't get the clear bit in the middle (the black area). Since the Focal Distance mostly just changes where the camera is looking, zooming in and out, I've generally set it to where it should be and left it at that number, since I haven't seen any differences in blur zooming in or out further. To my understanding, this isn't the expected behavior; there should be place in between full screen blur and full clarity where differentiation between the fore, middle and background should show up like  your screenshot, but when I scroll through the Aperture it just goes from super blurry everywhere to less blurry everywhere to not blurry anywhere. I've tried just typing in numbers, too, comparing .05 to 0.6 and such, but generally I've seen the differences better dragging the scroll bar to see all the in between bits. In the tutorials, they didn't need to put in absolute max focal length or f stop to see DOF but since I don't fully understand the science behind them, I've stuck with either the numbers I saw in the videos or the max. They were able to get a nice effect by primarily editing the aperture and MDF, though they could stretch out the range of each layer too with other edits (for example, changing settings to make more area fall into the black clear layer than it fading quickly into the blue or green blurry ones). If I've described wrong limitations, values or settings please do correct me, but that's what I've seen in Unreal and in their documentation. Since my main scene has a lot of stuff in it, I've been focusing on testing example scenes like the example one you posted, just a few objects on a floor or plane that can have clear depth. Generally, from what I've read, the camera should be working fine and I should have more luck using the camera than messing around with post process effects. 
  • BagelHero
    Offline / Send Message
    BagelHero interpolator
    Okay, well, this is your project set up exactly, I just adjusted the existing camera a little (what you sent wasn't doing anything, just for context).

    Settings (HUGE grain of salt, haven't actually used this before and I have no idea what I'm doing and you can probably tell):

    At first I was having trouble, but I think I was doing it incorrectly-- watched some tutorials, and now it's definitely working on my end. If you aren't seeing these results with similar settings, at least that would narrow it down to something on your end that doesn't get packaged...?

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Heh. I did the same. He will write a wall of text again claiming that it doesn't work for him.
  • jod13
    Offline / Send Message
    jod13 triangle
    I'm not asking for help then mindlessly rejecting any attempts out of hand because I want to be a dick and waste people's time, I was trying to explain exactly what I was doing and what the reaction was because I've specifically tried settings that should work and they don't, and then the response of "well doing something else worked fine for me" doesn't help me try to correct or learn anything. I specifically made a new scene based on what you said and tried to replicate what you did based on little information, with no new results. In this case, copying the screenshot, it's not that nothing at all happened, it just doesn't function properly; for me that does make the screen blurry, but everything is blurry, I don't get the clear bit in the middle like I'm supposed to. I appreciate you sharing the settings, and will do more tests, but first try copying that in the same scene, that's what happened. I am hardly immune to mistakes, I make them constantly, but I can be pretty confident that I'm not doing something completely wrong when I'm copying specific numbers into specific settings. I'm also not a guy, not everyone in game art or on the internet is male. I have a few other things I have to do before I can get back to the tests, but I'm hoping to be able to use a different computer this weekend and see if that will have a different reaction too. 
  • BagelHero
    Offline / Send Message
    BagelHero interpolator
    jod13 said:
    I'm not asking for help then mindlessly rejecting any attempts out of hand because I want to be a dick and waste people's time, I was trying to explain exactly what I was doing and what the reaction was because I've specifically tried settings that should work and they don't, and then the response of "well doing something else worked fine for me" doesn't help me try to correct or learn anything. I specifically made a new scene based on what you said and tried to replicate what you did based on little information, with no new results. In this case, copying the screenshot, it's not that nothing at all happened, it just doesn't function properly; for me that does make the screen blurry, but everything is blurry, I don't get the clear bit in the middle like I'm supposed to. I appreciate you sharing the settings, and will do more tests, but first try copying that in the same scene, that's what happened. I am hardly immune to mistakes, I make them constantly, but I can be pretty confident that I'm not doing something completely wrong when I'm copying specific numbers into specific settings. I'm also not a guy, not everyone in game art or on the internet is male. I have a few other things I have to do before I can get back to the tests, but I'm hoping to be able to use a different computer this weekend and see if that will have a different reaction too. 

    It's a bit shite to presume, yeah, and I'm sorry we're being short with you.

    Since I did use your exact scene at least, those settings should do something other than... well, nothing. If you can screencap your depth of field debug that might help...? but at this point, In personally feel that, yes, it's something machine-specific-- I hope the different computer clears up any issues and helps you track down the cause of the error. I also hope that you'll still feel like reporting back here if it does.
  • jod13
    Offline / Send Message
    jod13 triangle
    Later update than I wanted to, but deadlines and rendering were a pain, so I'm posting late in the week. The computer I was able to use had a slightly different version of UE4 and I'm not sure if that's changed anything or not (I tried to look and download the exact version, but it was either this slightly updated one or an older one several versions behind what I have on my laptop, so I went with the newer) but I also had to try twice to install it properly, since the first one failed. Only mentioning that because none of it happened on my original install with my laptop - they're both running Windows 10 with Nvidia graphics cards, albeit different exact types, so they use the same settings. The good news is, when I got it running and imported my scene to it, or rather a copy of that scene like it insisted, I was able to copy the settings and get DOF to work.
    The bad news is, that still doesn't work on my laptop with the same settings. I'm hoping that if I completely uninstall EU4 on my laptop then reinstall the newer version it might help, but have to wrap up this specific project before I do that just to insure nothing breaks before I meet the deadline. I'm frustrated that I can't find the cause of the problem, since I've had no error messages or render issues or anything I could actually look up or troubleshoot, but all I can guess is that it's either something wrong with the code somewhere or an uncommon issue with that specific iteration of UE4 that either didn't move on to the next or was fixed between the versions (since I did find others with similar issues, but not enough info to determine whether it was the exact same problem or not). Any digital program can have weird unexplained issues, including ones that a restart doesn't fix, but I really hate to not find or understand the underlying source/cause/problem since in my experience, they tend to come back or pop up at inopportune times, but tech support never responded and there are literally no differences in the actual scene, numbers or settings between my laptop and the other computer aside from the version. Doing everything right, and having done the right settings previously, just doesn't function properly on my laptop, but at least I can know positively now that I was actually definitely using the right numbers and settings having gotten it to work elsewhere (without proof there was always a chance I missed something somewhere, or didn't see a previous error message, and I initially approached the problem assuming I was doing something wrong, but after full week+ of testing and copying and research I was either legally blind or doing it right and not getting the results). Nothing I did or tried addressed THAT issue, but with Covid I couldn't just borrow or test on a friend's laptop like I normally might, and I only own one laptop, no extra or PC. It actually wouldn't be the first time I reinstalled Unreal, but last time I simply wasn't using it for over a year and uninstalled everything, I didn't have any issues (nor any opportunity to use DOF in the old work I was doing). Since I didn't find a solution I'm debating deleting the post to avoid cluttering search results, I've seen how many things come up, but thanks for responding at least - I do appreciate the both of you taking the time regardless, since no one did on others, even if didn't fix my scene. Hopefully I'll be able to use the other computer long enough to finish things up. 
  • karpo

    hi jod13 hope you are still hanging there :) tried whatever u tried checked all tutorial nothing worked .. finally something clicked, not sure if it works for you but worth a try. first override cine camera it will take PPV as sources

    adjust PPV




Sign In or Register to comment.