Files
NX2navi/runtime/shaders/smaa_blend.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

20 lines
842 B
Plaintext

#version 450
// SMAA pass 3 (runtime/vk_aa.c): neighbourhood blending of the game's composite by the weights, in linear light (as SMAA
// asks of a picture read through an sRGB view), stored into the game's scene target as its raw RGB9E5 words of the
// square root (aa_common.glsl).
#include "smaa_setup.glsl"
#include "aa_common.glsl"
layout(binding = 0) uniform sampler2D color; // the game's composite, linear filtering
layout(binding = 1) uniform sampler2D weights; // linear filtering
layout(binding = 2, r32ui) uniform writeonly uimage2D dst;
void main() {
ivec2 p;
vec2 uv;
if (!smaa_pixel(p, uv)) return;
vec4 offset;
SMAANeighborhoodBlendingVS(uv, offset);
vec3 c = SMAANeighborhoodBlendingPS(uv, offset, color, weights).rgb;
imageStore(dst, p, uvec4(aa_pack_rgb9e5(aa_encode(c)), 0u, 0u, 0u));
}