Skip to content

Commit

Permalink
add missing visualtreatment.h plus add adjustable values at top
Browse files Browse the repository at this point in the history
  • Loading branch information
xan1242 committed Mar 17, 2022
1 parent ee5be0f commit 1da45cb
Show file tree
Hide file tree
Showing 3 changed files with 543 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Shaders/screeneffect.fx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

#include "global.h"

// you can tune the bloom parameters here, recommended to first enable BLOOM_DEBUG in visualtreatment.fx
// enter then exit video options to recompile shader
#define BLOOM_EXPOSURE 6.0
#define BLOOM_BRIGHTPASS_THRESHOLD 1.0

///////////////////////////////////////////////////////////////////////////////

static const int MAX_SAMPLES = 16; // Maximum texture grabs
Expand Down Expand Up @@ -282,13 +287,13 @@ float4 PS_DownScaleForBloom(in float2 vScreenPosition : TEXCOORD0 ) : COLOR
sample += cavSampleWeights[11] * tex2D( DIFFUSE_SAMPLER, vScreenPosition + cavSampleOffsets[11].xy ).xyz;
sample += cavSampleWeights[12] * tex2D( DIFFUSE_SAMPLER, vScreenPosition + cavSampleOffsets[12].xy ).xyz;

sample = float4(tonemap(sample.rgb, 6.0), 1.0); // exposure
sample = float4(tonemap(sample.rgb, BLOOM_EXPOSURE), 1.0); // exposure

sample = DeCompressColourSpace(sample);

// Operate on the max colour channel to remove the hue blowout and blue tinge
// exhibited by the original filter
const float kBrightPassThreshold = 1.0;
const float kBrightPassThreshold = BLOOM_BRIGHTPASS_THRESHOLD;
float maxChannel = max(max(sample.x, sample.y), sample.z);
maxChannel -= kBrightPassThreshold;
//maxChannel = max(maxChannel, 0.0f);
Expand Down
11 changes: 10 additions & 1 deletion Shaders/visualtreatment.fx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@
///////////////////////////////////////////////////////////////////////////////
#define VIGNETTE_SCALE 0.50

// comment out to disable ReShade FakeHDR pass
// uncomment to enable ReShade FakeHDR pass
//#define USE_FAKEHDR
#define FAKEHDR_POWER 1.1
#define FAKEHDR_RADIUS1 0.848
#define FAKEHDR_RADIUS2 0.848

// uncomment to disable bloom rendering
//#define BLOOM_DISABLE

// uncomment to enable bloom texture render to screen
//#define BLOOM_DEBUG

// you can tune bloom in screeneffect.fx
// enter then exit video options to recompile shader


#include "global.h"
#include "gradient.h"
Expand Down
Loading

0 comments on commit 1da45cb

Please sign in to comment.