Skip to content

Commit

Permalink
Use different normalization instead
Browse files Browse the repository at this point in the history
  • Loading branch information
brimson committed Jul 26, 2022
1 parent d4b06aa commit 14e680d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions shaders/cMotionBlur.fx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ namespace MotionBlur
#endif
};

CREATE_TEXTURE(Render_Common_0, int2(BUFFER_WIDTH >> 1, BUFFER_HEIGHT >> 1), RG16F, 6)
CREATE_TEXTURE(Render_Common_0, int2(BUFFER_WIDTH >> 1, BUFFER_HEIGHT >> 1), RG8, 6)
CREATE_SAMPLER(Sample_Common_0, Render_Common_0)

CREATE_TEXTURE(Render_Common_1_A, BUFFER_SIZE_1, RGBA16F, 9)
Expand Down Expand Up @@ -239,7 +239,7 @@ namespace MotionBlur
void Normalize_PS(in float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD, out float2 Color : SV_TARGET0)
{
float4 Frame = max(tex2D(Sample_Color, TexCoord), exp2(-10.0));
Color = saturate(Frame.rg / dot(Frame.rgb, 1.0));
Color = saturate(normalize(Frame.rgb).xy);
}

void Blit_PS(in float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD, out float4 OutputColor0 : SV_TARGET0)
Expand Down
4 changes: 2 additions & 2 deletions shaders/cOpticalFlowLK.fx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace OpticalFlowLK
#endif
};

CREATE_TEXTURE(Render_Common_0, int2(BUFFER_WIDTH >> 1, BUFFER_HEIGHT >> 1), RG16F, 6)
CREATE_TEXTURE(Render_Common_0, int2(BUFFER_WIDTH >> 1, BUFFER_HEIGHT >> 1), RG8, 6)
CREATE_SAMPLER(Sample_Common_0, Render_Common_0)

CREATE_TEXTURE(Render_Common_1_A, BUFFER_SIZE_1, RGBA16F, 9)
Expand Down Expand Up @@ -232,7 +232,7 @@ namespace OpticalFlowLK
void Normalize_PS(in float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD, out float2 Color : SV_TARGET0)
{
float4 Frame = max(tex2D(Sample_Color, TexCoord), exp2(-10.0));
Color = saturate(Frame.rg / dot(Frame.rgb, 1.0));
Color = saturate(normalize(Frame.rgb).xy);
}

void Blit_PS(in float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD, out float4 OutputColor0 : SV_TARGET0)
Expand Down
4 changes: 2 additions & 2 deletions shaders/kDatamosh.fx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ namespace Datamosh
MipFilter = LINEAR; \
};

CREATE_TEXTURE(Render_Common_0, int2(BUFFER_WIDTH >> 1, BUFFER_HEIGHT >> 1), RG16F, 6)
CREATE_TEXTURE(Render_Common_0, int2(BUFFER_WIDTH >> 1, BUFFER_HEIGHT >> 1), RG8, 6)
CREATE_SAMPLER(Sample_Common_0, Render_Common_0)

CREATE_TEXTURE(Render_Common_1_A, BUFFER_SIZE_1, RGBA16F, 9)
Expand Down Expand Up @@ -304,7 +304,7 @@ namespace Datamosh
void Normalize_PS(in float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD, out float2 Color : SV_TARGET0)
{
float4 Frame = max(tex2D(Sample_Color, TexCoord), exp2(-10.0));
Color = saturate(Frame.rg / dot(Frame.rgb, 1.0));
Color = saturate(normalize(Frame.rgb).xy);
}

void Blit_PS(in float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD, out float4 OutputColor0 : SV_TARGET0)
Expand Down

0 comments on commit 14e680d

Please sign in to comment.