Compare commits
No commits in common. "main" and "experimental" have entirely different histories.
main
...
experiment
22 changed files with 87 additions and 426 deletions
15
README.md
15
README.md
|
@ -5,28 +5,17 @@ aimed at providing a variety of effects in the vein of its parent project.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Affine Texture Warping
|
|
||||||
- Chromatic Aberration
|
|
||||||
- Color depth reduction
|
- Color depth reduction
|
||||||
- Depth of Field
|
- Depth of Field
|
||||||
- Dithering
|
- Dithering
|
||||||
- Downscaling
|
- Downscaling
|
||||||
- Horizontal Blur
|
- Horizontal Blur
|
||||||
- Interlacing
|
|
||||||
- Monochrome Mode & Palettes
|
|
||||||
- Scanlines
|
|
||||||
- Screen-Space Vertex Warping
|
- Screen-Space Vertex Warping
|
||||||
|
- Affine Texture Warping
|
||||||
- World Curvature
|
- World Curvature
|
||||||
|
|
||||||
## Screenshots
|
|
||||||
|
|
||||||
![2024-04-18_17 04 13](https://github.com/sleeplessval/aeon/assets/73970075/d2022abe-f39a-4e3d-a0d7-5b6d62147d9f)
|
|
||||||
![2024-04-11_12 58 13](https://github.com/sleeplessval/aeon/assets/73970075/7ced7d92-b032-4b5c-b314-d6fce4b0ed41)
|
|
||||||
![2024-04-17_11 09 10](https://github.com/sleeplessval/aeon/assets/73970075/b5c7b217-19de-45ca-8e1c-20002286997e)
|
|
||||||
![2024-04-21_21 16 47](https://github.com/sleeplessval/aeon/assets/73970075/26961585-845d-4054-9b5a-f0158d6fae9c)
|
|
||||||
|
|
||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|
||||||
- [Alex Charlton's post "Dithering on the GPU"](http://alex-charlton.com/posts/Dithering_on_the_GPU/).
|
- [Alex Charlton's post "Dithering on the GPU"](http://alex-charlton.com/posts/Dithering_on_the_GPU/).
|
||||||
- [BSL Shaders by CaptainTatsu](https://bitslablab.com/bslshaders/). Combining downscale with dithering is the reason I forked a shader in the first place.
|
- [BSL Shaders by CaptainTatsu](https://bitslablab.com/bslshaders/), whose downscale effect was my inspiration for forking a shader.
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,24 @@
|
||||||
#version 120
|
#version 120
|
||||||
|
|
||||||
#include "/module/common.glsl"
|
#define pixelSize 2 // the size of pixels [1 2 4 8 16]
|
||||||
|
|
||||||
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]
|
||||||
|
|
||||||
|
#define rgbSteps 4 // the number of rgb values to use [2 4 8 16 32 64]
|
||||||
|
|
||||||
uniform sampler2D gcolor;
|
uniform sampler2D gcolor;
|
||||||
|
uniform sampler2D colortex1;
|
||||||
uniform float viewWidth, viewHeight;
|
uniform float viewWidth, viewHeight;
|
||||||
|
|
||||||
varying vec2 texcoord;
|
varying vec2 texcoord;
|
||||||
|
|
||||||
#include "/module/color_depth.frag"
|
|
||||||
#include "/module/dof.frag"
|
#include "/module/dof.frag"
|
||||||
#include "/module/interlace.frag"
|
|
||||||
|
|
||||||
// All components are in the range [0…1], including hue.
|
// All components are in the range [0…1], including hue.
|
||||||
vec3 rgb2hsv(vec3 c)
|
vec3 rgb2hsv(vec3 c)
|
||||||
|
@ -98,8 +103,8 @@ vec3[2] closestColors(float hue) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float lightnessStep(float l, float lightnessSteps) {
|
float lightnessStep(float l, float lightnessSteps) {
|
||||||
/* Quantize the lightness to one of `lightnessSteps` values */;
|
/* Quantize the lightness to one of `lightnessSteps` values */
|
||||||
return floor((0.5 + l * (lightnessSteps - 1.0))) / (lightnessSteps - 1.0);
|
return floor((0.5 + l * (lightnessSteps - 1.0))) / (lightnessSteps - 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
float dither(float color, float dithersteps) {
|
float dither(float color, float dithersteps) {
|
||||||
|
@ -125,46 +130,26 @@ void main() {
|
||||||
#endif
|
#endif
|
||||||
vec3 color = texture2D(gcolor, newcoord).rgb;
|
vec3 color = texture2D(gcolor, newcoord).rgb;
|
||||||
|
|
||||||
#if colorMode == MODE_HSV
|
#if colorMode == 0
|
||||||
color = rgb2hsv(color).xyz;
|
color = rgb2hsv(color).xyz;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vec3 final;
|
vec3 final;
|
||||||
#ifdef dithering
|
#ifdef dithering
|
||||||
#if colorMode == MODE_HSV
|
#if colorMode == 0
|
||||||
vec3 filtered = vec3(dither(color.x, hueMax), dither(color.y, satMax), dither(color.z, valMax)).rgb;
|
vec3 filtered = vec3(dither(color.x, hueSteps), dither(color.y, satSteps), dither(color.z, valSteps)).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, rgbSteps), dither(color.g, rgbSteps), dither(color.b, rgbSteps));
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#if colorMode == MODE_HSV
|
#if colorMode == 0
|
||||||
vec3 filtered = vec3(lightnessStep(color.x, hueMax), lightnessStep(color.y, satMax), lightnessStep(color.z, valMax)).rgb;
|
vec3 filtered = vec3(lightnessStep(color.x, hueSteps), lightnessStep(color.y, satSteps), lightnessStep(color.z, valSteps)).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, rgbSteps), lightnessStep(color.g, rgbSteps), lightnessStep(color.b, rgbSteps)).rgb;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
gl_FragData[0] = vec4(vec3(final), 1.0); //gcolor
|
||||||
#if colorMode == MODE_RGB && colorDepth == 1
|
|
||||||
if(final.r == 1)
|
|
||||||
final = monoHigh;
|
|
||||||
else
|
|
||||||
final = monoLow;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef interlacing
|
|
||||||
/* DRAWBUFFERS:01 */
|
|
||||||
// pull previous buffer
|
|
||||||
vec3 prev = texture2D(colortex1, texcoord).rgb;
|
|
||||||
// interlace alternates between odd and even lines on world time
|
|
||||||
if(mod(int(gl_FragCoord.y / pixelSize), 2) == mod(frameCounter, 2))
|
|
||||||
gl_FragData[0] = vec4(prev, 1);
|
|
||||||
else
|
|
||||||
gl_FragData[0] = vec4(final, 1);
|
|
||||||
gl_FragData[1] = vec4(final, 1);
|
|
||||||
#else
|
|
||||||
gl_FragData[0] = vec4(final, 1.0);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#version 120
|
#version 120
|
||||||
|
|
||||||
#include "/module/common.glsl"
|
#define pixelSize // [1 2 4 8 16]
|
||||||
|
|
||||||
//#define aberration
|
|
||||||
//#define hBlur
|
//#define hBlur
|
||||||
|
|
||||||
varying vec2 texcoord;
|
varying vec2 texcoord;
|
||||||
|
@ -10,39 +8,40 @@ varying vec2 texcoord;
|
||||||
uniform sampler2D gcolor;
|
uniform sampler2D gcolor;
|
||||||
uniform float viewWidth;
|
uniform float viewWidth;
|
||||||
|
|
||||||
#include "/module/aberration.frag"
|
#ifdef hBlur
|
||||||
#include "/module/horizontal_blur.frag"
|
|
||||||
#include "/module/scanline.frag"
|
|
||||||
#include "/module/signal.frag"
|
|
||||||
|
|
||||||
void main() {
|
vec2 neighbor = vec2(1 / viewWidth, 0);
|
||||||
vec3 color;
|
|
||||||
|
|
||||||
|
float avg(float l, float c, float r) {
|
||||||
// software post-processing effects
|
return (l + c + r) / 3;
|
||||||
#ifdef hBlur
|
|
||||||
color = hblur();
|
|
||||||
#else
|
|
||||||
color = texture2D(gcolor, texcoord).rgb;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if scanline > 0
|
|
||||||
color = scanlines(color);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// 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 = (color.rb + aberrate().rb) / 2;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
gl_FragData[0] = vec4(color, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec3 color = texture2D(gcolor, texcoord).rgb;
|
||||||
|
|
||||||
|
vec2 left = texcoord - neighbor;
|
||||||
|
vec2 right = texcoord + neighbor;
|
||||||
|
vec3 lColor;
|
||||||
|
if(left.x >= 0)
|
||||||
|
lColor = texture2D(gcolor, left).rgb;
|
||||||
|
else
|
||||||
|
lColor = color;
|
||||||
|
|
||||||
|
vec3 rColor;
|
||||||
|
if(right.x <= viewWidth)
|
||||||
|
rColor = texture2D(gcolor, right).rgb;
|
||||||
|
else
|
||||||
|
rColor = color;
|
||||||
|
|
||||||
|
vec3 blurred = vec3(avg(lColor.r, color.r, rColor.r), avg(lColor.g, color.g, rColor.g), avg(lColor.b, color.b, rColor.b));
|
||||||
|
gl_FragData[0] = vec4(blurred, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
gl_FragData[0] = texture2D(gcolor, texcoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#version 120
|
#version 120
|
||||||
|
|
||||||
#include "/module/common.glsl"
|
#define pixelSize 2 // [1 2 4 8 16]
|
||||||
|
|
||||||
|
#define worldCurvature 0 // [0 1 2]
|
||||||
|
|
||||||
varying vec2 texcoord;
|
varying vec2 texcoord;
|
||||||
varying vec4 color;
|
varying vec4 color;
|
||||||
|
@ -11,7 +13,6 @@ uniform float viewWidth, viewHeight;
|
||||||
|
|
||||||
#include "/module/vertex_warp.vert"
|
#include "/module/vertex_warp.vert"
|
||||||
#include "/module/texture_warp.vert"
|
#include "/module/texture_warp.vert"
|
||||||
#include "/module/world.vert"
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
|
texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
|
||||||
|
@ -24,16 +25,12 @@ void main() {
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NON_WORLD
|
#ifdef tWarp
|
||||||
#if worldCurvature > 0
|
texture_warp();
|
||||||
world_curvature();
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_TWARP
|
#ifndef NON_WORLD
|
||||||
#ifdef tWarp
|
#include "/module/world.vert"
|
||||||
texture_warp();
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
#define NO_TWARP
|
|
||||||
#define NON_WORLD
|
#define NON_WORLD
|
||||||
#include "/gbuffers_basic.vsh"
|
#include "/gbuffers_basic.vsh"
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
#version 120
|
|
||||||
|
|
||||||
varying vec2 texcoord;
|
|
||||||
|
|
||||||
uniform sampler2D texture;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
gl_FragData[0] = texture2D(texture, texcoord);
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
|
|
||||||
#include "/gbuffers_basic.vsh"
|
|
||||||
|
|
|
@ -2,15 +2,10 @@
|
||||||
profile.DEFAULT=Default
|
profile.DEFAULT=Default
|
||||||
profile.AEON=Aeon Upstream
|
profile.AEON=Aeon Upstream
|
||||||
profile.DOS=DOS
|
profile.DOS=DOS
|
||||||
profile.DOTMATRIX=Dot Matrix Game
|
|
||||||
profile.EIGHTBIT=8-bit
|
|
||||||
profile.OBRADINN=Obra Dinn
|
|
||||||
profile.PSX=PSX
|
profile.PSX=PSX
|
||||||
profile.REALITY=Project Reality
|
profile.REALITY=Project Reality
|
||||||
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)
|
||||||
|
@ -18,64 +13,21 @@ 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.rgbSteps=RGB Depth
|
||||||
option.colorDepth=RGB Depth
|
option.hueSteps=Hue Depth
|
||||||
value.colorDepth.1=Monochrome
|
option.satSteps=Saturation Depth
|
||||||
value.colorDepth.3=3-bit
|
option.valSteps=Value Depth
|
||||||
value.colorDepth.6=6-bit
|
|
||||||
value.colorDepth.8=8-bit
|
|
||||||
value.colorDepth.12=12-bit
|
|
||||||
value.colorDepth.15=15-bit
|
|
||||||
value.colorDepth.18=18-bit
|
|
||||||
value.colorDepth.24=Truecolor
|
|
||||||
|
|
||||||
option.monoPalette=Mono Palette
|
|
||||||
value.monoPalette.0=Black & White
|
|
||||||
value.monoPalette.1=Dot Matrix
|
|
||||||
value.monoPalette.2=Paint the Town
|
|
||||||
value.monoPalette.3=Noir
|
|
||||||
|
|
||||||
option.hueBits=Hue Depth
|
|
||||||
suffix.hueBits=-bit
|
|
||||||
option.satBits=Saturation Depth
|
|
||||||
suffix.satBits=-bit
|
|
||||||
option.valBits=Value Depth
|
|
||||||
suffix.valBits=-bit
|
|
||||||
|
|
||||||
|
|
||||||
screen.SCREEN=Screen
|
screen.SCREEN=Screen
|
||||||
|
|
||||||
option.signal=Encoding
|
|
||||||
value.signal.0=None
|
|
||||||
value.signal.1=NTSC
|
|
||||||
value.signal.2=PAL
|
|
||||||
|
|
||||||
option.wire=Connector
|
|
||||||
value.wire.0=Composite
|
|
||||||
value.wire.1=S-Video
|
|
||||||
|
|
||||||
option.interlacing=Interlacing
|
|
||||||
|
|
||||||
option.scanline=Scanlines
|
|
||||||
value.scanline.0=Off
|
|
||||||
value.scanline.1=Soft
|
|
||||||
value.scanline.2=Hard
|
|
||||||
|
|
||||||
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
|
||||||
|
@ -85,33 +37,22 @@ 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
|
|
||||||
value.worldRadius.1024=Low (1024)
|
|
||||||
value.worldRadius.512=Medium (512)
|
|
||||||
value.worldRadius.256=High (256)
|
|
||||||
value.worldRadius.-256=Inverse (-256)
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
|
|
||||||
vec2 caOffset = vec2(2 * pixelSize / viewWidth, 0);
|
|
||||||
|
|
||||||
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,61 +0,0 @@
|
||||||
|
|
||||||
#include "/var/color_depth.glsl"
|
|
||||||
|
|
||||||
#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 monoPalette 0 // [0 1 2 3]
|
|
||||||
|
|
||||||
#if colorMode == MODE_HSV
|
|
||||||
// -- 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
|
|
||||||
vec3 colormax = vec3(2, 1, 1);
|
|
||||||
#elif colorDepth == 3
|
|
||||||
vec3 colormax = vec3(2, 2, 2);
|
|
||||||
#elif colorDepth == 6
|
|
||||||
vec3 colormax = vec3(4, 4, 4);
|
|
||||||
#elif colorDepth == 8
|
|
||||||
// 8-bit is 3:3:2
|
|
||||||
vec3 colormax = vec3(8, 8, 4);
|
|
||||||
#elif colorDepth == 12
|
|
||||||
vec3 colormax = vec3(16, 16, 16);
|
|
||||||
#elif colorDepth == 15
|
|
||||||
vec3 colormax = vec3(32, 32, 32);
|
|
||||||
#elif colorDepth == 18
|
|
||||||
vec3 colormax = vec3(64, 64, 64);
|
|
||||||
#elif colorDepth == 24
|
|
||||||
vec3 colormax = vec3(256, 256, 256);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if monoPalette == MONOCHROME_BW
|
|
||||||
vec3 monoHigh = vec3(1);
|
|
||||||
vec3 monoLow = vec3(0);
|
|
||||||
#elif monoPalette == MONOCHROME_DOTMATRIX
|
|
||||||
vec3 monoHigh = vec3(0.31, 0.40, 0.03);
|
|
||||||
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
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
|
|
||||||
#define pixelSize 2 // [1 2 4 8 16]
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ const float centerDepthSmoothHalfLife = 16f;
|
||||||
vec2 depthOfField() {
|
vec2 depthOfField() {
|
||||||
float depth = texture2D(depthtex1, texcoord).x;
|
float depth = texture2D(depthtex1, texcoord).x;
|
||||||
float distance = depth - centerDepthSmooth;
|
float distance = depth - centerDepthSmooth;
|
||||||
int stops = max(min(int(sqrt(distance * 256)), 5), 0);
|
int stops = max(min(int(distance * 96), 5), 0);
|
||||||
|
|
||||||
#if pixelSize > 1
|
#if pixelSize > 1
|
||||||
float virtualSize = pow(float(pixelSize), 1 + stops);
|
float virtualSize = pow(float(pixelSize), 1 + stops);
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
|
|
||||||
vec2 neighborOffset = vec2(1 / viewWidth, 0);
|
|
||||||
|
|
||||||
float avg(float l, float c, float r) {
|
|
||||||
return (l + c + r) / 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 hblur() {
|
|
||||||
vec3 center = texture2D(gcolor, texcoord).rgb;
|
|
||||||
|
|
||||||
vec3 sum = vec3(0);
|
|
||||||
int count = 0;
|
|
||||||
for(int x = -2; x < 2; x++) {
|
|
||||||
vec2 pos = texcoord - (neighborOffset * x);
|
|
||||||
if(pos.x >= 0 && pos.x < viewWidth) {
|
|
||||||
sum += texture2D(gcolor, pos).rgb;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return sum / count;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
|
|
||||||
//#define interlacing
|
|
||||||
|
|
||||||
#ifdef interlacing
|
|
||||||
uniform sampler2D colortex1;
|
|
||||||
const bool colortex1Clear = false;
|
|
||||||
|
|
||||||
uniform int frameCounter;
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
|
|
||||||
#include "/var/scanline.glsl"
|
|
||||||
|
|
||||||
#define scanline 0 // [0 1 2]
|
|
||||||
|
|
||||||
vec3 scanlines(vec3 color) {
|
|
||||||
#if scanline == SCANLINE_SOFT
|
|
||||||
if(mod(int(gl_FragCoord.y / pixelSize * 2), 2) == 0)
|
|
||||||
color.rgb *= 0.95;
|
|
||||||
else
|
|
||||||
color.rgb /= 0.95;
|
|
||||||
#elif scanline == SCANLINE_HARD
|
|
||||||
if(mod(int(gl_FragCoord.y / pixelSize), 2) == 0)
|
|
||||||
color.rgb *= 0.5;
|
|
||||||
#endif
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
|
|
||||||
#include "/var/signal.glsl"
|
|
||||||
|
|
||||||
#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 = luminance(color);
|
|
||||||
float i = dot(color, vec3(0.596, -.274, -.322));
|
|
||||||
float q = dot(color, vec3(0.211, -.523, 0.312));
|
|
||||||
|
|
||||||
// faux ntsc signal
|
|
||||||
float carrier = 6.283 * 3.570 * gl_FragCoord.x; // 2π * 3.57MHz * x
|
|
||||||
float phase = sin(carrier) * i + cos(carrier) * q;
|
|
||||||
float quad = cos(carrier) * i - sin(carrier) * q;
|
|
||||||
|
|
||||||
// decode faux signal
|
|
||||||
#if wire == WIRE_COMPOSITE
|
|
||||||
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);
|
|
||||||
#endif
|
|
||||||
i = quad * cos(carrier);
|
|
||||||
q = phase * sin(carrier);
|
|
||||||
|
|
||||||
// convert back to RGB
|
|
||||||
vec3 yiqColor = vec3(y, i, q);
|
|
||||||
|
|
||||||
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 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;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
|
#if worldCurvature == 1
|
||||||
#include "/var/world.glsl"
|
float z = gl_Position.z * gl_Position.z;
|
||||||
|
gl_Position.y -= z / 256;
|
||||||
#define worldCurvature 0 // [0 1 2]
|
#elif worldCurvature == 2
|
||||||
#define worldRadius 512 // [1024 512 256 -256]
|
vec2 xz = gl_Position.xz;
|
||||||
|
gl_Position.y -= ceil(( dot(xz, xz) * 5 ) / 512) / 5;
|
||||||
void world_curvature() {
|
#endif
|
||||||
#if worldCurvature == CURVATURE_CYLINDER
|
|
||||||
float z = gl_Position.z * gl_Position.z;
|
|
||||||
gl_Position.y -= 2 * z / worldRadius;
|
|
||||||
#elif worldCurvature == CURVATURE_ROUND
|
|
||||||
vec2 xz = gl_Position.xz;
|
|
||||||
gl_Position.y -= round(( dot(xz, xz) / worldRadius ) * 8) / 8;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,23 @@
|
||||||
sliders=pixelSize colorDepth hueBits satBits valBits vWarp worldRadius
|
sliders=pixelSize hueSteps satSteps valSteps rgbSteps vWarp
|
||||||
|
|
||||||
# -- PROFILES --
|
# -- PROFILES --
|
||||||
profile.DEFAULT=pixelSize=2 colorMode=0 dithering hueBits=2 satBits=2 valBits=2 vWarp=0 !tWarp !hBlur !interlacing
|
profile.DEFAULT=pixelSize=2 colorMode=0 dithering hueSteps=4 satSteps=4 valSteps=4 vWarp=0 !tWarp !hBlur
|
||||||
profile.AEON=pixelSize=1 colorMode=0 dithering hueBits=3 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
|
||||||
profile.DOS=pixelSize=4 colorMode=1 dithering colorDepth=3 vWarp=1 !tWarp !hBlur !interlacing
|
profile.DOS=pixelSize=4 colorMode=1 dithering rgbSteps=2 vWarp=1 !tWarp !hBlur
|
||||||
profile.DOTMATRIX=pixelSize=4 colorMode=1 colorDepth=1 monoPalette=1 dithering vWarp=1 !tWarp !hBlur !interlacing
|
profile.PSX=pixelSize=2 colorMode=1 !dithering rgbSteps=16 vWarp=2 tWarp !hBlur
|
||||||
profile.EIGHTBIT=pixelSize=4 colorMode=1 dithering colorDepth=8 vWarp=0 !tWarp !hBlur !interlacing
|
profile.REALITY=profile.PSX !tWarp hBlur
|
||||||
profile.OBRADINN=pixelSize=2 colorMode=1 colorDepth=1 monoPalette=0 dithering vWarp=0 !tWarp !hBlur !interlacing
|
profile.VR32=pixelSize=8 colorMode=0 !dithering hueSteps=2 satSteps=2 valSteps=2 vWarp=1 !tWarp !hBlur
|
||||||
profile.PSX=pixelSize=2 colorMode=1 !dithering colorDepth=24 vWarp=2 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 --
|
# -- SCREENS --
|
||||||
# default
|
# default
|
||||||
screen=<profile> <empty> <empty> <empty> pixelSize <empty> [COLOR] [SCREEN] [CONSOLE] [FX]
|
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 hueBits satBits valBits
|
screen.COLOR=colorMode dithering <empty> rgbSteps <empty> <empty> hueSteps satSteps valSteps
|
||||||
|
|
||||||
# screen effects
|
# screen effects
|
||||||
screen.SCREEN=signal wire interlacing scanline <empty> <empty> aberration
|
screen.SCREEN=<empty>
|
||||||
|
|
||||||
# console effects
|
# console effects
|
||||||
screen.CONSOLE.columns=1
|
screen.CONSOLE.columns=1
|
||||||
|
@ -29,7 +26,7 @@ screen.PSX=vWarp tWarp # playstation
|
||||||
screen.REALITY=hBlur # nintendo 64
|
screen.REALITY=hBlur # nintendo 64
|
||||||
|
|
||||||
# custom effects
|
# custom effects
|
||||||
screen.FX=dof dofRes <empty> <empty> worldCurvature worldRadius
|
screen.FX=dof dofRes worldCurvature
|
||||||
|
|
||||||
# -- CONDITIONALS --
|
# -- CONDITIONALS --
|
||||||
gbuffers_hand.enabled=tWarp
|
gbuffers_hand.enabled=tWarp
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
#define SCANLINE_SOFT 1
|
|
||||||
#define SCANLINE_HARD 2
|
|
||||||
#define SCANLINE_STRETCH 3
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
|
|
||||||
#define SIGNAL_RGB 0
|
|
||||||
#define SIGNAL_NTSC 1
|
|
||||||
#define SIGNAL_PAL 2
|
|
||||||
|
|
||||||
#define WIRE_COMPOSITE 0
|
|
||||||
#define WIRE_SVIDEO 1
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
|
|
||||||
// world curvature IDs
|
|
||||||
#define CURVATURE_OFF 0
|
|
||||||
#define CURVATURE_CYLINDER 1
|
|
||||||
#define CURVATURE_ROUND 2
|
|
||||||
|
|
Loading…
Reference in a new issue