postfx: scanlines analítiques amb smoothstep a l'estil crtpi, exposant forma per preset YAML

This commit is contained in:
JailDesigner committed 2026-04-20 20:57:14 +02:00
1 parent 4dc2654a66
commit c9e6261cf1
8 files changed
+1287 -901

No files matched your search

@@ -11,20 +11,28 @@
#include "core/rendering/shader_backend.hpp"
// Uniforms enviats al fragment stage cada frame.
// Han de coincidir amb l'estructura MSL/GLSL (48 bytes, alineats a 16).
// Han de coincidir amb l'estructura MSL/GLSL (64 bytes = 4 × vec4, alineats a 16).
struct PostFXUniforms {
// vec4 #0
float vignette_strength;
float chroma_strength;
float scanline_strength;
float screen_height;
// vec4 #1
float mask_strength;
float gamma_strength;
float curvature;
float bleeding;
// vec4 #2
float pixel_scale;
float time;
float oversample;
float flicker;
// vec4 #3 — paràmetres de scanlines exposats al preset YAML
float scan_dark_ratio;
float scan_dark_floor;
float scan_edge_soft;
float pad3;
};
namespace Rendering {
@@ -96,6 +104,11 @@ namespace Rendering {
.time = 0.0F,
.oversample = 1.0F,
.flicker = 0.0F,
// Defaults canònics: 2/3 brillant + 1/3 fosca, brillantor 42%, suavitzat complet (1 px físic).
.scan_dark_ratio = 0.333F,
.scan_dark_floor = 0.42F,
.scan_edge_soft = 1.0F,
.pad3 = 0.0F,
};
int game_width_{0};