diff --git a/shaders/composite.fsh b/shaders/composite.fsh index b2968bb..9b426e8 100644 --- a/shaders/composite.fsh +++ b/shaders/composite.fsh @@ -9,8 +9,11 @@ #define rgbSteps 4 // the number of rgb values to use [2 4 8 16 32 64] //#define BLACKEN // Whether or not to blackent the background +#define pixelSize 2 // the size of pixels [1 2 4 8 16] uniform sampler2D gcolor; +uniform sampler2D colortex1; +uniform float viewWidth, viewHeight; varying vec2 texcoord; @@ -107,8 +110,18 @@ float dither(float color, float dithersteps) { } void main() { + vec2 newcoord = texcoord; + #if pixelSize > 1 + vec2 view = vec2(viewWidth, viewHeight) / float(pixelSize); + float offset = (ceil(pixelSize * 0.5) - 0.5) / float(pixelSize); + newcoord = (floor(newcoord * view) + offset) / view; + #endif + vec3 color = texture2D(gcolor, newcoord).rgb; + //gl_FragData[0] = vec4(vec3(color), 1.0); + float mask; - vec3 ogRGB = texture2D(gcolor, texcoord).rgb; + //vec3 ogRGB = texture2D(gcolor, texcoord).rgb; + vec3 ogRGB = color; vec3 ogHSV = rgb2hsv(ogRGB).xyz; float val = ogHSV.z; vec3 ditherhsv = hsv2rgb(vec3(dither(ogHSV.x, hueSteps), dither(ogHSV.y, satSteps), dither(ogHSV.z, valSteps))).rgb; @@ -120,7 +133,6 @@ void main() { #else vec3 final = ditherhsv; #endif -/* DRAWBUFFERS:0 */ - gl_FragData[0] = vec4(vec3(final), 1.0); //gcolor + gl_FragData[0] = vec4(vec3(final), 1.0); //gcolor } diff --git a/shaders/lang/en_US.lang b/shaders/lang/en_US.lang new file mode 100644 index 0000000..df1b0aa --- /dev/null +++ b/shaders/lang/en_US.lang @@ -0,0 +1,19 @@ + +option.pixelSize=Downscaling +value.pixelSize.1=Off +value.pixelSize.2=Low (2x) +value.pixelSize.4=Medium (4x) +value.pixelSize.8=High (8x) +value.pixelSize.16=Silly (16x) + +screen.COLOR=Color Depth +option.RGB=Use RGB +option.rgbSteps=RGB Depth +option.hueSteps=Hue Depth +option.satSteps=Saturation Depth +option.valSteps=Value Depth + +screen.PSX=PSX +option.vWarp=Vertex Warping +option.tWarp=Texture Warping + diff --git a/shaders/shaders.properties b/shaders/shaders.properties index 9144a91..bc65ca8 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -1 +1,7 @@ -sliders=hueSteps satSteps valSteps \ No newline at end of file +sliders=pixelSize hueSteps satSteps valSteps rgbSteps + +screen=pixelSize [COLOR] [PSX] + +screen.COLOR=RGB rgbSteps pixelSize hueSteps satSteps valSteps +screen.PSX= +