Using source's Depth Of Field

Anyways, there are four main commands, each with a value (In units) that determine where the DOF occurs. There are four main points. We will label it as so:
[PLAYER]
|
1
|
2
|
3
|
4
Between the player and point one, everything is fully blurry. Between point one and point two there is a transition from blurry to in focus. From two to three it is in focus. From three to four it transitions from in focus back to blurry. Now, I was thinking that if there was a script that could tell how far the player is from the point they are looking at on an entity/brush, I could create a function to properly adjust the values of 1, 2, 3, and 4. Being me, I have no idea ho to script past scratch (AKA lies). If someone here would want to help out with getting this to work, that would be amazing. Also, if there is a simpler way, i'd love to try it. If it's true, why aren't any maps using it? It doesn't seem to cause any lag for me, even on highest game settings.
Arachnaphob wrote:
[W]hy aren't any maps using it?
Maybe because it's not that well known? (This is the first time I heard of it, anyway. Which doesn't say much but there you go...)
Another problem may be, that it would be hard to decide what to focus on. Using the depth under the crosshair seems like an obvious choice, but the player may not be staring at the crosshair constantly (I certainly don't) and then the effect would not follow the player's expectations, which would be annoying.
One application where it would be awesome is in cutscenes:
"Fade in. Camera focuses and closes in on a lonely cube, which the player desperately needs for the puzzle in progress. Focus shifts to the background, to a row of turrets guarding the cube."
Which leads me to another question: can I "control" where that "thing" start?
(It may also be the case that my old-ish graphics card just can't do this.)
You need to add '+mat_HDR_level 3' in launch options. I found out about it here:
https://m.reddit.com/r/Portal/comments/ ... _portal_2/
It talks about getting dof to work, however, the distance only changes when you use the commands:
Mat_dof_near_blur_distance [X]
Mat_dof_near_focus_distance [X]
Mat_dof_far_focus_distance [X]
Mat_dof_far_blur_distance [X]
DOF controllers never seem to work for me, maybe I'm using them wrong.
It's still nice for screenshots though.

Combining it with well designed levels can lead to some amazing images

Great work!
HMW wrote:
Haha yeah, that looks super weird. It's a shame that it only works with that command-line parameter, otherwise it could be used for some cool cutscenes. (Setting it in the console while the game is already running doesn't seem to do anything.)It's still nice for screenshots though.
Do you have any I can see it? Cause of... reasons
Here's a link to my shi[redacted] tumblr.
http://arachnaphob.tumblr.com/post/1236 ... le-command
Also HMW, are you getting dof or is it straight up not working?