Skip to content

Commit

Permalink
New shader updates
Browse files Browse the repository at this point in the history
  • Loading branch information
papadanku committed Dec 9, 2023
1 parent 062c498 commit f3993dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions shaders/cColorBand.fx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ uniform bool _Dither <

float4 PS_Color(VS2PS_Quad Input) : SV_TARGET0
{
float Dither = GetHash1(Input.HPos.xy, 0.0);
float4 ColorMap = tex2D(CShade_SampleGammaTex, Input.Tex0);
float3 Dither = GetHash1(Input.HPos.xy, 0.0);
float4 ColorMap = tex2D(CShade_SampleColorTex, Input.Tex0);

if (_Dither)
{
ColorMap += (Dither / _Range);
ColorMap.rgb += (Dither / _Range);
}

ColorMap.rgb = floor(ColorMap.rgb * _Range) / (_Range);
Expand All @@ -40,6 +40,8 @@ technique CShade_ColorBand
{
pass
{
SRGBWriteEnable = WRITE_SRGB;

VertexShader = VS_Quad;
PixelShader = PS_Color;
}
Expand Down
4 changes: 3 additions & 1 deletion shaders/cPixelate.fx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ uniform int2 _Pixels <
float4 PS_Color(VS2PS_Quad Input) : SV_TARGET0
{
float2 Tex = floor(Input.Tex0 * _Pixels) / _Pixels;
float4 OutputColor = tex2D(CShade_SampleGammaTex, Tex);
float4 OutputColor = tex2D(CShade_SampleColorTex, Tex);

return OutputColor;
}
Expand All @@ -27,6 +27,8 @@ technique CShade_Pixelate
{
pass
{
SRGBWriteEnable = WRITE_SRGB;

VertexShader = VS_Quad;
PixelShader = PS_Color;
}
Expand Down

0 comments on commit f3993dd

Please sign in to comment.