Compare commits

..

2 commits

Author SHA1 Message Date
890c6be9f3 added green & amber phosphor palettes 2024-07-14 13:45:37 -04:00
b8ec85d1ac ntsc s-video functions as intended 2024-07-14 13:17:57 -04:00
4 changed files with 17 additions and 2 deletions

View file

@ -42,6 +42,8 @@ value.monoPalette.0=Black & White
value.monoPalette.1=DameGame value.monoPalette.1=DameGame
value.monoPalette.2=Paint the Town value.monoPalette.2=Paint the Town
value.monoPalette.3=Noir value.monoPalette.3=Noir
value.monoPalette.4=Amber Phosphor
value.monoPalette.5=Green Phosphor
option.hueBits=Hue Depth option.hueBits=Hue Depth
suffix.hueBits=-bit suffix.hueBits=-bit

View file

@ -7,7 +7,7 @@
#define secondBits 2 // [0 1 2 3 4 5 6 7 8] #define secondBits 2 // [0 1 2 3 4 5 6 7 8]
#define thirdBits 2 // [0 1 2 3 4 5 6 7 8] #define thirdBits 2 // [0 1 2 3 4 5 6 7 8]
#define monoPalette 0 // [0 1 2 3] #define monoPalette 0 // [0 1 2 3 4 5]
float bit_max(int bits) { return pow(2, bits); } float bit_max(int bits) { return pow(2, bits); }
@ -32,6 +32,12 @@ vec3 monoLow = vec3(0);
#elif monoPalette == MONO_NOIR #elif monoPalette == MONO_NOIR
vec3 monoHigh = vec3(0.73, 0.67, 0.55); vec3 monoHigh = vec3(0.73, 0.67, 0.55);
vec3 monoLow = vec3(0.26, 0.23, 0.19); vec3 monoLow = vec3(0.26, 0.23, 0.19);
#elif monoPalette == MONO_AMBER
vec3 monoHigh = vec3(1.00, 0.50, 0.00);
vec3 monoLow = vec3(0);
#elif monoPalette == MONO_PHOSPHOR
vec3 monoHigh = vec3(0.00, 0.83, 0.43);
vec3 monoLow = vec3(0);
#endif #endif
float luminance(vec3 color) { float luminance(vec3 color) {

View file

@ -15,7 +15,11 @@ vec3 ntsc(vec3 color) {
float q = dot(color, vec3(0.211, -.523, 0.312)); float q = dot(color, vec3(0.211, -.523, 0.312));
// faux ntsc signal // faux ntsc signal
float carrier = 6.283 * 3.570 * gl_FragCoord.x; // 2π * 3.57MHz * x float carrier = 22.430; // 2π * 3.57MHz
#if wire == WIRE_COMPOSITE
carrier *= gl_FragCoord.x;
#endif
float phase = sin(carrier) * i + cos(carrier) * q; float phase = sin(carrier) * i + cos(carrier) * q;
float quad = cos(carrier) * i - sin(carrier) * q; float quad = cos(carrier) * i - sin(carrier) * q;
@ -53,6 +57,7 @@ vec3 pal(vec3 color) {
// decode faux signal // decode faux signal
#if wire == WIRE_COMPOSITE #if wire == WIRE_COMPOSITE
float composite = y + phase; float composite = y + phase;
// TODO: composite
#endif #endif
u = quad * cos(carrier); u = quad * cos(carrier);
v = phase * sin(carrier); v = phase * sin(carrier);

View file

@ -11,4 +11,6 @@
#define MONO_DAMEGAME 1 #define MONO_DAMEGAME 1
#define MONO_MOTIONSICK 2 #define MONO_MOTIONSICK 2
#define MONO_NOIR 3 #define MONO_NOIR 3
#define MONO_AMBER 4
#define MONO_PHOSPHOR 5