Skip to content

Commit

Permalink
Update to ares v118 release.
Browse files Browse the repository at this point in the history
I'm excited to launch ares v118 today, the first release featuring playable,
full-speed Nintendo 64 emulation!

The new Nintendo 64 emulation is made possible thanks to [Themaister] very
graciously porting his Vulkan-based ParaLLEl-RDP graphics renderer to ares. With
its default settings, it is nearly pixel-perfect to real hardware, and it
optionally supports upscaling to 2x or 4x the original Nintendo 64 resolution,
plus optional supersampling back down to the original resolution (for enhanced
anti-aliasing) if desired. The Vulkan support requires an appropriate graphics
card, and either Windows or Linux. At this time, Vulkan is not available for
macOS nor the BSDs.

Also new for the Nintendo 64 core in this release is Rumble Pak, Cartridge Pak,
SRAM, EEPROM, and Flash save support. Note that for right now, the Rumble Pak
will only be enabled for games which use internal saves (SRAM, EEPROM, and
Flash.) That does not cover all Rumble Pak-capable games. The option to choose
between Rumble Paks and Cartridge Paks will be added to a future release.

For the PlayStation core, [Luke Usher] provided two rendering fixes that allow
Final Fantasy VII and Tony Hawk's Pro Skater to be fully playable!

Right now, approximately 33% of the Nintendo 64 library is fully playable, and
about 67% of the PlayStation library is fully playable. Each core has only been
under active development for about one month each, so they both have a long way
to go. Please treat these early releases as tech samples, rather than finished
emulation cores.

Further, note that the Nintendo 64 and PlayStation cores employ cached
interpreters. This is a middle-ground between the accuracy of interpreters and
the performance of dynamic recompilers. As such, ares' system requirements will
be a bit higher than traditional emulators for these systems. Presuming no
background task interference or CPU throttling, generally speaking, a Ryzen 5
2600 or better CPU should get you to around ~120fps in the average case, and
~60fps in the worst case.

The source code has also been released under the terms of the Creative Commons
BY-NC-ND 4.0 license.

[Themaister]: http://github.com/Themaister/
[Luke Usher]: https://twitter.com/LukeUsher1
  • Loading branch information
near-san committed Feb 20, 2021
1 parent 43af5c2 commit 44bdc53
Show file tree
Hide file tree
Showing 198 changed files with 141,452 additions and 239 deletions.
120 changes: 66 additions & 54 deletions ares/Shaders/AANN.shader/AANN.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#version 150

//anti-aliased nearest-neighbor
// AntiAliased Nearest Neighbor
// by jimbo1qaz and wareya
// Licensed MIT

precision highp float;

Expand All @@ -14,68 +16,78 @@ in Vertex {

out vec4 fragColor;

vec4 vpow(vec4 n, float e) {
return vec4(pow(n.x, e), pow(n.y, e), pow(n.z, e), pow(n.w, e));
}
#define NOT(fl) (1-fl)
#define YES(fl) fl

vec4 toLQV(vec3 c) {
return vec4(c.r, c.g, c.b, c.r * 0.2989 + c.g * 0.5870 + c.b * 0.1140);
vec4 vpow(vec4 n, float e)
{
return vec4(pow(n.x, e), pow(n.y, e), pow(n.z, e), pow(n.w, e));
}

vec3 fromLQV(vec4 c) {
float f = c.w / (c.r * 0.2989 + c.g * 0.5870 + c.b * 0.1140);
return vec3(c.rgb) * f;
vec4 getLQV(vec3 mine) {
return vec4
( mine.r
, mine.g
, mine.b
, mine.r*0.2989 + mine.g*0.5870 + mine.b*0.1140);
}

vec3 percent(float ssize, float tsize, float coord) {
float minfull = (coord * tsize - 0.5) / tsize * ssize;
float maxfull = (coord * tsize + 0.5) / tsize * ssize;
float realfull = floor(maxfull);

if(minfull > realfull) {
return vec3(
1,
(realfull + 0.5) / ssize,
(realfull + 0.5) / ssize
);
}

return vec3(
(maxfull - realfull) / (maxfull - minfull),
(realfull - 0.5) / ssize,
(realfull + 0.5) / ssize
);
vec3 fromLQV(vec4 mine) {
float f = mine.w/(mine.r*0.2989 + mine.g*0.5870 + mine.b*0.1140);
return vec3(mine.rgb)*f;
}

void main() {
float srgb = 2.1;
float gamma = 3.0;

vec3 x = percent(sourceSize[0].x, targetSize[0].x, texCoord.x);
vec3 y = percent(sourceSize[0].y, targetSize[0].y, texCoord.y);
vec3 percent(float ssize, float tsize, float coord) {
float minfull = (coord*tsize - 0.5) /tsize*ssize;
float maxfull = (coord*tsize + 0.5) /tsize*ssize;

//get points to interpolate across in linear RGB
vec4 a = toLQV(vpow(texture(source[0], vec2(x[1], y[1])), srgb).rgb);
vec4 b = toLQV(vpow(texture(source[0], vec2(x[2], y[1])), srgb).rgb);
vec4 c = toLQV(vpow(texture(source[0], vec2(x[1], y[2])), srgb).rgb);
vec4 d = toLQV(vpow(texture(source[0], vec2(x[2], y[2])), srgb).rgb);
float realfull = floor(maxfull);

//use perceptual gamma for luminance component
a.w = pow(a.w, 1 / gamma);
b.w = pow(b.w, 1 / gamma);
c.w = pow(c.w, 1 / gamma);
d.w = pow(d.w, 1 / gamma);
if (minfull > realfull) {
return vec3(1, (realfull+0.5)/ssize, (realfull+0.5)/ssize);
}

//interpolate
vec4 gammaLQV =
(1.0 - x[0]) * (1.0 - y[0]) * a +
(0.0 + x[0]) * (1.0 - y[0]) * b +
(1.0 - x[0]) * (0.0 + y[0]) * c +
(0.0 + x[0]) * (0.0 + y[0]) * d;
return vec3(
(maxfull - realfull) / (maxfull - minfull),
(realfull-0.5) / ssize,
(realfull+0.5) / ssize
);
}

//convert luminance gamma back to linear
gammaLQV.w = pow(gammaLQV.w, gamma);

//convert color back to sRGB
fragColor = vpow(vec4(fromLQV(gammaLQV), 1), 1 / srgb);
void main() {
float cheapsrgb = 2.1;
float gamma = 3.0;
vec3 xstuff = percent(sourceSize[0].x, targetSize[0].x, texCoord.x);
vec3 ystuff = percent(sourceSize[0].y, targetSize[0].y, texCoord.y);

float xkeep = xstuff[0];
float ykeep = ystuff[0];

// get points to interpolate across, in linear rgb
vec4 a = getLQV(vpow(texture(source[0],vec2(xstuff[1],ystuff[1])), cheapsrgb).rgb);
vec4 b = getLQV(vpow(texture(source[0],vec2(xstuff[2],ystuff[1])), cheapsrgb).rgb);
vec4 c = getLQV(vpow(texture(source[0],vec2(xstuff[1],ystuff[2])), cheapsrgb).rgb);
vec4 d = getLQV(vpow(texture(source[0],vec2(xstuff[2],ystuff[2])), cheapsrgb).rgb);

// use perceptual gamma for luminance component
a.w = pow(a.w, 1/gamma);
b.w = pow(b.w, 1/gamma);
c.w = pow(c.w, 1/gamma);
d.w = pow(d.w, 1/gamma);

// interpolate
vec4 gammaLQVresult =
NOT(xkeep)*NOT(ykeep)*a +
YES(xkeep)*NOT(ykeep)*b +
NOT(xkeep)*YES(ykeep)*c +
YES(xkeep)*YES(ykeep)*d;

// change luminance gamma back to linear
vec4 LQVresult = gammaLQVresult;
LQVresult.w = pow(gammaLQVresult.w, gamma);

// convert back to srgb; lqv -> lrgb -> srgb
vec4 c1 = vpow(vec4(fromLQV(LQVresult), 1), 1/cheapsrgb);

fragColor = c1;
}
4 changes: 2 additions & 2 deletions ares/Shaders/AANN.shader/manifest.bml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ input

program
fragment: AANN.fs

output
filter: nearest
filter: nearest
Loading

0 comments on commit 44bdc53

Please sign in to comment.