Files
NX2navi/runtime/shaders/smaa_edge.comp
chrg6 bfe88e503a Add one anti-aliasing setting: the game's SMAA, off, FXAA, SMAA at its Ultra preset, or TAA.
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>
2026-11-11 15:09:16 -05:00

16 lines
559 B
Plaintext

#version 450
// SMAA pass 1 (runtime/vk_aa.c): luma edge detection over pass 0's luma into the edges image (red: an edge on the
// pixel's left, green: on its top).
#include "smaa_setup.glsl"
layout(binding = 0) uniform sampler2D luma; // smaa_encode.comp's, linear filtering
layout(binding = 1, rgba8) uniform writeonly image2D edges;
void main() {
ivec2 p;
vec2 uv;
if (!smaa_pixel(p, uv)) return;
vec4 offset[3];
SMAAEdgeDetectionVS(uv, offset);
imageStore(edges, p, vec4(SMAALumaEdgeDetectionPS(uv, offset, luma), 0.0, 0.0));
}