Please use english language
It is currently 26 Feb 2020, 12:55

All times are UTC





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Static DoF for FO4
PostPosted: 16 Dec 2015, 11:02 
Offline

Joined: 16 Dec 2015, 10:52
Posts: 1
So I mainly would like to know how possible this would be, or if it would be necessary? I just want things in the distance to be blurry without having to get close to an object. Would I need to add Static DoF or could I modify the current DoF in a way to do this? I would still like to retain the ability to get close to something and have the gradual "focusing in" effect. Sorry if this is too general of a question but I am still fairly new to coding for HLSL =P


Top
 Profile  
 
Tomoko
 Post subject: Re: Static DoF for FO4
PostPosted: 16 Dec 2015, 12:42 
Offline
User avatar

Joined: 21 Nov 2015, 14:15
Posts: 84
It's quite easy to implement, actually. Instead of letting the shader dynamically parse the depth texture at any given point to determine the value of Z and react accordingly, you'd just have to tell it "my focus point is at a specific Z value".

Instead of this in the original code from Boris,

Code:
float2   coord=pos.xy * 0.05;
coord+=IN.txcoord0.xy * 0.05 + float2(0.5, 0.5); //somewhere around the center of screen
float   tempcurr=TextureDepth.SampleLevel(Sampler0, coord, 0.0).x;


you'd need something like

Code:
float tempcurr = XXX;


with XXX being your sweet spot. I think the Z is inverted somewhere in the rest of the code so "working" values range roughly from 0,95 to 1 or something like that.

I first implemented something like that in my little tool for handpicking the focus point, but I threw it away as I didn't need it. I'd have to check if my claims are still viable though, but that's the general idea ( 2h sleep last night, I'm a little fuzzy :p )

_________________
Fallout4 FlickR Gallery, Favorites --
Fallout4 FlickR Gallery, Misc --


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Group