Author : polygoo


Reply
Reply
 
Thread Tools Display Modes
adam's Avatar
Old (#1)
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:



Is this possible?
Offline , Administrator, 8,657 Posts, Join Date Oct 2004, Location Toronto, Canada Send a message via AIM to adam Send a message via MSN to adam  
   Reply With Quote

adam's Avatar
Old (#2)
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:

Offline , Administrator, 8,657 Posts, Join Date Oct 2004, Location Toronto, Canada Send a message via AIM to adam Send a message via MSN to adam  
   Reply With Quote

Grimm_Wrecking's Avatar
Old (#3)
@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:



edit: oops, guess you beat me to it hah.
Offline , triangle, 433 Posts, Join Date Oct 2009, Location Kentucky Send a message via MSN to Grimm_Wrecking Send a message via Skype™ to Grimm_Wrecking  
   Reply With Quote

00Zero's Avatar
Old (#4)
it still keeps the sharp silhouette? thats weird
Serozh Sarkisyan
Environment Artist
Infinity Ward
Offline , dedicated polycounter, 1,305 Posts, Join Date Sep 2008, Location Los Angeles  
   Reply With Quote

adam's Avatar
Old (#5)
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.
Offline , Administrator, 8,657 Posts, Join Date Oct 2004, Location Toronto, Canada Send a message via AIM to adam Send a message via MSN to adam  
   Reply With Quote

rasmus's Avatar
Old (#6)
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!
Rasmus Deguchi - LinkedIn
Independent Game Developer
www.razkun.com
Offline , polycounter, 810 Posts, Join Date Dec 2007, Location Tokyo, Japan  
   Reply With Quote

crasong's Avatar
Old (#7)
Quote:
Originally Posted by adam View Post
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.
Offline , spline, 239 Posts, Join Date Oct 2009, Location Singapore Send a message via MSN to crasong Send a message via Yahoo to crasong  
   Reply With Quote

adam's Avatar
Old (#8)
I'm wondering if I were to set some far off DOF, like 3000-4000 units out, if that'd help. No idea, though.
Offline , Administrator, 8,657 Posts, Join Date Oct 2004, Location Toronto, Canada Send a message via AIM to adam Send a message via MSN to adam  
   Reply With Quote

crasong's Avatar
Old (#9)
Would it crash? or decrease performance? I'd try it if i knew how
Offline , spline, 239 Posts, Join Date Oct 2009, Location Singapore Send a message via MSN to crasong Send a message via Yahoo to crasong  
   Reply With Quote

Grimm_Wrecking's Avatar
Old (#10)
Quote:
Originally Posted by adam View Post
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

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.

Last edited by Grimm_Wrecking; 04-05-2010 at 01:29 AM..
Offline , triangle, 433 Posts, Join Date Oct 2009, Location Kentucky Send a message via MSN to Grimm_Wrecking Send a message via Skype™ to Grimm_Wrecking  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch