PostFXParams/Preset amb chroma_min/max + scan_*; presets AEE migrats

This commit is contained in:
2026-05-17 15:06:42 +02:00
parent dcb004b5a7
commit 96763847fb
5 changed files with 74 additions and 128 deletions
+21 -23
View File
@@ -145,9 +145,6 @@ namespace Options {
if (node.contains("shader_enabled")) {
video.shader_enabled = node["shader_enabled"].get_value<bool>();
}
if (node.contains("supersampling")) {
video.supersampling = node["supersampling"].get_value<bool>();
}
if (node.contains("scaling_mode")) {
auto s = node["scaling_mode"].get_value<std::string>();
if (s == "disabled") {
@@ -172,9 +169,6 @@ namespace Options {
auto s = node["texture_filter"].get_value<std::string>();
video.texture_filter = (s == "linear") ? TextureFilter::LINEAR : TextureFilter::NEAREST;
}
if (node.contains("downscale_algo")) {
video.downscale_algo = node["downscale_algo"].get_value<int>();
}
if (node.contains("internal_resolution")) {
video.internal_resolution = node["internal_resolution"].get_value<int>();
video.internal_resolution = std::max(video.internal_resolution, 1);
@@ -344,7 +338,6 @@ namespace Options {
file << "video:\n";
file << " gpu_acceleration: " << (video.gpu_acceleration ? "true" : "false") << "\n";
file << " shader_enabled: " << (video.shader_enabled ? "true" : "false") << "\n";
file << " supersampling: " << (video.supersampling ? "true" : "false") << "\n";
{
const char* m = nullptr;
switch (video.scaling_mode) {
@@ -370,7 +363,6 @@ namespace Options {
file << " vsync: " << (video.vsync ? "true" : "false") << "\n";
file << " aspect_ratio_4_3: " << (video.aspect_ratio_4_3 ? "true" : "false") << "\n";
file << " texture_filter: " << (video.texture_filter == TextureFilter::LINEAR ? "linear" : "nearest") << " # nearest|linear\n";
file << " downscale_algo: " << video.downscale_algo << " # 0=bilinear, 1=Lanczos2, 2=Lanczos3\n";
file << " internal_resolution: " << video.internal_resolution << " # multiplicador enter font, clampat a max_zoom\n";
file << " current_shader: " << video.current_shader << "\n";
file << " current_postfx_preset: " << video.current_postfx_preset << "\n";
@@ -481,22 +473,24 @@ namespace Options {
// Escriure defaults
std::ofstream out(postfx_file_path);
if (out.is_open()) {
out << "# Aventures En Egipte - PostFX Shader Presets\n\n";
out << "# Aventures En Egipte - PostFX Shader Presets\n";
out << "# chroma_min/max: min == max → estàtic; min != max → pulsa sinusoïdalment.\n";
out << "# scan_dark_ratio/floor/edge_soft: forma analítica de les scanlines.\n\n";
out << "presets:\n";
out << " - name: \"CRT\"\n vignette: 0.6\n scanlines: 0.7\n chroma: 0.15\n mask: 0.6\n gamma: 0.8\n";
out << " - name: \"NTSC\"\n vignette: 0.4\n scanlines: 0.5\n chroma: 0.2\n mask: 0.4\n gamma: 0.5\n bleeding: 0.6\n";
out << " - name: \"CURVED\"\n vignette: 0.5\n scanlines: 0.6\n chroma: 0.1\n mask: 0.5\n gamma: 0.7\n curvature: 0.8\n";
out << " - name: \"SCANLINES\"\n scanlines: 0.8\n vignette: 0.0\n chroma: 0.0\n";
out << " - name: \"SUBTLE\"\n vignette: 0.3\n scanlines: 0.4\n chroma: 0.05\n gamma: 0.3\n";
out << " - name: \"CRT LIVE\"\n vignette: 0.5\n scanlines: 0.6\n chroma: 0.3\n mask: 0.3\n gamma: 0.4\n curvature: 0.3\n bleeding: 0.4\n flicker: 0.8\n";
out << " - name: \"CRT\"\n vignette: 0.6\n scanlines: 0.7\n chroma_min: 0.15\n chroma_max: 0.15\n mask: 0.6\n gamma: 0.8\n";
out << " - name: \"NTSC\"\n vignette: 0.4\n scanlines: 0.5\n chroma_min: 0.2\n chroma_max: 0.2\n mask: 0.4\n gamma: 0.5\n bleeding: 0.6\n";
out << " - name: \"CURVED\"\n vignette: 0.5\n scanlines: 0.6\n chroma_min: 0.1\n chroma_max: 0.1\n mask: 0.5\n gamma: 0.7\n curvature: 0.8\n";
out << " - name: \"SCANLINES\"\n scanlines: 0.8\n vignette: 0.0\n chroma_min: 0.0\n chroma_max: 0.0\n";
out << " - name: \"SUBTLE\"\n vignette: 0.3\n scanlines: 0.4\n chroma_min: 0.05\n chroma_max: 0.05\n gamma: 0.3\n";
out << " - name: \"CRT LIVE\"\n vignette: 0.5\n scanlines: 0.6\n chroma_min: 0.3\n chroma_max: 0.3\n mask: 0.3\n gamma: 0.4\n curvature: 0.3\n bleeding: 0.4\n flicker: 0.8\n";
out.close();
}
postfx_presets.push_back({"CRT", 0.6F, 0.7F, 0.15F, 0.6F, 0.8F});
postfx_presets.push_back({"NTSC", 0.4F, 0.5F, 0.2F, 0.4F, 0.5F, 0.0F, 0.6F});
postfx_presets.push_back({"CURVED", 0.5F, 0.6F, 0.1F, 0.5F, 0.7F, 0.8F});
postfx_presets.push_back({"SCANLINES", 0.0F, 0.8F});
postfx_presets.push_back({"SUBTLE", 0.3F, 0.4F, 0.05F, 0.0F, 0.3F});
postfx_presets.push_back({"CRT LIVE", 0.5F, 0.6F, 0.3F, 0.3F, 0.4F, 0.3F, 0.4F, 0.8F});
postfx_presets.push_back({.name = "CRT", .vignette = 0.6F, .scanlines = 0.7F, .chroma_min = 0.15F, .chroma_max = 0.15F, .mask = 0.6F, .gamma = 0.8F});
postfx_presets.push_back({.name = "NTSC", .vignette = 0.4F, .scanlines = 0.5F, .chroma_min = 0.2F, .chroma_max = 0.2F, .mask = 0.4F, .gamma = 0.5F, .bleeding = 0.6F});
postfx_presets.push_back({.name = "CURVED", .vignette = 0.5F, .scanlines = 0.6F, .chroma_min = 0.1F, .chroma_max = 0.1F, .mask = 0.5F, .gamma = 0.7F, .curvature = 0.8F});
postfx_presets.push_back({.name = "SCANLINES", .vignette = 0.0F, .scanlines = 0.8F, .chroma_min = 0.0F, .chroma_max = 0.0F});
postfx_presets.push_back({.name = "SUBTLE", .vignette = 0.3F, .scanlines = 0.4F, .chroma_min = 0.05F, .chroma_max = 0.05F, .gamma = 0.3F});
postfx_presets.push_back({.name = "CRT LIVE", .vignette = 0.5F, .scanlines = 0.6F, .chroma_min = 0.3F, .chroma_max = 0.3F, .mask = 0.3F, .gamma = 0.4F, .curvature = 0.3F, .bleeding = 0.4F, .flicker = 0.8F});
current_postfx_preset = 0;
return true;
}
@@ -514,12 +508,16 @@ namespace Options {
}
parseFloatField(p, "vignette", preset.vignette);
parseFloatField(p, "scanlines", preset.scanlines);
parseFloatField(p, "chroma", preset.chroma);
parseFloatField(p, "chroma_min", preset.chroma_min);
parseFloatField(p, "chroma_max", preset.chroma_max);
parseFloatField(p, "mask", preset.mask);
parseFloatField(p, "gamma", preset.gamma);
parseFloatField(p, "curvature", preset.curvature);
parseFloatField(p, "bleeding", preset.bleeding);
parseFloatField(p, "flicker", preset.flicker);
parseFloatField(p, "scan_dark_ratio", preset.scan_dark_ratio);
parseFloatField(p, "scan_dark_floor", preset.scan_dark_floor);
parseFloatField(p, "scan_edge_soft", preset.scan_edge_soft);
postfx_presets.push_back(preset);
}
}
@@ -528,7 +526,7 @@ namespace Options {
return true;
} catch (const fkyaml::exception& e) {
std::cerr << "Error parsing PostFX YAML: " << e.what() << '\n';
postfx_presets.push_back({"CRT", 0.6F, 0.7F, 0.15F, 0.6F, 0.8F});
postfx_presets.push_back({.name = "CRT", .vignette = 0.6F, .scanlines = 0.7F, .chroma_min = 0.15F, .chroma_max = 0.15F, .mask = 0.6F, .gamma = 0.8F});
current_postfx_preset = 0;
return false;
}