TES Skyrim/Fallout New Vegas : Bokeh Depth of Field - 0915v2
Posted: 09 Sep 2012, 18:07
-------------------------------------
Parametes :
#define NOT_BLURRING_SKY_MODE // not blurring the sky, enable this mode will use Gaussian blur only (DEPTH_OF_FIELD_QULITY 0) .
#define DEPTH_OF_FIELD_QULITY 3 // form 0 to 7, higher is more samples.
#define AUTO_FOCUS // enable auto focus
#define TILT_SHIFT // enable tilt shift
#define POLYGONAL_BOKEH // use polygonal shape bokeh or circular bokeh
#define POLYGON_NUM 5
// for auto focus
float2 FocusPoint=float2(0.5, 0.5); // the point you want to focus.
float FocusSampleRange=1.00; // sampling range of foucs, 0 is FocusPoint only
float NearBlurCurve=1.00; // control the blur from near to focal plane, higher is less blur
float FarBlurCurve=1.00; // control the blur from focal plane to far away, higher is less blur
float DepthClip=150.0; // the max distance you can see clear, over this distance will be blurred, no matter it's on focus or not.
// for static dof
float FocalPlaneDepth=0.50;
float FarBlurDepth=50.00; // the blur will increase from FocalPlaneDepth to FarBlurDepth
// for tilt shift
float TiltShiftAngle=30.0; // it will rotate the focal plane
// common
float BokehBias=2.00;
float BokehBiasCurve=0.75;
float BokehBrightnessThreshold=1.00; // any bright source that its brightness over BokehBrightnessThreshold
float BokehBrightnessMultipiler=2.00; // will increase its brightness by BokehBrightnessMultipiler.
float RadiusSacleMultipiler=4.00; // blur radius affects the size of bokeh
// noise grain
float NoiseAmount=0.35; // the max noise grain amount
float NoiseCurve=0.50; // lower the value, the noise grain will increase faster when out of foucs.
float ChromaticAberrationAmount=0.25; // the intensity of chromatic aberration
-------------------------------------
------------------------------------- update 0910 -------------------------------------
Fixed incorrect bokeh shape.
------------------------------------- update 0911 -------------------------------------
Rewirted the auto focus code, it's more smooth now.
Fixed BokehBrightnessMultipiler parameter.
Static dof with qulity 0 (Gaussian blur only, so it's fast)
------------------------------------- update 0912 -------------------------------------
Added a new mode "NOT_BLURRING_SKY_MODE" for blurring lods only and not affecting the sky.
Enable this mode will use Gaussian blur only because of quality reason.
------------------------------------- update 0913 -------------------------------------
Improved performance.
Improved chromatic aberration.
------------------------------------- update 0915 -------------------------------------
Added tilt-shift feature
------------------------------------- update 0915 v2-------------------------------------
Added noise grain into blur
(the code is copied from effect.txt)
Parametes :
#define NOT_BLURRING_SKY_MODE // not blurring the sky, enable this mode will use Gaussian blur only (DEPTH_OF_FIELD_QULITY 0) .
#define DEPTH_OF_FIELD_QULITY 3 // form 0 to 7, higher is more samples.
#define AUTO_FOCUS // enable auto focus
#define TILT_SHIFT // enable tilt shift
#define POLYGONAL_BOKEH // use polygonal shape bokeh or circular bokeh
#define POLYGON_NUM 5
// for auto focus
float2 FocusPoint=float2(0.5, 0.5); // the point you want to focus.
float FocusSampleRange=1.00; // sampling range of foucs, 0 is FocusPoint only
float NearBlurCurve=1.00; // control the blur from near to focal plane, higher is less blur
float FarBlurCurve=1.00; // control the blur from focal plane to far away, higher is less blur
float DepthClip=150.0; // the max distance you can see clear, over this distance will be blurred, no matter it's on focus or not.
// for static dof
float FocalPlaneDepth=0.50;
float FarBlurDepth=50.00; // the blur will increase from FocalPlaneDepth to FarBlurDepth
// for tilt shift
float TiltShiftAngle=30.0; // it will rotate the focal plane
// common
float BokehBias=2.00;
float BokehBiasCurve=0.75;
float BokehBrightnessThreshold=1.00; // any bright source that its brightness over BokehBrightnessThreshold
float BokehBrightnessMultipiler=2.00; // will increase its brightness by BokehBrightnessMultipiler.
float RadiusSacleMultipiler=4.00; // blur radius affects the size of bokeh
// noise grain
float NoiseAmount=0.35; // the max noise grain amount
float NoiseCurve=0.50; // lower the value, the noise grain will increase faster when out of foucs.
float ChromaticAberrationAmount=0.25; // the intensity of chromatic aberration
-------------------------------------
------------------------------------- update 0910 -------------------------------------
Fixed incorrect bokeh shape.
------------------------------------- update 0911 -------------------------------------
Rewirted the auto focus code, it's more smooth now.
Fixed BokehBrightnessMultipiler parameter.
Static dof with qulity 0 (Gaussian blur only, so it's fast)
------------------------------------- update 0912 -------------------------------------
Added a new mode "NOT_BLURRING_SKY_MODE" for blurring lods only and not affecting the sky.
Enable this mode will use Gaussian blur only because of quality reason.
------------------------------------- update 0913 -------------------------------------
Improved performance.
Improved chromatic aberration.
------------------------------------- update 0915 -------------------------------------
Added tilt-shift feature
------------------------------------- update 0915 v2-------------------------------------
Added noise grain into blur
(the code is copied from effect.txt)