Home Unreal Engine

UDK - Setting up foreground DOF

polycounter lvl 19
Offline / Send Message
adam polycounter lvl 19
Hey everyone,

Is it possible to setup the DOF in UDK to only effect from the foreground outward? Right now I can only make objects blur the further from the camera that they are. However, I'd like to have objects blur the closer to the camera they are, so that shots of grass/weeds/flora that get close to the camera are blurred. The opposite of what is happening here:

forestbase_help_dof01.jpg

Is this possible?

Replies

  • adam
    Options
    Offline / Send Message
    adam polycounter lvl 19
    Thanks to EricV for pointing me to some documentation on DOF over at the UDN. What I had to do was..

    -Reduce the Inner Radius to 0
    -Max Far Blur Amount to 0
    -Max Near Blur Amount to 1
    -Adjust the Focus Distance to get a blur distance that I liked.

    The results:

    forestbase_forum_dof01.jpg
  • Grimm_Wrecking
    Options
    Offline / Send Message
    Grimm_Wrecking polycounter lvl 8
    @adam:

    I assume this is the general Idea of the effect you're wanting?

    this was throw together but yeah its possible.

    here's a screen grab:

    udk_dof_settings_bigh.jpg

    edit: oops, guess you beat me to it hah.
  • 00Zero
    Options
    Offline / Send Message
    it still keeps the sharp silhouette? thats weird
  • adam
    Options
    Offline / Send Message
    adam polycounter lvl 19
    A lot of games with DOF like this do this. The frame isn't blurring anything else behind that mesh so the post work stops and ends up creating the hard edge. If something else were behind it AND being blurred in the same frame, then it'd be blurred.
  • rasmus
    Options
    Offline / Send Message
    That's disappointing - DOF looks a hell of a lot better when edges of things blur... I don't suppose better DOF could be hacked together in the material editor? Would be nice to see some smart young man try it!
  • crasong
    Options
    Offline / Send Message
    crasong polycounter lvl 13
    adam wrote: »
    A lot of games with DOF like this do this. The frame isn't blurring anything else behind that mesh so the post work stops and ends up creating the hard edge. If something else were behind it AND being blurred in the same frame, then it'd be blurred.

    So would creating any kind of geometry and placing it behind the trees make em blur? was thinking if adding a "wall" further in the back would work.
  • adam
    Options
    Offline / Send Message
    adam polycounter lvl 19
    I'm wondering if I were to set some far off DOF, like 3000-4000 units out, if that'd help. No idea, though.
  • crasong
    Options
    Offline / Send Message
    crasong polycounter lvl 13
    Would it crash? or decrease performance? I'd try it if i knew how :(
  • Grimm_Wrecking
    Options
    Offline / Send Message
    Grimm_Wrecking polycounter lvl 8
    adam wrote: »
    I'm wondering if I were to set some far off DOF, like 3000-4000 units out, if that'd help. No idea, though.

    It doesn't blur the foreground anymore, just gives it sort of a surreal effect, like a pocket of clarity is just out of reach. It didn't seem to affect fps anymore than normal dof 1 way or the other when I turned it on, but then again I was in a relatively low demand set.

    I tried to see if I could cheat the edge effect by masking out the corners when the camera is within 'x' units of the obj so it would blur out the interior texture over the then masked geo as a work around, though it didn't work too. While it did blur it it didn't look right at all.

    Though if someone wants to try to make it work, basically it was just making the shader "masked" and creating a mask sheet for the edges of the geo in the texture sheet and setting it up with an if statement to power the opacity to mask in a gradient effect.

    I couldn't get the shader to register the camera distance as intended though. I suspect its because I just don't know/understand enough about it :poly141:

    I also tried a fresnel effect bloomed out, but that was...undesirable as well.

    edit: of course the simplest effect could be to just create a lod that has quads coming off the edges with a faded texture painted out that dissapears once your say 128 u away from the object to the "real" 1st lod.
Sign In or Register to comment.