2019-01-11 16:26:23 +11:00
|
|
|
layout(std140, set = 0, binding = 0) uniform UBO
|
|
|
|
{
|
|
|
|
mat4 MVP;
|
|
|
|
float iBloomMixmode;
|
|
|
|
float fBloomThreshold;
|
|
|
|
float fBloomAmount;
|
|
|
|
float fBloomSaturation;
|
|
|
|
float fBloomTint_r;
|
|
|
|
float fBloomTint_g;
|
|
|
|
float fBloomTint_b;
|
2019-07-23 06:08:52 +10:00
|
|
|
float bLensdirtEnable_toggle;
|
2019-01-11 16:26:23 +11:00
|
|
|
float iLensdirtMixmode;
|
|
|
|
float fLensdirtIntensity;
|
|
|
|
float fLensdirtSaturation;
|
|
|
|
float fLensdirtTint_r;
|
|
|
|
float fLensdirtTint_g;
|
|
|
|
float fLensdirtTint_b;
|
2019-07-23 06:08:52 +10:00
|
|
|
float bAnamFlareEnable_toggle;
|
2019-01-11 16:26:23 +11:00
|
|
|
float fAnamFlareThreshold;
|
|
|
|
float fAnamFlareWideness;
|
|
|
|
float fAnamFlareAmount;
|
|
|
|
float fAnamFlareCurve;
|
|
|
|
float fAnamFlareColor_r;
|
|
|
|
float fAnamFlareColor_g;
|
|
|
|
float fAnamFlareColor_b;
|
2019-07-23 06:08:52 +10:00
|
|
|
float bLenzEnable_toggle;
|
2019-01-11 16:26:23 +11:00
|
|
|
float fLenzIntensity;
|
|
|
|
float fLenzThreshold;
|
2019-07-23 06:08:52 +10:00
|
|
|
float bChapFlareEnable_toggle;
|
2019-01-11 16:26:23 +11:00
|
|
|
float fChapFlareThreshold;
|
|
|
|
float iChapFlareCount;
|
|
|
|
float fChapFlareDispersal;
|
|
|
|
float fChapFlareSize;
|
|
|
|
float fChapFlareCA_r;
|
|
|
|
float fChapFlareCA_g;
|
|
|
|
float fChapFlareCA_b;
|
|
|
|
float fChapFlareIntensity;
|
2019-07-23 06:08:52 +10:00
|
|
|
float bGodrayEnable_toggle;
|
2019-01-11 16:26:23 +11:00
|
|
|
float fGodrayDecay;
|
|
|
|
float fGodrayExposure;
|
|
|
|
float fGodrayWeight;
|
|
|
|
float fGodrayDensity;
|
|
|
|
float fGodrayThreshold;
|
|
|
|
float iGodraySamples;
|
|
|
|
float fFlareLuminance;
|
|
|
|
float fFlareBlur;
|
|
|
|
float fFlareIntensity;
|
|
|
|
float fFlareTint_r;
|
|
|
|
float fFlareTint_g;
|
|
|
|
float fFlareTint_b;
|
|
|
|
} global;
|
|
|
|
|
2019-07-23 06:08:52 +10:00
|
|
|
#pragma parameter bLensdirtEnable_toggle "Lens Dirt Enable" 0.0 0.0 1.0 1.0
|
|
|
|
#pragma parameter bAnamFlareEnable_toggle "Anam Flare Enable" 0.0 0.0 1.0 1.0
|
|
|
|
#pragma parameter bLenzEnable_toggle "Lenz Enable" 0.0 0.0 1.0 1.0
|
|
|
|
#pragma parameter bChapFlareEnable_toggle "Chap Flare Enable" 0.0 0.0 1.0 1.0
|
|
|
|
#pragma parameter bGodrayEnable_toggle "Godray Enable" 0.0 0.0 1.0 1.0
|
|
|
|
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter iBloomMixmode "Bloom Mix Mode" 0.0 0.0 2.0 1.0
|
2019-07-23 06:08:52 +10:00
|
|
|
//Linear add\0Screen add\0Screen/Lighten/Opacity\0Lighten\0
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fBloomThreshold "Bloom Threshold" 0.8 0.1 1.0 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//Every pixel brighter than this value triggers bloom.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fBloomAmount "Bloom Amount" 0.8 0.0 20.0 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//Intensity of bloom.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fBloomSaturation "Bloom Saturation" 0.8 0.0 2.0 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//Bloom saturation. 0.0 means white bloom, 2.0 means very, very colorful bloom.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fBloomTint_r "Bloom Tint R" 0.7 0.0 1.0 0.05
|
|
|
|
#pragma parameter fBloomTint_g "Bloom Tint G" 0.8 0.0 1.0 0.05
|
|
|
|
#pragma parameter fBloomTint_b "Bloom Tint B" 1.0 0.0 1.0 0.05
|
2019-07-23 06:08:52 +10:00
|
|
|
//R, G and B components of bloom tint the bloom color gets shifted to.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter iLensdirtMixmode "Lens Dirt Mix Mode" 0.0 0.0 3.0 1.0
|
2019-07-23 06:08:52 +10:00
|
|
|
//Linear add\0Screen add\0Screen/Lighten/Opacity\0Lighten\0
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fLensdirtIntensity "Lens Dirt Intensity" 0.4 0.0 2.0 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//Intensity of lensdirt.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fLensdirtSaturation "Lens Dirt Saturation" 2.0 0.0 2.0 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//Color saturation of lensdirt.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fLensdirtTint_r "Lens Dirt Tint R" 1.0 0.0 1.0 0.05
|
|
|
|
#pragma parameter fLensdirtTint_g "Lens Dirt Tint G" 1.0 0.0 1.0 0.05
|
|
|
|
#pragma parameter fLensdirtTint_b "Lens Dirt Tint B" 1.0 0.0 1.0 0.05
|
2019-07-23 06:08:52 +10:00
|
|
|
//R, G and B components of lensdirt tint the lensdirt color gets shifted to.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fAnamFlareThreshold "Anam Flare Threshold" 0.9 0.1 1.0 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//Every pixel brighter than this value gets a flare.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fAnamFlareWideness "Anam Flare Width" 2.4 1.0 2.5 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//Horizontal wideness of flare. Don't set too high, otherwise the single samples are visible.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fAnamFlareAmount "Anam Flare Amt" 14.5 1.0 20.0 0.5
|
2019-07-23 06:08:52 +10:00
|
|
|
//Intensity of anamorphic flare.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fAnamFlareCurve "Anam Flare Curve" 1.2 1.0 2.0 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//Intensity curve of flare with distance from source.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fAnamFlareColor_r "Anam Flare Col R" 0.012 0.0 1.0 0.01
|
|
|
|
#pragma parameter fAnamFlareColor_g "Anam Flare Col G" 0.313 0.0 1.0 0.01
|
|
|
|
#pragma parameter fAnamFlareColor_b "Anam Flare Col B" 0.588 0.0 1.0 0.01
|
2019-07-23 06:08:52 +10:00
|
|
|
//R, G and B components of anamorphic flare. Flare is always same color.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fLenzIntensity "Lenz Intensity" 1.0 0.2 3.0 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//Power of lens flare effect
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fLenzThreshold "Lenz Threshold" 0.8 0.6 1.0 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//Minimum brightness an object must have to cast lensflare.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fChapFlareThreshold "Chap Flare Threshold" 0.9 0.7 0.99 0.05
|
2019-07-23 06:08:52 +10:00
|
|
|
//Brightness threshold for lensflare generation. Everything brighter than this value gets a flare.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter iChapFlareCount "Chap Flare Count" 15.0 1.0 20.0 1.0
|
2019-07-23 06:08:52 +10:00
|
|
|
//Number of single halos to be generated. If set to 0, only the curved halo around is visible.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fChapFlareDispersal "Chap Flare Dispersal" 0.25 0.25 1.0 0.05
|
2019-07-23 06:08:52 +10:00
|
|
|
//Distance from screen center (and from themselves) the flares are generated.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fChapFlareSize "Chap Flare Size" 0.45 0.2 0.8 0.05
|
2019-07-23 06:08:52 +10:00
|
|
|
//Distance (from screen center) the halo and flares are generated.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fChapFlareCA_r "Chap Flare CA R" 0.0 0.0 1.0 0.01
|
|
|
|
#pragma parameter fChapFlareCA_g "Chap Flare CA G" 0.01 0.0 1.0 0.01
|
|
|
|
#pragma parameter fChapFlareCA_b "Chap Flare CA B" 0.02 0.0 1.0 0.01
|
2019-07-23 06:08:52 +10:00
|
|
|
//Offset of RGB components of flares as modifier for Chromatic abberation. Same 3 values means no CA.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fChapFlareIntensity "Chap Flare Intensity" 100.0 5.0 200.0 5.0
|
2019-07-23 06:08:52 +10:00
|
|
|
//Intensity of flares and halo, remember that higher threshold lowers intensity, you might play with both values to get desired result.
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fGodrayDecay "Godray Decay" 0.99 0.5 0.9999 0.05
|
2019-07-23 06:08:52 +10:00
|
|
|
//How fast they decay. It's logarithmic, 1.0 means infinite long rays which will cover whole screen
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fGodrayExposure "Godray Exposure" 1.0 0.7 1.5 0.05
|
2019-07-23 06:08:52 +10:00
|
|
|
//Upscales the godray's brightness
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fGodrayWeight "Godray Weight" 1.25 0.8 1.7 0.05
|
2019-07-23 06:08:52 +10:00
|
|
|
//weighting
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fGodrayDensity "Godray Density" 1.0 0.2 2.0 0.2
|
2019-07-23 06:08:52 +10:00
|
|
|
//Density of rays, higher means more and brighter rays
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fGodrayThreshold "Godray Threshold" 0.9 0.6 1.0 0.05
|
2019-07-23 06:08:52 +10:00
|
|
|
//Minimum brightness an object must have to cast godrays
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter iGodraySamples "Godray Samples" 128.0 16.0 256.0 16.0
|
2019-07-23 06:08:52 +10:00
|
|
|
//2^x format values; How many samples the godrays get
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fFlareLuminance "Flare Luminance" 0.095 0.0 1.0 0.005
|
2019-07-23 06:08:52 +10:00
|
|
|
//bright pass luminance value
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fFlareBlur "Flare Blur" 200.0 1.0 10000.0 50.0
|
2019-07-23 06:08:52 +10:00
|
|
|
//manages the size of the flare
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fFlareIntensity "Flare Intensity" 2.07 0.2 5.0 0.1
|
2019-07-23 06:08:52 +10:00
|
|
|
//effect intensity
|
2019-01-11 16:26:23 +11:00
|
|
|
#pragma parameter fFlareTint_r "Flare Tint R" 0.137 0.0 1.0 0.05
|
|
|
|
#pragma parameter fFlareTint_g "Flare Tint G" 0.216 0.0 1.0 0.05
|
|
|
|
#pragma parameter fFlareTint_b "Flare Tint B" 1.0 0.0 1.0 0.05
|
2019-07-23 06:08:52 +10:00
|
|
|
//effect tint RGB
|
2019-01-11 16:26:23 +11:00
|
|
|
|
|
|
|
vec3 fFlareTint = vec3(global.fFlareTint_r, global.fFlareTint_g, global.fFlareTint_b);
|
|
|
|
vec3 fAnamFlareColor = vec3(global.fAnamFlareColor_r, global.fAnamFlareColor_g, global.fAnamFlareColor_b);
|
|
|
|
vec3 fLensdirtTint = vec3(global.fLensdirtTint_r, global.fLensdirtTint_g, global.fLensdirtTint_b);
|
|
|
|
vec3 fBloomTint = vec3(global.fBloomTint_r, global.fBloomTint_g, global.fBloomTint_b);
|
|
|
|
vec3 fChapFlareCA = vec3(global.fChapFlareCA_r, global.fChapFlareCA_g, global.fChapFlareCA_b);
|
|
|
|
|
2019-07-23 06:08:52 +10:00
|
|
|
bool bGodrayEnable = bool(global.bGodrayEnable_toggle);
|
|
|
|
bool bChapFlareEnable = bool(global.bChapFlareEnable_toggle);
|
|
|
|
bool bLenzEnable = bool(global.bLenzEnable_toggle);
|
|
|
|
bool bAnamFlareEnable = bool(global.bAnamFlareEnable_toggle);
|
|
|
|
bool bLensdirtEnable = bool(global.bLensdirtEnable_toggle);
|
|
|
|
|
2019-01-11 16:26:23 +11:00
|
|
|
// If 1, only pixels with depth = 1 get lens flares
|
|
|
|
// This prevents white objects from getting lens flares sources, which would normally happen in LDR
|
|
|
|
#ifndef LENZ_DEPTH_CHECK
|
|
|
|
#define LENZ_DEPTH_CHECK 0
|
|
|
|
#endif
|
|
|
|
#ifndef CHAPMAN_DEPTH_CHECK
|
|
|
|
#define CHAPMAN_DEPTH_CHECK 0
|
|
|
|
#endif
|
|
|
|
#ifndef GODRAY_DEPTH_CHECK
|
|
|
|
#define GODRAY_DEPTH_CHECK 0
|
|
|
|
#endif
|
|
|
|
#ifndef FLARE_DEPTH_CHECK
|
|
|
|
#define FLARE_DEPTH_CHECK 0
|
|
|
|
#endif
|