Compare commits
3 commits
69c14e4151
...
f89d8ac3c9
Author | SHA1 | Date | |
---|---|---|---|
f89d8ac3c9 | |||
981ebea8c8 | |||
6290b0e19e |
6 changed files with 54 additions and 20 deletions
|
@ -33,11 +33,13 @@ void main() {
|
|||
// hardware post-processing effects
|
||||
#if signal == SIGNAL_NTSC
|
||||
color = ntsc(color);
|
||||
#elif signal == SIGNAL_PAL
|
||||
color = pal(color);
|
||||
#endif
|
||||
|
||||
// physical post-processing effects
|
||||
#ifdef aberration
|
||||
color.rb = aberrate(color).rb;
|
||||
color.rb = aberrate().rb;
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -52,9 +52,10 @@ suffix.valBits=-bit
|
|||
|
||||
screen.SCREEN=Screen
|
||||
|
||||
option.signal=Signal
|
||||
value.signal.0=RGB (Off)
|
||||
option.signal=Encoding
|
||||
value.signal.0=None
|
||||
value.signal.1=NTSC
|
||||
value.signal.2=PAL
|
||||
|
||||
option.wire=Connector
|
||||
value.wire.0=Composite
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
vec2 caOffset = vec2(2 * pixelSize / viewWidth, 0);
|
||||
|
||||
vec3 aberrate(vec3 color) {
|
||||
vec2 offset = caOffset * abs(cos(texcoord * 3.14));
|
||||
float red = color.r;
|
||||
float blue = color.b;
|
||||
vec3 aberrate() {
|
||||
vec2 offset = caOffset * cos(texcoord * 3.14);
|
||||
float red = texture2D(gcolor, texcoord - offset).r;
|
||||
float blue = texture2D(gcolor, texcoord + offset).b;
|
||||
|
||||
return vec3(red, 0, blue);
|
||||
}
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
|
||||
#include "/var/signal.glsl"
|
||||
|
||||
#define signal 0 // [0 1]
|
||||
#define signal 0 // [0 1 2]
|
||||
#define wire 0 // [0 1]
|
||||
|
||||
float luminance(vec3 color) {
|
||||
return dot(color, vec3(0.299, 0.587, 0.114));
|
||||
}
|
||||
|
||||
vec3 ntsc(vec3 color) {
|
||||
// convert to YIQ
|
||||
float y = dot(color, vec3(0.299, 0.587, 0.114));
|
||||
float y = luminance(color);
|
||||
float i = dot(color, vec3(0.596, -.274, -.322));
|
||||
float q = dot(color, vec3(0.211, -.523, 0.312));
|
||||
|
||||
|
@ -17,7 +21,7 @@ vec3 ntsc(vec3 color) {
|
|||
|
||||
// decode faux signal
|
||||
#if wire == WIRE_COMPOSITE
|
||||
float composite = phase + quad + (y * 5.500); // p + q + (y * 5.5MHz)
|
||||
float composite = phase + (y * 5.500); // p + (y * 5.5MHz)
|
||||
y = round(composite * 5.500) / 30.250;
|
||||
phase = composite - quad - (y * 5.500);
|
||||
quad = composite - phase - (y * 5.500);
|
||||
|
@ -28,11 +32,38 @@ vec3 ntsc(vec3 color) {
|
|||
// convert back to RGB
|
||||
vec3 yiqColor = vec3(y, i, q);
|
||||
|
||||
vec3 outColor = vec3(0);
|
||||
outColor.r = dot(yiqColor, vec3(1, 0.956, 0.619));
|
||||
outColor.g = dot(yiqColor, vec3(1, -.272, -.674));
|
||||
outColor.b = dot(yiqColor, vec3(1, -1.106, 1.703));
|
||||
float r = dot(yiqColor, vec3(1, 0.956, 0.619));
|
||||
float g = dot(yiqColor, vec3(1, -.272, -.674));
|
||||
float b = dot(yiqColor, vec3(1, -1.106, 1.703));
|
||||
|
||||
return outColor;
|
||||
return vec3(r, g, b).rgb;
|
||||
}
|
||||
|
||||
vec3 pal(vec3 color) {
|
||||
// convert to YUV
|
||||
float y = luminance(color);
|
||||
float u = 0.492 * (color.b - y);
|
||||
float v = 0.877 * (color.r - y);
|
||||
|
||||
// faux pal signal
|
||||
float carrier = 6.283 * 4.434;
|
||||
float phase = sin(carrier) * u - cos(carrier) * v;
|
||||
float quad = cos(carrier) * u - sin(carrier) * v;
|
||||
|
||||
// decode faux signal
|
||||
#if wire == WIRE_COMPOSITE
|
||||
float composite = y + phase;
|
||||
#endif
|
||||
u = quad * cos(carrier);
|
||||
v = phase * sin(carrier);
|
||||
|
||||
// convert back to RGB
|
||||
vec3 yuvColor = vec3(y, u, v);
|
||||
|
||||
float r = y + (1.140 * v);
|
||||
float g = y - (0.395 * u) - (0.581 * v);
|
||||
float b = y + (2.033 * u);
|
||||
|
||||
return vec3(r, g, b).rgb;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,20 +7,19 @@ profile.DOS=pixelSize=4 colorMode=1 dithering colorDepth=3 vWarp=1 !tWarp !hBlur
|
|||
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.PSX=pixelSize=2 colorMode=1 !dithering colorDepth=24 vWarp=2 tWarp !hBlur interlacing
|
||||
profile.REALITY=profile.PSX vWarp=0 !tWarp hBlur interlacing
|
||||
profile.SNES=pixelSize=4 colorMode=1 dithering colorDepth=15 vWarp=1 !tWarp !hBlur interlacing
|
||||
profile.REALITY=pixelSize=2 colorMode=1 colorDepth=15 !dithering vWarp=0 !tWarp hBlur interlacing
|
||||
profile.VR32=pixelSize=8 colorMode=1 !dithering colorDepth=1 monoPalette=2 vWarp=1 !tWarp !hBlur !interlacing
|
||||
|
||||
# -- SCREENS --
|
||||
# default
|
||||
screen=<profile> <empty> pixelSize <empty> [COLOR] [SCREEN] [CONSOLE] [FX]
|
||||
screen=<profile> <empty> <empty> <empty> pixelSize <empty> [COLOR] [SCREEN] [CONSOLE] [FX]
|
||||
|
||||
# colors
|
||||
screen.COLOR.columns=3
|
||||
screen.COLOR=colorMode dithering <empty> colorDepth <empty> monoPalette hueBits satBits valBits
|
||||
|
||||
# screen effects
|
||||
screen.SCREEN=signal wire interlacing scanline aberration
|
||||
screen.SCREEN=signal wire <empty> <empty> interlacing scanline <empty> <empty> aberration
|
||||
|
||||
# console effects
|
||||
screen.CONSOLE.columns=1
|
||||
|
@ -29,7 +28,7 @@ screen.PSX=vWarp tWarp # playstation
|
|||
screen.REALITY=hBlur # nintendo 64
|
||||
|
||||
# custom effects
|
||||
screen.FX=dof dofRes worldCurvature worldRadius
|
||||
screen.FX=dof dofRes <empty> <empty> worldCurvature worldRadius
|
||||
|
||||
# -- CONDITIONALS --
|
||||
gbuffers_hand.enabled=tWarp
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
#define SIGNAL_RGB 0
|
||||
#define SIGNAL_NTSC 1
|
||||
#define SIGNAL_PAL 2
|
||||
|
||||
#define WIRE_COMPOSITE 0
|
||||
#define WIRE_SVIDEO 1
|
||||
|
|
Loading…
Reference in a new issue