Skip to content

Commit

Permalink
Paradigm change
Browse files Browse the repository at this point in the history
  • Loading branch information
papadanku committed Oct 14, 2021
1 parent ad7025d commit a714fb5
Show file tree
Hide file tree
Showing 15 changed files with 397 additions and 1,105 deletions.
12 changes: 6 additions & 6 deletions shaders/cAutoExposure.fx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ uniform float _ManualBias <

texture2D _RenderColor : COLOR;

sampler2D _SampleColor
{
Texture = _RenderColor;
SRGBTexture = TRUE;
};

texture2D _RenderLumaLOD
{
Width = 256;
Expand All @@ -30,12 +36,6 @@ texture2D _RenderLumaLOD
Format = R16F;
};

sampler2D _SampleColor
{
Texture = _RenderColor;
SRGBTexture = TRUE;
};

sampler2D _SampleLumaLOD
{
Texture = _RenderLumaLOD;
Expand Down
25 changes: 16 additions & 9 deletions shaders/cBloom.fx
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,30 @@ uniform float _Intensity <
> = 1.0;

texture2D _RenderColor : COLOR;
texture2D _RenderBloom1 { Width = BUFFER_WIDTH / 2; Height = BUFFER_HEIGHT / 2; Format = RGBA16F; };
texture2D _RenderBloom2 { Width = BUFFER_WIDTH / 4; Height = BUFFER_HEIGHT / 4; Format = RGBA16F; };
texture2D _RenderBloom3 { Width = BUFFER_WIDTH / 8; Height = BUFFER_HEIGHT / 8; Format = RGBA16F; };
texture2D _RenderBloom4 { Width = BUFFER_WIDTH / 16; Height = BUFFER_HEIGHT / 16; Format = RGBA16F; };
texture2D _RenderBloom5 { Width = BUFFER_WIDTH / 32; Height = BUFFER_HEIGHT / 32; Format = RGBA16F; };
texture2D _RenderBloom6 { Width = BUFFER_WIDTH / 64; Height = BUFFER_HEIGHT / 64; Format = RGBA16F; };
texture2D _RenderBloom7 { Width = BUFFER_WIDTH / 128; Height = BUFFER_HEIGHT / 128; Format = RGBA16F; };
texture2D _RenderBloom8 { Width = BUFFER_WIDTH / 256; Height = BUFFER_HEIGHT / 256; Format = RGBA16F; };

sampler2D _SampleColor { Texture = _RenderColor; SRGBTexture = TRUE; };

texture2D _RenderBloom1 { Width = BUFFER_WIDTH / 2; Height = BUFFER_HEIGHT / 2; Format = RGBA16F; };
sampler2D _SampleBloom1 { Texture = _RenderBloom1; };

texture2D _RenderBloom2 { Width = BUFFER_WIDTH / 4; Height = BUFFER_HEIGHT / 4; Format = RGBA16F; };
sampler2D _SampleBloom2 { Texture = _RenderBloom2; };

texture2D _RenderBloom3 { Width = BUFFER_WIDTH / 8; Height = BUFFER_HEIGHT / 8; Format = RGBA16F; };
sampler2D _SampleBloom3 { Texture = _RenderBloom3; };

texture2D _RenderBloom4 { Width = BUFFER_WIDTH / 16; Height = BUFFER_HEIGHT / 16; Format = RGBA16F; };
sampler2D _SampleBloom4 { Texture = _RenderBloom4; };

texture2D _RenderBloom5 { Width = BUFFER_WIDTH / 32; Height = BUFFER_HEIGHT / 32; Format = RGBA16F; };
sampler2D _SampleBloom5 { Texture = _RenderBloom5; };

texture2D _RenderBloom6 { Width = BUFFER_WIDTH / 64; Height = BUFFER_HEIGHT / 64; Format = RGBA16F; };
sampler2D _SampleBloom6 { Texture = _RenderBloom6; };

texture2D _RenderBloom7 { Width = BUFFER_WIDTH / 128; Height = BUFFER_HEIGHT / 128; Format = RGBA16F; };
sampler2D _SampleBloom7 { Texture = _RenderBloom7; };

texture2D _RenderBloom8 { Width = BUFFER_WIDTH / 256; Height = BUFFER_HEIGHT / 256; Format = RGBA16F; };
sampler2D _SampleBloom8 { Texture = _RenderBloom8; };

/*
Expand Down
238 changes: 0 additions & 238 deletions shaders/cBlur.fx

This file was deleted.

14 changes: 7 additions & 7 deletions shaders/cDifference.fx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ uniform float _Weight <

texture2D _RenderColor : COLOR;

sampler2D _SampleColor
{
Texture = _RenderColor;
AddressU = MIRROR;
AddressV = MIRROR;
};

texture2D _RenderLOD < pooled = false; >
{
Width = DSIZE.x;
Expand All @@ -43,13 +50,6 @@ texture2D _RenderLOD < pooled = false; >
Format = RGBA8;
};

sampler2D _SampleColor
{
Texture = _RenderColor;
AddressU = MIRROR;
AddressV = MIRROR;
};

sampler2D _SampleLOD
{
Texture = _RenderLOD;
Expand Down
4 changes: 2 additions & 2 deletions shaders/cFilmGrain.fx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION
Position = float4(TexCoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0);
}

float Gaussian1D(float x, float Sigma)
float GaussianWeight(float x, float Sigma)
{
const float Pi = 3.14159265359;
Sigma = Sigma * Sigma;
Expand All @@ -40,7 +40,7 @@ float4 VignettePS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0) :
float Time = rcp(1e+3 / _Time) * _Speed;
float Seed = dot(Position.xy, float2(12.9898, 78.233));
float Noise = frac(sin(Seed) * 43758.5453 + Time);
return Gaussian1D(Noise, _Variance) * _Intensity;
return GaussianWeight(Noise, _Variance) * _Intensity;
}

technique cGrain
Expand Down
12 changes: 6 additions & 6 deletions shaders/cFrameBlending.fx
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ uniform float _BlendFactor <

texture2D _RenderColor : COLOR;

texture2D _RenderCopy
{
Width = BUFFER_WIDTH;
Height = BUFFER_HEIGHT;
};

sampler2D _SampleColor
{
Texture = _RenderColor;
SRGBTexture = TRUE;
};

texture2D _RenderCopy
{
Width = BUFFER_WIDTH;
Height = BUFFER_HEIGHT;
};

sampler2D _SampleCopy
{
Texture = _RenderCopy;
Expand Down
Loading

0 comments on commit a714fb5

Please sign in to comment.