Compare commits

...

2 commits

6 changed files with 66 additions and 17 deletions

View file

@ -125,20 +125,20 @@ void main() {
#endif #endif
vec3 color = texture2D(gcolor, newcoord).rgb; vec3 color = texture2D(gcolor, newcoord).rgb;
#if colorMode == 0 #if colorMode == MODE_HSV
color = rgb2hsv(color).xyz; color = rgb2hsv(color).xyz;
#endif #endif
vec3 final; vec3 final;
#ifdef dithering #ifdef dithering
#if colorMode == 0 #if colorMode == MODE_HSV
vec3 filtered = vec3(dither(color.x, hueMax), dither(color.y, satMax), dither(color.z, valMax)).rgb; vec3 filtered = vec3(dither(color.x, hueMax), dither(color.y, satMax), dither(color.z, valMax)).rgb;
final = hsv2rgb(filtered); final = hsv2rgb(filtered);
#else #else
final = vec3(dither(color.r, colormax.x), dither(color.g, colormax.y), dither(color.b, colormax.z)); final = vec3(dither(color.r, colormax.x), dither(color.g, colormax.y), dither(color.b, colormax.z));
#endif #endif
#else #else
#if colorMode == 0 #if colorMode == MODE_HSV
vec3 filtered = vec3(lightnessStep(color.x, hueMax), lightnessStep(color.y, satMax), lightnessStep(color.z, valMax)).rgb; vec3 filtered = vec3(lightnessStep(color.x, hueMax), lightnessStep(color.y, satMax), lightnessStep(color.z, valMax)).rgb;
final = hsv2rgb(filtered); final = hsv2rgb(filtered);
#else #else
@ -146,9 +146,11 @@ void main() {
#endif #endif
#endif #endif
#if colorMode == 1 && colorDepth == 1 #if colorMode == MODE_RGB && colorDepth == 1
if(final.r == 1) if(final.r == 1)
final = monoColor; final = monoHigh;
else
final = monoLow;
#endif #endif
#ifdef interlacing #ifdef interlacing

View file

@ -9,6 +9,7 @@ profile.REALITY=Project Reality
profile.SNES=Super Famicom profile.SNES=Super Famicom
profile.VR32=VR32 profile.VR32=VR32
option.pixelSize=Downscaling option.pixelSize=Downscaling
value.pixelSize.1=Off value.pixelSize.1=Off
value.pixelSize.2=Low (2x) value.pixelSize.2=Low (2x)
@ -16,11 +17,15 @@ value.pixelSize.4=Medium (4x)
value.pixelSize.8=High (8x) value.pixelSize.8=High (8x)
value.pixelSize.16=Silly (16x) value.pixelSize.16=Silly (16x)
screen.COLOR=Color screen.COLOR=Color
option.colorMode=Color Mode option.colorMode=Color Mode
value.colorMode.0=HSV value.colorMode.0=HSV
value.colorMode.1=RGB value.colorMode.1=RGB
option.dithering=Dithering option.dithering=Dithering
option.colorDepth=RGB Depth option.colorDepth=RGB Depth
value.colorDepth.1=Monochrome value.colorDepth.1=Monochrome
value.colorDepth.3=3-bit value.colorDepth.3=3-bit
@ -30,10 +35,13 @@ value.colorDepth.12=12-bit
value.colorDepth.15=15-bit value.colorDepth.15=15-bit
value.colorDepth.18=18-bit value.colorDepth.18=18-bit
value.colorDepth.24=Truecolor value.colorDepth.24=Truecolor
option.monoPalette=Mono Palette option.monoPalette=Mono Palette
value.monoPalette.0=Black & White value.monoPalette.0=Black & White
value.monoPalette.1=Dot Matrix value.monoPalette.1=Dot Matrix
value.monoPalette.2=Paint the Town value.monoPalette.2=Paint the Town
value.monoPalette.3=Noir
option.hueBits=Hue Depth option.hueBits=Hue Depth
suffix.hueBits=-bit suffix.hueBits=-bit
option.satBits=Saturation Depth option.satBits=Saturation Depth
@ -41,14 +49,20 @@ suffix.satBits=-bit
option.valBits=Value Depth option.valBits=Value Depth
suffix.valBits=-bit suffix.valBits=-bit
screen.SCREEN=Screen screen.SCREEN=Screen
option.interlacing=Interlacing option.interlacing=Interlacing
option.scanlines=Scanlines option.scanlines=Scanlines
option.aberration=Chromatic Aberration option.aberration=Chromatic Aberration
screen.CONSOLE=Consoles screen.CONSOLE=Consoles
screen.PSX=PSX (1994) screen.PSX=PSX (1994)
option.vWarp=Vertex Warping option.vWarp=Vertex Warping
option.vWarp.comment=Emulates screen-space vertex snapping responsible for vertex wobble on the Playstation option.vWarp.comment=Emulates screen-space vertex snapping responsible for vertex wobble on the Playstation
value.vWarp.0=Off value.vWarp.0=Off
@ -58,24 +72,30 @@ value.vWarp.4=Medium (4x)
value.vWarp.8=High (8x) value.vWarp.8=High (8x)
value.vWarp.16=Extreme (16x) value.vWarp.16=Extreme (16x)
value.vWarp.32=Silly (32x) value.vWarp.32=Silly (32x)
option.tWarp=Texture Warping option.tWarp=Texture Warping
option.tWarp.comment=Emulates affine texture mapping responsible for warping textures on the Playstation option.tWarp.comment=Emulates affine texture mapping responsible for warping textures on the Playstation
screen.REALITY=Project Reality (1996) screen.REALITY=Project Reality (1996)
option.hBlur=Horizontal Blur option.hBlur=Horizontal Blur
option.hBlur.comment=Emulates the blur responsible for reducing LCD clarity on the N64 option.hBlur.comment=Emulates the blur responsible for reducing LCD clarity on the N64
screen.FX=FX screen.FX=FX
option.dof=Depth of Field option.dof=Depth of Field
option.dof.comment=Downscale out-of-focus objects option.dof.comment=Downscale out-of-focus objects
option.dofRes=DoF Dither option.dofRes=DoF Dither
option.dofRes.comment=Whether DoF focus affects dither resolution. option.dofRes.comment=Whether DoF focus affects dither resolution.
value.dofRes.0=Static
value.dofRes.1=Dynamic
option.worldCurvature=World Curvature option.worldCurvature=World Curvature
value.worldCurvature.0=Off value.worldCurvature.0=Off
value.worldCurvature.1=Cylinder value.worldCurvature.1=Cylinder
value.worldCurvature.2=Round value.worldCurvature.2=Round
option.worldRadius=Curvature Strength option.worldRadius=Curvature Strength
value.worldRadius.1024=Low (1024) value.worldRadius.1024=Low (1024)
value.worldRadius.512=Medium (512) value.worldRadius.512=Medium (512)

View file

@ -1,4 +1,6 @@
#include "/var/color_depth.glsl"
#define colorMode 0 // [0 1] #define colorMode 0 // [0 1]
#define hueBits 2 // [1 2 3 4 5 6 7 8] #define hueBits 2 // [1 2 3 4 5 6 7 8]
@ -6,9 +8,9 @@
#define valBits 2 // [1 2 3 4 5 6 7 8] #define valBits 2 // [1 2 3 4 5 6 7 8]
#define colorDepth 6 // [1 3 6 8 12 15 18 24] #define colorDepth 6 // [1 3 6 8 12 15 18 24]
#define monoPalette 0 // [0 1 2] #define monoPalette 0 // [0 1 2 3]
#if colorMode == 0 #if colorMode == MODE_HSV
// -- HSV -- // -- HSV --
float bit_max(int bits) { float bit_max(int bits) {
@ -41,12 +43,18 @@
vec3 colormax = vec3(256, 256, 256); vec3 colormax = vec3(256, 256, 256);
#endif #endif
#if monoPalette == 0 #if monoPalette == MONOCHROME_BW
vec3 monoColor = vec3(1, 1, 1); vec3 monoHigh = vec3(1);
#elif monoPalette == 1 vec3 monoLow = vec3(0);
vec3 monoColor = vec3(0.48, 0.72, 0.28); #elif monoPalette == MONOCHROME_DOTMATRIX
#elif monoPalette == 2 vec3 monoHigh = vec3(0.31, 0.40, 0.03);
vec3 monoColor = vec3(1, 0, 0); vec3 monoLow = vec3(0.17, 0.29, 0.13);
#elif monoPalette == MONOCHROME_MOTIONSICK
vec3 monoHigh = vec3(1, 0, 0);
vec3 monoLow = vec3(0);
#elif monoPalette == MONOCHROME_NOIR
vec3 monoHigh = vec3(0.73, 0.67, 0.55);
vec3 monoLow = vec3(0.26, 0.23, 0.19);
#endif #endif
#endif #endif

View file

@ -1,12 +1,14 @@
#include "/var/world.glsl"
#define worldCurvature 0 // [0 1 2] #define worldCurvature 0 // [0 1 2]
#define worldRadius 512 // [1024 512 256 -256] #define worldRadius 512 // [1024 512 256 -256]
void world_curvature() { void world_curvature() {
#if worldCurvature == 1 #if worldCurvature == CURVATURE_CYLINDER
float z = gl_Position.z * gl_Position.z; float z = gl_Position.z * gl_Position.z;
gl_Position.y -= 2 * z / worldRadius; gl_Position.y -= 2 * z / worldRadius;
#elif worldCurvature == 2 #elif worldCurvature == CURVATURE_ROUND
vec2 xz = gl_Position.xz; vec2 xz = gl_Position.xz;
gl_Position.y -= round(( dot(xz, xz) / worldRadius ) * 8) / 8; gl_Position.y -= round(( dot(xz, xz) / worldRadius ) * 8) / 8;
#endif #endif

View file

@ -0,0 +1,11 @@
// color mode IDs
#define MODE_HSV 0
#define MODE_RGB 1
// monochrome palette IDs
#define MONOCHROME_BW 0
#define MONOCHROME_DOTMATRIX 1
#define MONOCHROME_MOTIONSICK 2
#define MONOCHROME_NOIR 3

6
shaders/var/world.glsl Normal file
View file

@ -0,0 +1,6 @@
// world curvature IDs
#define CURVATURE_OFF 0
#define CURVATURE_CYLINDER 1
#define CURVATURE_ROUND 2