[Fallout 4] Fake bokeh Tilt shift

share shaders here
  • Author
  • Message
Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

[Fallout 4] Fake bokeh Tilt shift

fake Tilt shift implemented in depth of field to utilize bokeh blur.
Image

controls:
Axis: rotate blur axis
Offset: set
Curve: set the blur scale curve
Scale: additional modifier on blur scale.

here is the UI parts:

Code: Select all

bool DoTiltShift    < string UIName = "Enable Tilt Shift";> = {false};
float TS_Axis       < string UIName = "Tilt Shift Axis";	  float UIMin = -90; float UIMax = 90;	float UIStep = 1;> = {0};
float TS_Offset     < string UIName = "Tilt Shift Offset";	  float UIMin = -0.5;	 float UIMax = 0.5;> = {0};
float TS_BlurCurve  < string UIName = "Tilt Shift BlurCurve"; float UIMin = 0.2; float UIMax = 10;> = {1};
float TS_BlurScale  < string UIName = "Tilt Shift BlurScale"; float UIMin = 0;	 > = {1};
and add these right before "return res;" inside PS_ComputeFactor

Code: Select all

if(DoTiltShift)
{
	float2 othogonal = normalize(float2(tan(TS_Axis * 0.0174533), -ScreenSize.z));
	float TS_Dist = abs(dot(IN.txcoord0.xy - 0.5 - othogonal * TS_Offset, othogonal));
	res.r = pow(saturate(TS_Dist), TS_BlurCurve) * ESensorSize * aperture * scaling * TS_BlurScale;
}
Warning: demo only, do not include in released preset.
enbdepthoffield.fx
demo on enb vanilla file
(14.45 KiB) Downloaded 528 times
Last edited by kingeric1992 on 15 Dec 2015, 05:27, edited 1 time in total.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17562
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: [Fallout 4] Fake bokeh Tilt shift

Omg. I said to not use default shaders for presets. It's not just the words, but errors and no optimizations to prevent smart asses to copy-paste code to non enb projects. You could at least find what is wrong.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: [Fallout 4] Fake bokeh Tilt shift

Not sure what do you mean by preventing copy-paste code to non enb projects.

This is just a quick adaptation on faking tilt shift from my old effect file in the forum, to utilize dof pass instead of redoing bokeh blur in postpass. I have no intent to do anything on dof itself in this demo.

I've been rebuilding and testing dof for a couples of days now, and it could take a while before a workable release.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
*master*
Posts: 144
Joined: 10 May 2015, 04:33

Re: [Fallout 4] Fake bokeh Tilt shift

Are you saying that you really just don't like the DOF code that you through up as an example and you don't want us to go off that for writing other DOF presets? Or is there more that I am unaware of? If so, I will stop and just watch :)

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17562
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: [Fallout 4] Fake bokeh Tilt shift

I'm saying that default examples are made only to understand how implement effects instead of using them directly. Don't you see artifacts and performance issues with them? For me is not that simple task to do something not interesting for vacuum cleaners from gamedev which steal everything shiny, at same time to not look as complete idiot with awful code. Examples in presets for end users leads to bad opinion about the mod and if i'll make internal shaders, then most presets will be useless.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
User avatar
*blah-blah-blah maniac*
Posts: 849
Joined: 28 Dec 2011, 00:50

Re: [Fallout 4] Fake bokeh Tilt shift

@Boris

I understand what you are saying. I believe most of us ENB 'preset' authors do not have the knowledge required to develop our own DOF and other shaders, though I am happy to wait for some of the more knowledgeable folks here in the community to come up with some new alternatives ... it's just a matter of time :)

For what it is worth, I am actually pretty happy with the 'Example DOF' that is provided, for the time being. I don't notice any artifacts besides the shimmering of bright, out of focus areas, but this is not a big deal for me. I also don't see any specific performance issues with the Example DOF either, though again I lack the knowledge to be able to evaluate performance beyond how the effect 'feels' in the game.

Boris, if I want to release an ENB Preset, and I do not know how to create my own DOF and Lens effects, is it ok to include your 'Example' versions with my preset?
_________________
Fallout 4 ENB Video Series | Skyrim ENB Video Series | My YouTube Channel
Intel i7-4700HQ @ 2.4GHz | NVidia GTX780M 4GB | 24GB RAM

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17562
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: [Fallout 4] Fake bokeh Tilt shift

You may include examples in presets, but all i get then is "ReShade dof is better, ENB sucks".
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
User avatar
*blah-blah-blah maniac*
Posts: 530
Joined: 30 Jan 2012, 13:18

Re: [Fallout 4] Fake bokeh Tilt shift

Whoever says that is a fool. One cannot compare ENB and ReShade based on the custom shaders made for those two. About the DOF, that might be my doing as I ported/wrote all of the DOF shaders for ReShade. Once I get the chance to purchase Fallout 4 there will be a port of my own DOF for ENB plus many ENB exclusive things.

Offline
User avatar
Posts: 84
Joined: 21 Nov 2015, 14:15

Re: [Fallout 4] Fake bokeh Tilt shift

Marty McFly wrote:Whoever says that is a fool. One cannot compare ENB and ReShade based on the custom shaders made for those two. About the DOF, that might be my doing as I ported/wrote all of the DOF shaders for ReShade. Once I get the chance to purchase Fallout 4 there will be a port of my own DOF for ENB plus many ENB exclusive things.
ANd they look damn fine.

Although yes, I get Boris's point of view. It must be infuriating when people judge your work based on very early, demo settings.
When Marty's shaders hit the ENB fan, though, sh!t will be everywhere. And it will probably feel good.

In the meantime though, us poor mortals who at best know how to write a value in a float variable, or feel like king of the world when they successfully copy/paste another code, will have to work with the example shaders, and the breadcrumbs left by those who know better. =)

Offline
*master*
Posts: 144
Joined: 10 May 2015, 04:33

Re: [Fallout 4] Fake bokeh Tilt shift

The one thing I noticed while playing with this, was that the tilt shift effect was very noticeable in its separation compared to other ENB's and different games.. I'm not used to drastically seeing it move while I make changes, almost like its not blended in, not sure if that is the best description or even correct. I know you just threw this together for us, and its awesome, just something of the behavior I noticed while playing with it last night. Still trying to find the happy sweet spot. Or I may just use it for screen shots or something.. I just enjoy playing for now. I think I've been spending more time trying to learn basics of HLSL and looking at different .fx files than actually playing the game lately ;p Keep up the good work.
Post Reply