Compare commits

..

No commits in common. "12b71f2bb983e2bf67366b98a548b8b8b0f8d046" and "8d26a45d92b37d317dbc9925be02d8dd5a49c83b" have entirely different histories.

17 changed files with 19 additions and 164 deletions

View file

@ -1,18 +1,15 @@
# ɅEON 199X
A Minecraft demake shader and my fork of [SlinkousArt's Aeon Shader](https://github.com/slinkousart/aeon),
aimed at providing a variety of effects in the vein of its parent project.
My fork of [Aeon Shader](https://github.com/slinkousart/aeon), aimed at
expanding its concept to other "retro" graphic effects.
## Features
- Color depth reduction
- Depth of Field
- Dithering
- Downscaling
- Horizontal Blur
- Screen-Space Vertex Warping
- Affine Texture Warping
- World Curvature
- PSX Vertex Warping
- PSX Texture Warping
## Acknowledgements

View file

@ -1,8 +1,5 @@
#version 120
#define pixelSize 2 // the size of pixels [1 2 4 8 16]
float renderRes = pixelSize;
#define dithering // whether or not to apply dithering
#define colorMode 0 // hsv/rgb [0 1]
@ -12,14 +9,14 @@ float renderRes = pixelSize;
#define rgbSteps 4 // the number of rgb values to use [2 4 8 16 32 64]
#define pixelSize 2 // the size of pixels [1 2 4 8 16]
uniform sampler2D gcolor;
uniform sampler2D colortex1;
uniform float viewWidth, viewHeight;
varying vec2 texcoord;
#include "/module/dof.frag"
// All components are in the range [0…1], including hue.
vec3 rgb2hsv(vec3 c)
{
@ -64,9 +61,7 @@ const int indexMatrix8x8[64] = int[](0, 32, 8, 40, 2, 34, 10, 42,
63, 31, 55, 23, 61, 29, 53, 21);
float indexValue() {
#if defined(dof) && defined(dofRes)
vec2 coord = gl_FragCoord.xy / renderRes;
#elif pixelSize > 1
#if pixelSize > 1
vec2 coord = gl_FragCoord.xy / pixelSize;
#else
vec2 coord = gl_FragCoord.xy;
@ -121,9 +116,7 @@ float dither(float color, float dithersteps) {
void main() {
// adjust texture coordinate based on pixel size if needed
vec2 newcoord = texcoord;
#ifdef dof
newcoord = depthOfField();
#elif pixelSize > 1
#if pixelSize > 1
vec2 view = vec2(viewWidth, viewHeight) / float(pixelSize);
float offset = (ceil(pixelSize * 0.5) - 0.5) / float(pixelSize);
newcoord = (floor(newcoord * view) + offset) / view;

View file

@ -1,21 +0,0 @@
#version 120
#define pixelSize // [1 2 4 8 16]
//#define hBlur
varying vec2 texcoord;
uniform sampler2D gcolor;
uniform float viewWidth;
#include "/module/horizontal_blur.frag"
void main() {
#ifdef hBlur
vec3 blurred = hblur();
gl_FragData[0] = vec4(blurred, 1);
#else
gl_FragData[0] = texture2D(gcolor, texcoord);
#endif
}

View file

@ -1,3 +0,0 @@
#version 120
#include "/module/empty.vert"

View file

@ -2,8 +2,6 @@
#define pixelSize 2 // [1 2 4 8 16]
#define worldCurvature 0 // [0 1 2]
varying vec2 texcoord;
varying vec4 color;
varying vec2 lmcoord;
@ -28,9 +26,5 @@ void main() {
#ifdef tWarp
texture_warp();
#endif
#ifndef NON_WORLD
#include "/module/world.vert"
#endif
}

View file

@ -1 +0,0 @@
#include "/gbuffers_basic.fsh"

View file

@ -1,2 +0,0 @@
#define NON_WORLD
#include "/gbuffers_basic.vsh"

View file

@ -1,6 +1,5 @@
#define tWarp_mod 1.5
#define NON_WORLD
#include "/gbuffers_basic.vsh"

View file

@ -1 +0,0 @@
#include "/gbuffers_basic.fsh"

View file

@ -1,2 +0,0 @@
#define NON_WORLD
#include "/gbuffers_basic.vsh"

View file

@ -1 +0,0 @@
#include "/gbuffers_basic.fsh"

View file

@ -1,2 +0,0 @@
#define NON_WORLD
#include "/gbuffers_basic.vsh"

View file

@ -3,7 +3,6 @@ profile.DEFAULT=Default
profile.AEON=Aeon Upstream
profile.DOS=DOS
profile.PSX=PSX
profile.REALITY=Project Reality
profile.VR32=VR32
option.pixelSize=Downscaling
@ -23,13 +22,9 @@ option.hueSteps=Hue Depth
option.satSteps=Saturation Depth
option.valSteps=Value Depth
screen.SCREEN=Screen
screen.CONSOLE=Consoles
screen.PSX=PSX (1994)
screen.PSX=PSX
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 PSX
value.vWarp.0=Off
value.vWarp.1=Minimal (1x)
value.vWarp.2=Low (2x)
@ -38,21 +33,5 @@ value.vWarp.8=High (8x)
value.vWarp.16=Extreme (16x)
value.vWarp.32=Silly (32x)
option.tWarp=Texture Warping
option.tWarp.comment=Emulates affine texture mapping responsible for warping textures on the Playstation
screen.REALITY=Project Reality (1996)
option.hBlur=Horizontal Blur
option.hBlur.comment=Emulates the blur responsible for reducing LCD clarity on the N64
screen.FX=FX
option.dof=Depth of Field
option.dof.comment=Downscale out-of-focus objects
option.dofRes=DoF Dither
option.dofRes.comment=Whether DoF focus affects dither resolution.
value.dofRes.0=Static
value.dofRes.1=Dynamic
option.worldCurvature=World Curvature
value.worldCurvature.0=Off
value.worldCurvature.1=Cylinder
value.worldCurvature.2=Round
option.tWarp.comment=Emulates affine texture mapping responsible for warping textures on the PSX

View file

@ -1,28 +0,0 @@
//#define dof
#define dofRes
uniform float centerDepthSmooth;
uniform sampler2D depthtex1;
const float centerDepthSmoothHalfLife = 16f;
vec2 depthOfField() {
float depth = texture2D(depthtex1, texcoord).x;
float distance = depth - centerDepthSmooth;
int stops = max(min(int(distance * 96), 5), 0);
#if pixelSize > 1
float virtualSize = pow(float(pixelSize), 1 + stops);
#else
float virtualSize = pow(2f, stops);
#endif
vec2 view = vec2(viewWidth, viewHeight) / virtualSize;
float offset = (ceil(virtualSize * 0.5) - 0.5) / virtualSize;
#ifdef dofRes
renderRes = virtualSize;
#endif
return (floor(texcoord * view) + offset) / view;
}

View file

@ -1,28 +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;
vec2 leftPos = texcoord - neighborOffset;
vec2 rightPos = texcoord + neighborOffset;
vec3 left;
if(leftPos.x >= 0)
left = texture2D(gcolor, leftPos).rgb;
else
left = center;
vec3 right;
if(rightPos.x >= 0)
right = texture2D(gcolor, rightPos).rgb;
else
right = center;
return vec3(avg(left.r, center.r, right.r), avg(left.g, center.g, right.g), avg(left.b, center.b, right.b));
}

View file

@ -1,8 +0,0 @@
#if worldCurvature == 1
float z = gl_Position.z * gl_Position.z;
gl_Position.y -= z / 256;
#elif worldCurvature == 2
vec2 xz = gl_Position.xz;
gl_Position.y -= ceil(( dot(xz, xz) * 5 ) / 512) / 5;
#endif

View file

@ -1,32 +1,22 @@
sliders=pixelSize hueSteps satSteps valSteps rgbSteps vWarp
# -- PROFILES --
profile.DEFAULT=pixelSize=2 colorMode=0 dithering hueSteps=4 satSteps=4 valSteps=4 vWarp=0 !tWarp !hBlur
profile.AEON=pixelSize=1 colorMode=0 dithering hueSteps=8 satSteps=4 valSteps=4 vWarp=0 !tWarp !hBlur
profile.DOS=pixelSize=4 colorMode=1 dithering rgbSteps=2 vWarp=1 !tWarp !hBlur
profile.PSX=pixelSize=2 colorMode=1 !dithering rgbSteps=16 vWarp=2 tWarp !hBlur
profile.REALITY=profile.PSX !tWarp hBlur
profile.VR32=pixelSize=8 colorMode=0 !dithering hueSteps=2 satSteps=2 valSteps=2 vWarp=1 !tWarp !hBlur
profile.DEFAULT=pixelSize=2 colorMode=0 dithering hueSteps=4 satSteps=4 valSteps=4 vWarp=0 !tWarp
profile.AEON=pixelSize=1 colorMode=0 dithering hueSteps=8 satSteps=4 valSteps=4 vWarp=0 !tWarp
profile.DOS=pixelSize=4 colorMode=1 dithering rgbSteps=2 vWarp=1 !tWarp
profile.PSX=pixelSize=2 colorMode=1 !dithering rgbSteps=16 vWarp=2 tWarp
profile.VR32=pixelSize=8 colorMode=0 !dithering hueSteps=2 satSteps=2 valSteps=2 vWarp=1 !tWarp
# -- SCREENS --
# default
screen=<profile> <empty> pixelSize <empty> [COLOR] [SCREEN] [CONSOLE] [FX]
screen=<profile> <empty> pixelSize <empty> [COLOR] [PSX]
# colors
screen.COLOR.columns=3
screen.COLOR=colorMode dithering <empty> rgbSteps <empty> <empty> hueSteps satSteps valSteps
# screen effects
screen.SCREEN=<empty>
# console effects
screen.CONSOLE.columns=1
screen.CONSOLE=[PSX] [REALITY]
screen.PSX=vWarp tWarp # playstation
screen.REALITY=hBlur # nintendo 64
# custom effects
screen.FX=dof dofRes worldCurvature
# psx
screen.PSX=vWarp tWarp
# -- CONDITIONALS --
gbuffers_hand.enabled=tWarp