View Full Version : UDK - Setting up foreground DOF
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:
http://dl.dropbox.com/u/17188/forestbase_help_dof01.jpg
Is this possible?
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:
http://dl.dropbox.com/u/17188/forestbase_forum_dof01.jpg
Grimm_Wrecking
04-04-2010, 06:12 PM
@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:
http://dl.dropbox.com/u/2323296/PC%20Folder/udk_dof_settings_bigh.jpg
edit: oops, guess you beat me to it hah.
00Zero
04-04-2010, 06:21 PM
it still keeps the sharp silhouette? thats weird
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
04-04-2010, 07:07 PM
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
04-04-2010, 08:16 PM
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.
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
04-04-2010, 11:08 PM
Would it crash? or decrease performance? I'd try it if i knew how :(
Grimm_Wrecking
04-05-2010, 01:26 AM
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.
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.