mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 06:34:10 +00:00
Further tweaks on the C64 shader
This commit is contained in:
parent
a589f3e6f0
commit
49130533c6
1 changed files with 6 additions and 3 deletions
|
@ -146,7 +146,6 @@ void main( PS_IN fragment, out PS_OUT result )
|
|||
{
|
||||
float2 uv = ( fragment.texcoord0 );
|
||||
float2 uvPixellated = floor( fragment.position.xy / RESOLUTION_DIVISOR ) * RESOLUTION_DIVISOR;
|
||||
//float2 uvPixellated = fragment.position.xy;
|
||||
|
||||
float4 color = t_BaseColor.Sample( samp0, uv );
|
||||
|
||||
|
@ -157,8 +156,9 @@ void main( PS_IN fragment, out PS_OUT result )
|
|||
color.rgb = dc;
|
||||
|
||||
// add Bayer 8x8 dithering
|
||||
float dither = DitherArray8x8( uvPixellated );
|
||||
color.rgb += ( float3( dither, dither, dither ) * quantizationPeriod );
|
||||
//float2 psxDitherScale = fragment.position.xy / ( RESOLUTION_DIVISOR / 2.0 );
|
||||
float dither = DitherArray8x8( uvPixellated ) - 0.5;
|
||||
color.rgb += float3( dither, dither, dither ) * quantizationPeriod;
|
||||
|
||||
|
||||
// C64 colors http://unusedino.de/ec64/technical/misc/vic656x/colors/
|
||||
|
@ -205,6 +205,9 @@ void main( PS_IN fragment, out PS_OUT result )
|
|||
};
|
||||
#endif
|
||||
|
||||
// PSX color quantization
|
||||
//color = floor( color * 32.0 ) / 32.0;
|
||||
|
||||
// find closest color match from C64 color palette
|
||||
color = LinearSearch( color.rgb, palette );
|
||||
//color = float4( BinarySearch( color.rgb, palette ), 1.0 );
|
||||
|
|
Loading…
Reference in a new issue