reoriented HSV around bit depth rather than steps
This commit is contained in:
parent
605e54a522
commit
26f163cc60
4 changed files with 59 additions and 40 deletions
|
@ -5,11 +5,6 @@
|
||||||
float renderRes = pixelSize;
|
float renderRes = pixelSize;
|
||||||
|
|
||||||
#define dithering // whether or not to apply dithering
|
#define dithering // whether or not to apply dithering
|
||||||
#define colorMode 0 // hsv/rgb [0 1]
|
|
||||||
|
|
||||||
#define hueSteps 4 // the number of hues to use [2 4 8 16 32 64]
|
|
||||||
#define satSteps 4 // the number of saturations to use [2 4 8 16 32 64]
|
|
||||||
#define valSteps 4 // the number of lightnesses to use [2 4 8 16 32 64]
|
|
||||||
|
|
||||||
uniform sampler2D gcolor;
|
uniform sampler2D gcolor;
|
||||||
uniform float viewWidth, viewHeight;
|
uniform float viewWidth, viewHeight;
|
||||||
|
@ -137,14 +132,14 @@ void main() {
|
||||||
vec3 final;
|
vec3 final;
|
||||||
#ifdef dithering
|
#ifdef dithering
|
||||||
#if colorMode == 0
|
#if colorMode == 0
|
||||||
vec3 filtered = vec3(dither(color.x, hueSteps), dither(color.y, satSteps), dither(color.z, valSteps)).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 == 0
|
||||||
vec3 filtered = vec3(lightnessStep(color.x, hueSteps), lightnessStep(color.y, satSteps), lightnessStep(color.z, valSteps)).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
|
||||||
final = vec3(lightnessStep(color.r, colormax.x), lightnessStep(color.g, colormax.y), lightnessStep(color.b, colormax.z)).rgb;
|
final = vec3(lightnessStep(color.r, colormax.x), lightnessStep(color.g, colormax.y), lightnessStep(color.b, colormax.z)).rgb;
|
||||||
|
|
|
@ -34,9 +34,12 @@ 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
|
||||||
option.hueSteps=Hue Depth
|
option.hueBits=Hue Depth
|
||||||
option.satSteps=Saturation Depth
|
suffix.hueBits=-bit
|
||||||
option.valSteps=Value Depth
|
option.satBits=Saturation Depth
|
||||||
|
suffix.satBits=-bit
|
||||||
|
option.valBits=Value Depth
|
||||||
|
suffix.valBits=-bit
|
||||||
|
|
||||||
screen.SCREEN=Screen
|
screen.SCREEN=Screen
|
||||||
option.interlacing=Interlacing
|
option.interlacing=Interlacing
|
||||||
|
|
|
@ -1,7 +1,27 @@
|
||||||
|
|
||||||
|
#define colorMode 0 // [0 1]
|
||||||
|
|
||||||
|
#define hueBits 2 // [1 2 3 4 5 6 7 8]
|
||||||
|
#define satBits 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]
|
||||||
|
|
||||||
|
#if colorMode == 0
|
||||||
|
// -- HSV --
|
||||||
|
|
||||||
|
float bit_max(int bits) {
|
||||||
|
return pow(2, bits);
|
||||||
|
}
|
||||||
|
|
||||||
|
float hueMax = bit_max(hueBits);
|
||||||
|
float satMax = bit_max(satBits);
|
||||||
|
float valMax = bit_max(valBits);
|
||||||
|
|
||||||
|
#else
|
||||||
|
// -- RGB --
|
||||||
|
|
||||||
#if colorDepth == 1
|
#if colorDepth == 1
|
||||||
vec3 colormax = vec3(2, 1, 1);
|
vec3 colormax = vec3(2, 1, 1);
|
||||||
#elif colorDepth == 3
|
#elif colorDepth == 3
|
||||||
|
@ -29,4 +49,5 @@
|
||||||
vec3 monoColor = vec3(1, 0, 0);
|
vec3 monoColor = vec3(1, 0, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
sliders=pixelSize colorDepth hueSteps satSteps valSteps vWarp worldRadius
|
sliders=pixelSize colorDepth hueBits satBits valBits vWarp worldRadius
|
||||||
|
|
||||||
# -- PROFILES --
|
# -- PROFILES --
|
||||||
profile.DEFAULT=pixelSize=2 colorMode=0 dithering hueSteps=4 satSteps=4 valSteps=4 vWarp=0 !tWarp !hBlur !interlacing
|
profile.DEFAULT=pixelSize=2 colorMode=0 dithering hueBits=2 satBits=2 valBits=2 vWarp=0 !tWarp !hBlur !interlacing
|
||||||
profile.AEON=pixelSize=1 colorMode=0 dithering hueSteps=8 satSteps=4 valSteps=4 vWarp=0 !tWarp !hBlur !interlacing
|
profile.AEON=pixelSize=1 colorMode=0 dithering hueBits=3 satBits=2 valBits=2 vWarp=0 !tWarp !hBlur !interlacing
|
||||||
profile.DOS=pixelSize=4 colorMode=1 dithering colorDepth=3 vWarp=1 !tWarp !hBlur !interlacing
|
profile.DOS=pixelSize=4 colorMode=1 dithering colorDepth=3 vWarp=1 !tWarp !hBlur !interlacing
|
||||||
profile.DOTMATRIX=pixelSize=4 colorMode=1 colorDepth=1 monoPalette=1 dithering vWarp=1 !tWarp !hBlur !interlacing
|
profile.DOTMATRIX=pixelSize=4 colorMode=1 colorDepth=1 monoPalette=1 dithering vWarp=1 !tWarp !hBlur !interlacing
|
||||||
profile.OBRADINN=pixelSize=2 colorMode=1 colorDepth=1 monoPalette=0 dithering vWarp=0 !tWarp !hBlur !interlacing
|
profile.OBRADINN=pixelSize=2 colorMode=1 colorDepth=1 monoPalette=0 dithering vWarp=0 !tWarp !hBlur !interlacing
|
||||||
|
@ -17,7 +17,7 @@ screen=<profile> <empty> pixelSize <empty> [COLOR] [SCREEN] [CONSOLE] [FX]
|
||||||
|
|
||||||
# colors
|
# colors
|
||||||
screen.COLOR.columns=3
|
screen.COLOR.columns=3
|
||||||
screen.COLOR=colorMode dithering <empty> colorDepth <empty> monoPalette hueSteps satSteps valSteps
|
screen.COLOR=colorMode dithering <empty> colorDepth <empty> monoPalette hueBits satBits valBits
|
||||||
|
|
||||||
# screen effects
|
# screen effects
|
||||||
screen.SCREEN=interlacing scanlines aberration
|
screen.SCREEN=interlacing scanlines aberration
|
||||||
|
|
Loading…
Reference in a new issue