mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
Ocarina anti-aliases every frame with its own SMAA in three compute passes after the bloom composite. The new aa setting (nx2navi.ini aa, the Screen tab's Anti-aliasing row) keeps that by default. off, fxaa and smaa leave out the game's edge and weight passes and replace its composition with a pass of our own that writes the same square-rooted RGB9E5 words into the scene target: a plain copy, an edge smoothing written here, or the SMAA reference implementation with its area and search textures (MIT). taa is DLSS or FSR 3.1 at the scene's size, which the row sets through the upscaler; while either runs, the game's SMAA stays whatever aa says. The game's passes are known by a hash of their guest code. The shader build now also rebuilds a header when a file its source includes changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
1.1 KiB
GLSL
22 lines
1.1 KiB
GLSL
// Settings and resources shared by the SMAA passes (runtime/vk_aa.c; smaa_*.comp). smaa.glsl holds the SMAA reference
|
|
// implementation, unmodified; its pixel- and vertex-shader functions run here inside compute shaders, one invocation
|
|
// per pixel, with the texture coordinate of the pixel's centre. Its "discard" of a pixel without edges becomes nothing:
|
|
// the edge pass then stores the zero edges it found, which is what the next pass reads for such a pixel anyway.
|
|
#extension GL_GOOGLE_include_directive : require
|
|
layout(local_size_x = 8, local_size_y = 8) in;
|
|
layout(push_constant) uniform Push {
|
|
vec4 metrics; // 1 / width, 1 / height, width, height
|
|
} pc;
|
|
#define SMAA_RT_METRICS pc.metrics
|
|
#define SMAA_GLSL_4 1
|
|
#define SMAA_PRESET_ULTRA 1
|
|
#define discard
|
|
#include "smaa.glsl"
|
|
|
|
// the pixel this invocation works on and its centre's texture coordinate; false past the image's edge
|
|
bool smaa_pixel(out ivec2 p, out vec2 uv) {
|
|
p = ivec2(gl_GlobalInvocationID.xy);
|
|
uv = (vec2(p) + 0.5) * pc.metrics.xy;
|
|
return p.x < int(pc.metrics.z) && p.y < int(pc.metrics.w);
|
|
}
|