Skyrim
0 of 0

File information

Last updated

Original upload

Created by

Marty McFly

Uploaded by

MartyMcModding

Virus scan

Safe to use

Tags for this mod

About this mod

fast and versatile drop-in depth of field shader with a ton of features

Requirements
Permissions and credits
OVERVIEW


Need some slight Depth of Field for gameplay, or are you the screenarcher who tortures the videocard with 4K,5K resolutions and need some nifty bokeh shapes to emphasise your perfect shot you've been setting up for half an hour? Say no more! This Depth of Field shader can do all that.
Even though the size and feature set might be a tiny bit intimidating at first, you'll see that it's actually easy to get used to and even if you just want a bit blur in your scene, you can use conservative settings and get what you want without sacrificing a lot of FPS.


This is the DX9 version of my DoF shader for SSE/FO4, which is right now the only DoF shader besides the vanilla ENB one being used in SSE/FO4 presets.

FEATURES


  • sophisticated autofocus that keeps the important part of the image always in focus in both 1st and 3rd person
  • chromatic aberration featuring a new innovative algorithm for no performance cost
  • Numerous shape controls for easy recreation of any bokeh shape seen in movies of photographs
  • Smoothing of bokeh shape, improved over regular gaussian blur
  • On-the-fly option to render in a lower resolution (like ENB "size scale"), making even wide and high quality blur easy on hardware and framerate
  • Blur width scaled by screen percentage instead of pixel radius, making perceived blur radius relative to screen coherent on all resolutions/DSR
  • highly optimized algorithm for best performance 
  • advanced color leakage fix that completely rids the image of halos around focused objects
  • bokeh emphasis to complement Skyrim's low color range 
  • workaround for buggy procedural color correction code in enbeffect (fixed a while ago by Boris but still present in virtually every custom enbeffect) that lets alpha channel of DoF output affect the CC so that areas out of focus look different

INSTALLATION AND COMPATIBILITY


Compatible to virtually any ENB preset, it requires texOriginal though (to compute DoF blur in lower resolution and have a "backup" full resolution image to blend with) which was an addition to DoF file format present in ENBSeries version 0.264+. Depending on your usage or preset, you can call the file enbdepthoffield.fx (new separate file controlled by EnableDepthOfField in enbseries.ini in current ENB versions) or enbeffectprepass.fx (old DoF shader name controlled by EnableDepthOfField in enbseries.ini in older ENB versions but still works in newest, used for other filters now). ENBSeries reads the file in both Skyrim\ and Skyrim\enbseries\ folder where one has higher priority, depends on your preset where the other fx files (enbbloom.fx, enbeffect.fx ...) reside. Drop it there, after game restart or alt+tab, the new shader should be loaded (controls in enbdepthoffield section should have changed); if not, click APPLY CHANGES. Then configure as you like.


DOCUMENTATION



  • Enable Autofocus If enabled, the DoF focuses automatically on the objects specified by autofocus sample center and -radius. If disabled, DoF will use the manual focus depth.
  • Autofocus sample center The X and Y position on the screen where the DoF focuses on. 0.5 0.5 means screen center. Note that Y axis starts from the top of the screen (DirectX convention).
  • Autofocus sample radius The DoF takes several samples around the autofocus sample center to find out what's in focus as a single sample would be highly inaccurate. This setting adjusts the size of the sample pattern. Larger values tend to result in a calmer blur as the scene has to change substantially, smaller values react to small changes around the sample center.
  • Manual focus depth The focus depth used when autofocus is disabled, smaller values are closer, larger values are farther.
  • Near blur curve The DoF creates blur behind the focus plane and in front of it; the farther the focus plane, the less. This parameter controls how strongly blur builds up in front of the focus plane. Higher values result in less blur as the depth differences between focus depth and object depth have to be larger.
  • Far blur curve The DoF creates blur behind the focus plane and in front of it; the farther the focus plane, the less. This parameter controls how strongly blur builds up behind the focus plane. Higher values result in less blur as the depth differences between focus depth and object depth have to be larger.
  • Hyperfocal depth distance This parameter adjusts what depths the DoF filter considers as "infinitely" far away. With this value set to 1, DoF blur will get less and less when you look from a close object to a far one, but will never go away fully. With this parameter set to a small value, the DoF blur will completely drop to 0 at some point. Watch tapioks' video linked above, it features a great demonstration of the parameter. It mimics human eye behaviour, as focusing on a close finger results in blurry far field, and even focusing on something 5m away still results in some blur, but there's no visible blur if you focus at something 30m away or 3km. If you focus on something 1m, 2m, 3m...etc, at some point the blur in far field will drop to 0. This is your hyperfocal distance. Depth in shaders is normalized to 0-1 range, so if the view distance is 3000m, 1 corresponds to 3000m, 0.01 corresponds to 30m. The parameter makes it easy to trigger DoF for gameplay only when you look at something closely. I use 0.015 for gaming, this'll cause strong background blur when talking to an NPC, and no blur at all when walking around.
  • Blur render res mult This parameter works just like the size scale parameter from ENB SSAO. 1 means the DoF blur is calculated in fullscreen, 0.5 means the blur is calculated in 1/2 width 1/2 height, essentially computing only 1/4 of the pixels your screen has. As pixel shader (most of ENB filters are) performance is roughly proportional to amount of processed pixels, this greatly improve performance. I always use a value of 0.5 as its minor quality loss is a good price for superb performance.
  • Bokeh Intensity Intensity of bokeh highlights (the little or not-so-little discs, pentagons, hexagons or whatever your configured) that show up in blurry areas. Usually, those only show up in areas where some bright pixels stand out in the middle of darker ones. Games that make heavy use of HDR don't need to boost this (as before tonemapping, a white spark can be literally 1000 times brighter than a white wall). Skyrim is a mostly LDR game, which means the entire scene has no significant brightness differences, so almost every bokeh filter employs some kind of trick to make the bokeh kernel stand out.
  • Bokeh shape max size Main bokeh blur radius factor. Higher values might require raising the shape quality knob, do this once the single taps are visible (when the bokeh shape stops being a coherent disc but disintegrates into separated dots).
  • Bokeh shape vertices Controls the bokeh shape. 4 means squared bokeh highlights, 5 means pentagonal, 6 means hexagonal and so on.
    Bokeh shape quality Amount of samples the bokeh filter takes to construct the shape. Best practice is to use a value as low as possible without seeing single blur samples. Look at something close (so blur maxes out in the background), adjust blur radius until you like it, then drop this quality parameter to the lowest value, and start increasing until the gaps between the single samples are filled. With this setting you have best performance at maximum quality as raising the quality futher will have negative side effects such as moire patterns and a much lower performance at no visual gain.
  • Bokeh shape roundness This parameter allows to bend the edges of the polygonal bokeh shape. A value of 0 will produce polygonal bokeh blur, 1 will bend the edges outward for a circular bokeh filter, negative values will bend the edges inward to create a star-like shape.
  • Bokeh shape rotation Angle of bokeh shape in degrees, if you prefer a special rotation for the polygons.
  • Bokeh shape aspect ratio Adjusts the aspect ratio of the bokeh shapes (duh). In movies that were recorded using anamorphic lenses, the bokeh shapes appear stretched vertically but they're actually squashed horizontally. This param lets you simulate this look.
  • Gaussian postblur width To smoothen the bokeh shape, the DoF applies a gaussian blur after the main bokeh pass. This parameter adjusts the radius of this separate blur. Keep it low for sharp, defined bokeh shapes or raise it for more fuzzy, incoherent blur.