eliminades referencies a opengl

This commit is contained in:
2026-03-23 17:04:21 +01:00
parent 58512840a4
commit 270cd1d487
19 changed files with 104 additions and 80 deletions

View File

@@ -131,16 +131,14 @@ fragment float4 postfx_fs(PostVOut in [[stage_in]],
}
// Scanlines — 1 pixel físico oscuro por fila lógica.
// Usa uv.y (independiente del offset de letterbox) con pixel_scale para
// calcular la posición dentro de la fila en coordenadas físicas.
// 3x: 1 dark + 2 bright. 4x: 1 dark + 3 bright.
// bright=3.5×, dark floor=0.42 (mantiene aspecto CRT original).
// Modelo sustractivo: las filas de scanline se oscurecen, las demás no cambian.
// Esto evita el efecto de sobrebrillo en contenido con colores vivos.
if (u.scanline_strength > 0.0f) {
float ps = max(1.0f, round(u.pixel_scale));
float frac_in_row = fract(uv.y * u.screen_height);
float row_pos = floor(frac_in_row * ps);
float is_dark = step(ps - 1.0f, row_pos);
float scan = mix(3.5f, 0.42f, is_dark);
float scan = mix(1.0f, 0.0f, is_dark);
colour *= mix(1.0f, scan, u.scanline_strength);
}
@@ -388,11 +386,11 @@ namespace Rendering {
std::memcpy(mapped, pixels, static_cast<size_t>(width * height * 4));
} else {
// Path con supersampling: expande cada pixel a OS×OS, oscurece última fila.
// Replica la fórmula del shader: mix(3.5, 0.42, scanline_strength).
// Modelo sustractivo: filas normales sin cambio, fila de scanline oscurecida a 0.
auto* out = static_cast<Uint32*>(mapped);
const int OS = oversample_;
const float BRIGHT_MUL = 1.0F + (baked_scanline_strength_ * 2.5F); // rows 0..OS-2
const float DARK_MUL = 1.0F - (baked_scanline_strength_ * 0.58F); // row OS-1
const float BRIGHT_MUL = 1.0F; // rows 0..OS-2: sin cambio
const float DARK_MUL = 1.0F - baked_scanline_strength_; // row OS-1: hasta negro
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {