From a92e62f55fbe19bc2286327ed42c53e2c1f87a35 Mon Sep 17 00:00:00 2001 From: Gabrieli2806 <[tu-email@ejemplo.com]> Date: Fri, 10 Apr 2026 07:33:39 -0500 Subject: [PATCH 1/6] fix: eliminate GUI freeze and widget flash in pipeline config screen - Remove per-frame node.updateWidth() from render(); call it at node creation only - Remove duplicate Pipeline.switchToPresetMode() calls in rebuildUI() and PresetSelector.onClick() to prevent double native build on screen open - Add idempotency guard in Pipeline.switchToPresetMode() to skip rebuild when already on the target preset - Add Pipeline.preparePresetModeUI() / preparePipelineModeUI() lightweight variants that assemble UI data without triggering buildNative() or savePipeline(); used for mode toggle clicks - Initialize preset widgets as hidden (visible=false) to prevent 1-frame flash at position (0,0) before layoutPresetRowWidgets() places them correctly --- .../client/gui/RenderPipelineScreen.java | 21 ++++++----- .../radiance/client/pipeline/Pipeline.java | 36 ++++++++++++++++++- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java b/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java index 89d230f..c7795cc 100644 --- a/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java +++ b/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java @@ -137,11 +137,11 @@ private void rebuildUI() { if (activePreset == null && !presets.isEmpty()) { activePreset = presets.getFirst(); } - Pipeline.switchToPresetMode( + Pipeline.preparePresetModeUI( activePreset != null ? activePreset.name() : "Default"); mode = Mode.PRESET; } else { - Pipeline.switchToPipelineMode(); + Pipeline.preparePipelineModeUI(); mode = Mode.PIPELINE; } rebuildUI(); @@ -201,7 +201,6 @@ private void rebuildUI() { if (activePreset == null && !presets.isEmpty()) { activePreset = presets.get(0); } - Pipeline.switchToPresetMode(activePreset != null ? activePreset.name() : "Default"); applyActivePreset(); } } @@ -209,7 +208,9 @@ private void rebuildUI() { public void refreshPipeline() { nodes.clear(); for (Module module : Pipeline.INSTANCE.getModules()) { - nodes.add(new ModuleNode(module)); + ModuleNode node = new ModuleNode(module); + node.updateWidth(textRenderer); + nodes.add(node); } moduleConnections.clear(); @@ -252,10 +253,6 @@ public void close() { @Override public void render(DrawContext context, int mouseX, int mouseY, float delta) { - for (ModuleNode node : nodes) { - node.updateWidth(textRenderer); - } - this.renderBackground(context, mouseX, mouseY, delta); context.getMatrices().push(); @@ -863,7 +860,9 @@ public boolean onClick(double mouseX, double mouseY) { Module module = selected.loadModule(); module.x = 100; module.y = 100; - nodes.add(new ModuleNode(module)); + ModuleNode newNode = new ModuleNode(module); + newNode.updateWidth(textRenderer); + nodes.add(newNode); return true; } return false; @@ -912,7 +911,7 @@ private void applyActivePreset() { return; } - Pipeline.switchToPresetMode(activePreset.name()); + Pipeline.preparePresetModeUI(activePreset.name()); List modules = new ArrayList<>(Pipeline.INSTANCE.getModules()); @@ -925,6 +924,7 @@ private void applyActivePreset() { for (AttributeConfig cfg : m.attributeConfigs) { List ws = buildPresetWidgets(cfg); for (ClickableWidget w : ws) { + w.visible = false; presetWidgets.add(addDrawableChild(w)); } block.rows.add(new PresetRow(cfg, ws)); @@ -989,7 +989,6 @@ public boolean onClick(double mouseX, double mouseY) { if (index >= 0 && index < options.size()) { activePreset = options.get(index); presetScrollY = 0; - Pipeline.switchToPresetMode(activePreset != null ? activePreset.name() : "Default"); applyActivePreset(); return true; } diff --git a/src/main/java/com/radiance/client/pipeline/Pipeline.java b/src/main/java/com/radiance/client/pipeline/Pipeline.java index bd755b3..e64c997 100644 --- a/src/main/java/com/radiance/client/pipeline/Pipeline.java +++ b/src/main/java/com/radiance/client/pipeline/Pipeline.java @@ -864,10 +864,15 @@ public static void switchToPipelineMode() { } public static void switchToPresetMode(String presetName) { + String processedPresetName = processPresetName(presetName); + if (INSTANCE.mode == PipelineMode.PRESET + && Objects.equals(INSTANCE.activePresetName, processedPresetName)) { + return; + } + List carryOverModules = capturePresetModules(); INSTANCE.mode = PipelineMode.PRESET; - String processedPresetName = processPresetName(presetName); // should set preset name properly assemblePreset(processedPresetName); @@ -884,6 +889,35 @@ public static void switchToPresetMode(String presetName) { build(); } + /** + * Assembles preset pipeline data in memory for UI display only. + * Does NOT call build() or savePipeline() — call those explicitly when applying. + */ + public static void preparePresetModeUI(String presetName) { + String processedPresetName = processPresetName(presetName); + if (INSTANCE.mode == PipelineMode.PRESET + && Objects.equals(INSTANCE.activePresetName, processedPresetName)) { + return; + } + List carryOverModules = capturePresetModules(); + INSTANCE.mode = PipelineMode.PRESET; + assemblePreset(processedPresetName); + PipelineConfigStorage storage = loadConfigStorage(); + if (storage != null && Objects.equals(storage.mode, PipelineMode.PRESET.name()) + && Objects.equals(storage.presetName, INSTANCE.activePresetName)) { + applyPresetModuleOverrides(storage.presetModules); + } + applyPresetModuleOverrides(carryOverModules); + } + + /** + * Sets pipeline mode to PIPELINE for UI display only. + * Does NOT call build() or savePipeline() — call those explicitly when applying. + */ + public static void preparePipelineModeUI() { + INSTANCE.mode = PipelineMode.PIPELINE; + } + public static void assemblePreset(String presetName) { String processedPresetName = processPresetName(presetName); if (processedPresetName == null) { From d61aedbe6175a64689847f3607c1584f4bfeade1 Mon Sep 17 00:00:00 2001 From: Gabrieli2806 <[tu-email@ejemplo.com]> Date: Fri, 10 Apr 2026 07:58:51 -0500 Subject: [PATCH 2/6] fix: skip build on close when no changes, fix mode-toggle and reload dirty state - Add isDirty flag; close() only calls build() when user made actual changes - Attribute widgets (bool, enum, int, float, string, vec3, sliders) fire onChanged callback to set isDirty - Reload button resets isDirty (discards changes) - Mode toggle resets isDirty (discards changes from previous mode) --- .../client/gui/AttributeWidgetUtil.java | 60 ++++++++++++------- .../client/gui/ModuleAttributeScreen.java | 2 +- .../client/gui/RenderPipelineScreen.java | 22 +++++-- 3 files changed, 55 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/radiance/client/gui/AttributeWidgetUtil.java b/src/main/java/com/radiance/client/gui/AttributeWidgetUtil.java index 7bf932e..505946d 100644 --- a/src/main/java/com/radiance/client/gui/AttributeWidgetUtil.java +++ b/src/main/java/com/radiance/client/gui/AttributeWidgetUtil.java @@ -84,42 +84,43 @@ static int totalWidgetWidth(List widgets, int singleWidth, int static List buildWidgets(AttributeConfig cfg, TextRenderer textRenderer, int width, - int vec3ComponentWidth) { + int vec3ComponentWidth, Runnable onChanged) { String type = cfg.type == null ? "" : cfg.type.toLowerCase(Locale.ROOT); if (type.startsWith("enum:")) { - return List.of(buildEnumWidget(cfg, cfg.type.substring(5), width)); + return List.of(buildEnumWidget(cfg, cfg.type.substring(5), width, onChanged)); } if (type.startsWith("int_range:")) { - return List.of(buildIntRange(cfg, cfg.type.substring(10), width)); + return List.of(buildIntRange(cfg, cfg.type.substring(10), width, onChanged)); } if (type.startsWith("float_range:")) { - return List.of(buildFloatRange(cfg, cfg.type.substring(12), width)); + return List.of(buildFloatRange(cfg, cfg.type.substring(12), width, onChanged)); } return switch (type) { - case "bool" -> List.of(buildBoolWidget(cfg, width)); - case "int" -> List.of(buildIntWidget(cfg, textRenderer, width)); - case "float" -> List.of(buildFloatWidget(cfg, textRenderer, width)); - case "string" -> List.of(buildStringWidget(cfg, textRenderer, width)); - case "vec3" -> buildVec3Widget(cfg, textRenderer, vec3ComponentWidth); - default -> List.of(buildStringWidget(cfg, textRenderer, width)); + case "bool" -> List.of(buildBoolWidget(cfg, width, onChanged)); + case "int" -> List.of(buildIntWidget(cfg, textRenderer, width, onChanged)); + case "float" -> List.of(buildFloatWidget(cfg, textRenderer, width, onChanged)); + case "string" -> List.of(buildStringWidget(cfg, textRenderer, width, onChanged)); + case "vec3" -> buildVec3Widget(cfg, textRenderer, vec3ComponentWidth, onChanged); + default -> List.of(buildStringWidget(cfg, textRenderer, width, onChanged)); }; } - private static ClickableWidget buildBoolWidget(AttributeConfig cfg, int width) { + private static ClickableWidget buildBoolWidget(AttributeConfig cfg, int width, Runnable onChanged) { boolean b = "render_pipeline.true".equalsIgnoreCase(cfg.value); return ButtonWidget.builder( Text.translatable(b ? "render_pipeline.true" : "render_pipeline.false"), btn -> { boolean nv = !"render_pipeline.true".equalsIgnoreCase(cfg.value); cfg.value = nv ? "render_pipeline.true" : "render_pipeline.false"; btn.setMessage(Text.translatable(cfg.value)); + onChanged.run(); }).dimensions(0, 0, width, 20).build(); } - private static ClickableWidget buildEnumWidget(AttributeConfig cfg, String raw, int width) { + private static ClickableWidget buildEnumWidget(AttributeConfig cfg, String raw, int width, Runnable onChanged) { String[] values = raw.isEmpty() ? new String[]{""} : raw.split("-"); int idx = 0; if (cfg.value != null) { @@ -138,11 +139,12 @@ private static ClickableWidget buildEnumWidget(AttributeConfig cfg, String raw, index[0] = (index[0] + 1) % values.length; cfg.value = values[index[0]]; btn.setMessage(Text.translatable(cfg.value)); + onChanged.run(); }).dimensions(0, 0, width, 20).build(); } private static ClickableWidget buildIntWidget(AttributeConfig cfg, TextRenderer textRenderer, - int width) { + int width, Runnable onChanged) { TextFieldWidget tf = new TextFieldWidget(textRenderer, 0, 0, width, 20, Text.empty()); tf.setMaxLength(64); tf.setText(cfg.value == null ? "" : cfg.value); @@ -150,13 +152,14 @@ private static ClickableWidget buildIntWidget(AttributeConfig cfg, TextRenderer tf.setChangedListener(text -> { if (isStrictInt(text)) { cfg.value = text; + onChanged.run(); } }); return tf; } private static ClickableWidget buildFloatWidget(AttributeConfig cfg, TextRenderer textRenderer, - int width) { + int width, Runnable onChanged) { TextFieldWidget tf = new TextFieldWidget(textRenderer, 0, 0, width, 20, Text.empty()); tf.setMaxLength(64); tf.setText(cfg.value == null ? "" : cfg.value); @@ -167,23 +170,27 @@ private static ClickableWidget buildFloatWidget(AttributeConfig cfg, TextRendere tf.setChangedListener(text -> { if (isStrictFloat(text)) { cfg.value = text; + onChanged.run(); } }); return tf; } private static ClickableWidget buildStringWidget(AttributeConfig cfg, TextRenderer textRenderer, - int width) { + int width, Runnable onChanged) { TextFieldWidget tf = new TextFieldWidget(textRenderer, 0, 0, width, 20, Text.empty()); tf.setMaxLength(128); tf.setText(cfg.value == null ? "" : cfg.value); - tf.setChangedListener(text -> cfg.value = text); + tf.setChangedListener(text -> { + cfg.value = text; + onChanged.run(); + }); return tf; } private static List buildVec3Widget(AttributeConfig cfg, TextRenderer textRenderer, - int componentWidth) { + int componentWidth, Runnable onChanged) { if (cfg.value == null || cfg.value.isEmpty()) { cfg.value = "0,0,0"; } @@ -200,6 +207,7 @@ private static List buildVec3Widget(AttributeConfig cfg, if (isStrictFloat(sx) && isStrictFloat(sy) && isStrictFloat(sz)) { cfg.value = sx + "," + sy + "," + sz; + onChanged.run(); } }; @@ -222,7 +230,7 @@ private static TextFieldWidget vecField(TextRenderer textRenderer, float v, int return tf; } - private static ClickableWidget buildIntRange(AttributeConfig cfg, String raw, int width) { + private static ClickableWidget buildIntRange(AttributeConfig cfg, String raw, int width, Runnable onChanged) { Range r = parseRange(raw); int start = (int) r.start; int end = (int) r.end; @@ -240,12 +248,12 @@ private static ClickableWidget buildIntRange(AttributeConfig cfg, String raw, in } cur = MathHelper.clamp(cur, start, end); - IntRangeSlider slider = new IntRangeSlider(0, 0, width, 20, start, end, cur, cfg); + IntRangeSlider slider = new IntRangeSlider(0, 0, width, 20, start, end, cur, cfg, onChanged); slider.updateMessage(); return slider; } - private static ClickableWidget buildFloatRange(AttributeConfig cfg, String raw, int width) { + private static ClickableWidget buildFloatRange(AttributeConfig cfg, String raw, int width, Runnable onChanged) { Range r = parseRange(raw); float start = (float) r.start; float end = (float) r.end; @@ -263,7 +271,7 @@ private static ClickableWidget buildFloatRange(AttributeConfig cfg, String raw, } cur = MathHelper.clamp(cur, start, end); - FloatRangeSlider slider = new FloatRangeSlider(0, 0, width, 20, start, end, cur, cfg); + FloatRangeSlider slider = new FloatRangeSlider(0, 0, width, 20, start, end, cur, cfg, onChanged); slider.updateMessage(); return slider; } @@ -336,14 +344,16 @@ private static class IntRangeSlider extends SliderWidget { private final int start; private final int end; private final AttributeConfig cfg; + private final Runnable onChanged; public IntRangeSlider(int x, int y, int width, int height, int start, int end, int cur, - AttributeConfig cfg) { + AttributeConfig cfg, Runnable onChanged) { super(x, y, width, height, Text.empty(), (cur - (double) start) / (double) (end - start)); this.start = start; this.end = end; this.cfg = cfg; + this.onChanged = onChanged; this.value = (cur - (double) start) / (double) (end - start); } @@ -363,6 +373,7 @@ protected void updateMessage() { protected void applyValue() { int v = MathHelper.clamp(current(), start, end); cfg.value = Integer.toString(v); + onChanged.run(); } } @@ -371,14 +382,16 @@ private static class FloatRangeSlider extends SliderWidget { private final float start; private final float end; private final AttributeConfig cfg; + private final Runnable onChanged; public FloatRangeSlider(int x, int y, int width, int height, float start, float end, float cur, - AttributeConfig cfg) { + AttributeConfig cfg, Runnable onChanged) { super(x, y, width, height, Text.empty(), (cur - start) / (double) (end - start)); this.start = start; this.end = end; this.cfg = cfg; + this.onChanged = onChanged; this.value = (cur - start) / (double) (end - start); } @@ -398,6 +411,7 @@ protected void updateMessage() { protected void applyValue() { float v = MathHelper.clamp(current(), start, end); cfg.value = formatTwoDecimals(v); + onChanged.run(); } } } diff --git a/src/main/java/com/radiance/client/gui/ModuleAttributeScreen.java b/src/main/java/com/radiance/client/gui/ModuleAttributeScreen.java index 56e816f..29cd9a8 100644 --- a/src/main/java/com/radiance/client/gui/ModuleAttributeScreen.java +++ b/src/main/java/com/radiance/client/gui/ModuleAttributeScreen.java @@ -57,7 +57,7 @@ protected void init() { for (AttributeConfig cfg : list) { List ws = AttributeWidgetUtil.buildWidgets(cfg, textRenderer, WIDGET_WIDTH, - VEC3_COMPONENT_WIDTH); + VEC3_COMPONENT_WIDTH, () -> {}); for (ClickableWidget w : ws) { addDrawableChild(w); } diff --git a/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java b/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java index c7795cc..048c8a0 100644 --- a/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java +++ b/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java @@ -63,6 +63,7 @@ public class RenderPipelineScreen extends Screen { private ButtonWidget modeToggleBtn; private ButtonWidget secondaryBtn; + private boolean isDirty = false; private static final String RENDER_PIPELINE_PRESET_NAME = "render_pipeline.preset.name"; private static final String RENDER_PIPELINE_MODE_NAME = "render_pipeline.mode.name"; @@ -144,6 +145,7 @@ private void rebuildUI() { Pipeline.preparePipelineModeUI(); mode = Mode.PIPELINE; } + isDirty = false; rebuildUI(); }).dimensions(toggleX, 6, toggleW, 20).build()); @@ -189,6 +191,7 @@ private void rebuildUI() { } else { applyActivePreset(); } + isDirty = false; }).dimensions(secondaryX + secondaryW + 110, 6, 100, 20).build()); saveBtn.active = true; @@ -238,15 +241,18 @@ public void syncToPipeline() { } Pipeline.build(); + isDirty = false; refreshPipeline(); } @Override public void close() { - if (mode == Mode.PIPELINE) { - syncToPipeline(); - } else { - syncPresetToPipeline(); + if (isDirty) { + if (mode == Mode.PIPELINE) { + syncToPipeline(); + } else { + syncPresetToPipeline(); + } } MinecraftClient.getInstance().setScreen(parent); } @@ -554,6 +560,7 @@ private void handleLocalConnection(ImageConfig current, boolean isOutput) { if (!testCycle(src, dst)) { moduleConnections.removeIf(link -> link.dst == dst); moduleConnections.add(new ModuleConnection(src, dst)); + isDirty = true; } } pendingPort = null; @@ -607,6 +614,7 @@ private ImageConfig getClickedPort(ModuleNode node, double mouseX, double mouseY } private void deleteNode(ModuleNode node) { + isDirty = true; nodes.remove(node); moduleConnections.removeIf( link -> link.src.owner == node.module || link.dst.owner == node.module); @@ -680,6 +688,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) { if (isConnected) { moduleConnections.removeIf( link -> link.src == current || link.dst == current); + isDirty = true; } else if (clickedOut != null) { if (localFinalOutput != null && localFinalOutput != current) { localFinalOutput.finalOutput = false; @@ -687,6 +696,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) { localFinalOutput = (localFinalOutput == current) ? null : current; current.finalOutput = (localFinalOutput == current); + isDirty = true; } return true; } @@ -863,6 +873,7 @@ public boolean onClick(double mouseX, double mouseY) { ModuleNode newNode = new ModuleNode(module); newNode.updateWidth(textRenderer); nodes.add(newNode); + isDirty = true; return true; } return false; @@ -944,11 +955,12 @@ private void applyActivePreset() { private void syncPresetToPipeline() { Pipeline.savePipeline(); Pipeline.build(); + isDirty = false; refreshPipeline(); } private List buildPresetWidgets(AttributeConfig cfg) { - return AttributeWidgetUtil.buildWidgets(cfg, textRenderer, 200, 64); + return AttributeWidgetUtil.buildWidgets(cfg, textRenderer, 200, 64, () -> isDirty = true); } private class PresetSelector { From 9861972207c859cbc7d7a8b205a8464dc5b90eca Mon Sep 17 00:00:00 2001 From: Gabrieli2806 <[tu-email@ejemplo.com]> Date: Fri, 10 Apr 2026 08:01:11 -0500 Subject: [PATCH 3/6] i18n: add Spanish (es_es) translation --- .../resources/assets/radiance/lang/es_es.json | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 src/main/resources/assets/radiance/lang/es_es.json diff --git a/src/main/resources/assets/radiance/lang/es_es.json b/src/main/resources/assets/radiance/lang/es_es.json new file mode 100644 index 0000000..216b683 --- /dev/null +++ b/src/main/resources/assets/radiance/lang/es_es.json @@ -0,0 +1,170 @@ +{ + "options.video.category.gameplay": "Jugabilidad", + "options.video.category.window": "Ventana", + "options.video.category.dlss": "DLSS", + "options.video.category.ray_tracing": "Trazado de Rayos", + "options.video.category.upscaler": "Escalador", + "options.video.category.terrain": "Construcción de Terreno", + "options.video.category.pipeline": "Configuración del Pipeline", + "options.video.dlss_mode.performance.tooltip": "Modo Rendimiento", + "options.video.dlss_mode.balanced.tooltip": "Modo Equilibrado", + "options.video.dlss_mode.quality.tooltip": "Modo Calidad", + "options.video.dlss_mode.dlaa.tooltip": "Modo DLAA", + "options.video.dlss_mode.performance": "Rendimiento", + "options.video.dlss_mode.balanced": "Equilibrado", + "options.video.dlss_mode.quality": "Calidad", + "options.video.dlss_mode.dlaa": "DLAA", + "options.video.dlss_mode": "Modo DLSS", + "options.video.upscaler_type": "Escalador", + "options.video.upscaler_type.native": "Nativo", + "options.video.upscaler_type.fsr3": "FSR3", + "options.video.upscaler_quality": "Calidad del Escalador", + "options.video.upscaler_quality.nativeaa": "AA Nativo", + "options.video.upscaler_quality.quality": "Calidad", + "options.video.upscaler_quality.balanced": "Equilibrado", + "options.video.upscaler_quality.performance": "Rendimiento", + "options.video.denoiser_mode": "Eliminador de Ruido", + "options.video.denoiser_mode.dlss": "DLSS", + "options.video.denoiser_mode.svgf": "SVGF", + "options.video.denoiser_mode.nrd": "NRD", + "options.video.denoiser_mode.temporal": "Acumulación Temporal", + "options.video.ray_bounces": "Rebotes de Rayos", + "options.video.chunk_building_batch_size": "Cantidad de chunks a construir en un envío", + "options.video.chunk_building_total_batches": "Cantidad de lotes de chunks en construcción", + "options.video.pipeline_setup": "Configurar Pipeline...", + "render_pipeline_screen.back": "Volver", + "render_pipeline_screen.save_and_build": "Guardar y Compilar", + "render_pipeline_screen.reload": "Recargar", + "render_pipeline_screen.add_module": "Añadir Módulo", + "render_pipeline_screen.back_hint": "Pantalla de Pipeline Experimental (pulsa ESC o haz clic en Volver para regresar)", + "render_pipeline.module.dlss.name": "DLSS", + "render_pipeline.module.dlss.attribute.mode": "Modo", + "render_pipeline.module.dlss.attribute.mode.performance": "Rendimiento", + "render_pipeline.module.dlss.attribute.mode.balanced": "Equilibrado", + "render_pipeline.module.dlss.attribute.mode.quality": "Calidad", + "render_pipeline.module.dlss.attribute.mode.dlaa": "DLAA", + "render_pipeline.module.ray_tracing.name": "Trazado de Rayos", + "render_pipeline.module.ray_tracing.attribute.num_ray_bounces": "Número de Rebotes de Rayos", + "render_pipeline.module.ray_tracing.attribute.use_jitter": "Usar Jitter", + "render_pipeline.module.ray_tracing.attribute.pbr_sampling_mode": "Modo de Muestreo PBR", + "render_pipeline.module.ray_tracing.attribute.pbr_sampling.nearest": "Más Cercano", + "render_pipeline.module.ray_tracing.attribute.pbr_sampling.bilinear": "Bilineal", + "render_pipeline.module.ray_tracing.attribute.transparent_split_mode": "Modo de División Transparente", + "render_pipeline.module.ray_tracing.attribute.transparent_split_mode.deterministic": "Determinístico", + "render_pipeline.module.ray_tracing.attribute.transparent_split_mode.stochastic": "Estocástico", + "render_pipeline.module.ray_tracing.attribute.direct_light_strength": "Intensidad de Luz Directa", + "render_pipeline.module.ray_tracing.attribute.indirect_light_strength": "Intensidad de Luz Indirecta", + "render_pipeline.module.ray_tracing.attribute.basic_radiance": "Radiancia Básica", + "render_pipeline.module.ray_tracing.attribute.atmosphere_planet_radius": "Radio del Planeta", + "render_pipeline.module.ray_tracing.attribute.atmosphere_top_radius": "Radio Superior de la Atmósfera", + "render_pipeline.module.ray_tracing.attribute.rayleigh_scale_height": "Altura de Escala Rayleigh", + "render_pipeline.module.ray_tracing.attribute.mie_scale_height": "Altura de Escala Mie", + "render_pipeline.module.ray_tracing.attribute.rayleigh_scattering_coefficient": "Coef. de Dispersión Rayleigh", + "render_pipeline.module.ray_tracing.attribute.mie_anisotropy": "Anisotropía Mie", + "render_pipeline.module.ray_tracing.attribute.mie_scattering_coefficient": "Coef. de Dispersión Mie", + "render_pipeline.module.ray_tracing.attribute.minimum_view_cosine": "Tamaño Celeste", + "render_pipeline.module.ray_tracing.attribute.sun_radiance": "Radiancia Solar", + "render_pipeline.module.ray_tracing.attribute.moon_radiance": "Radiancia Lunar", + "render_pipeline.module.ray_tracing.attribute.use_sharc": "Usar SHaRC", + "render_pipeline.module.ray_tracing.attribute.sharc_debug_mode": "Modo Debug SHaRC", + "render_pipeline.module.ray_tracing.attribute.shader_pack_path": "Pack de Shaders (vacío=integrado)", + "render_pipeline.module.temporal_accumulation.name": "Acumulación Temporal", + "render_pipeline.module.tone_mapping.name": "Mapeado de Tonos", + "render_pipeline.module.tone_mapping.attribute.method": "Método", + "render_pipeline.module.tone_mapping.attribute.method.pbr_neutral": "PBR Neutro", + "render_pipeline.module.tone_mapping.attribute.method.reinhard": "Reinhard", + "render_pipeline.module.tone_mapping.attribute.method.reinhard_white_point": "Reinhard (Punto Blanco)", + "render_pipeline.module.tone_mapping.attribute.method.aces": "ACES Ajustado", + "render_pipeline.module.tone_mapping.attribute.method.aces_white_point": "ACES Ajustado (Punto Blanco)", + "render_pipeline.module.tone_mapping.attribute.method.uncharted2": "Uncharted2", + "render_pipeline.module.tone_mapping.attribute.middle_grey": "Gris Medio", + "render_pipeline.module.tone_mapping.attribute.exposure_up_speed": "Velocidad de Subida de Exposición", + "render_pipeline.module.tone_mapping.attribute.exposure_down_speed": "Velocidad de Bajada de Exposición", + "render_pipeline.module.tone_mapping.attribute.log2_luminance_min": "Luminancia Mín. (Log2)", + "render_pipeline.module.tone_mapping.attribute.log2_luminance_max": "Luminancia Máx. (Log2)", + "render_pipeline.module.tone_mapping.attribute.low_percent": "Porcentaje Bajo", + "render_pipeline.module.tone_mapping.attribute.high_percent": "Porcentaje Alto", + "render_pipeline.module.tone_mapping.attribute.min_exposure": "Exposición Mínima", + "render_pipeline.module.tone_mapping.attribute.max_exposure": "Exposición Máxima", + "render_pipeline.module.tone_mapping.attribute.enable_auto_exposure": "Habilitar Auto-Exposición", + "render_pipeline.module.tone_mapping.attribute.exposure_metering_mode": "Modo de Medición de Exposición", + "render_pipeline.module.tone_mapping.attribute.exposure_metering_mode.global": "Global", + "render_pipeline.module.tone_mapping.attribute.exposure_metering_mode.center": "Centrado", + "render_pipeline.module.tone_mapping.attribute.center_metering_percent": "Porcentaje de Medición Central", + "render_pipeline.module.tone_mapping.attribute.manual_exposure": "Exposición Manual", + "render_pipeline.module.tone_mapping.attribute.exposure_bias": "Sesgo de Exposición", + "render_pipeline.module.tone_mapping.attribute.white_point": "Punto Blanco", + "render_pipeline.module.tone_mapping.attribute.saturation": "Saturación", + "render_pipeline.module.tone_mapping.attribute.clamp_output": "Limitar Salida", + "render_pipeline.module.post_render.name": "Post Procesado", + "render_pipeline.module.post_render.attribute.star_count": "Cantidad de Estrellas", + "render_pipeline.module.post_render.attribute.star_min_size": "Tamaño Mínimo de Estrella", + "render_pipeline.module.post_render.attribute.star_max_size": "Tamaño Máximo de Estrella", + "render_pipeline.module.post_render.attribute.star_radius": "Radio de Estrella", + "render_pipeline.module.fsr_upscaler.name": "Escalador FSR3", + "render_pipeline.module.fsr_upscaler.attribute.enable": "Habilitar Escalador FSR3", + "render_pipeline.module.fsr_upscaler.attribute.quality_mode": "Modo de Calidad", + "render_pipeline.module.fsr_upscaler.attribute.quality_mode.native": "AA Nativo", + "render_pipeline.module.fsr_upscaler.attribute.quality_mode.quality": "Calidad", + "render_pipeline.module.fsr_upscaler.attribute.quality_mode.balanced": "Equilibrado", + "render_pipeline.module.fsr_upscaler.attribute.quality_mode.performance": "Rendimiento", + "render_pipeline.module.fsr_upscaler.attribute.quality_mode.ultra": "Ultra Rendimiento", + "render_pipeline.module.fsr_upscaler.attribute.sharpness": "Nitidez", + "render_pipeline.module.xess_sr.name": "Escalador XeSS", + "render_pipeline.module.xess_sr.attribute.enable": "Habilitar Escalador XeSS", + "render_pipeline.module.xess_sr.attribute.quality_mode": "Modo de Calidad", + "render_pipeline.module.xess_sr.attribute.quality_mode.native": "AA Nativo", + "render_pipeline.module.xess_sr.attribute.quality_mode.ultra_quality_plus": "Ultra Calidad Plus", + "render_pipeline.module.xess_sr.attribute.quality_mode.ultra_quality": "Ultra Calidad", + "render_pipeline.module.xess_sr.attribute.quality_mode.quality": "Calidad", + "render_pipeline.module.xess_sr.attribute.quality_mode.balanced": "Equilibrado", + "render_pipeline.module.xess_sr.attribute.quality_mode.performance": "Rendimiento", + "render_pipeline.module.xess_sr.attribute.quality_mode.ultra_performance": "Ultra Rendimiento", + "render_pipeline.module.xess_sr.attribute.pre_exposure": "Pre-Exposición", + "render_pipeline.module.nrd.name": "NRD", + "render_pipeline.module.nrd.attribute.antilag_luminance_sigma_scale": "Escala Sigma Luminancia Antilag", + "render_pipeline.module.nrd.attribute.antilag_luminance_sensitivity": "Sensibilidad Luminancia Antilag", + "render_pipeline.module.nrd.attribute.max_accumulated_frame_num": "Máx. Fotogramas Acumulados", + "render_pipeline.module.nrd.attribute.max_fast_accumulated_frame_num": "Máx. Fotogramas Acumulados Rápidos", + "render_pipeline.module.nrd.attribute.history_fix_frame_num": "Fotogramas de Corrección de Historial", + "render_pipeline.module.nrd.attribute.history_fix_base_pixel_stride": "Paso de Píxel Base de Corrección", + "render_pipeline.module.nrd.attribute.history_fix_alternate_pixel_stride": "Paso de Píxel Alt. de Corrección", + "render_pipeline.module.nrd.attribute.fast_history_clamping_sigma_scale": "Escala Sigma de Limitación de Historial Rápido", + "render_pipeline.module.nrd.attribute.diffuse_prepass_blur_radius": "Radio de Desenfoque Prepass Difuso", + "render_pipeline.module.nrd.attribute.specular_prepass_blur_radius": "Radio de Desenfoque Prepass Especular", + "render_pipeline.module.nrd.attribute.min_hit_distance_weight": "Peso Mínimo de Distancia de Impacto", + "render_pipeline.module.nrd.attribute.min_blur_radius": "Radio Mínimo de Desenfoque", + "render_pipeline.module.nrd.attribute.max_blur_radius": "Radio Máximo de Desenfoque", + "render_pipeline.module.nrd.attribute.lobe_angle_fraction": "Fracción de Ángulo de Lóbulo", + "render_pipeline.module.nrd.attribute.roughness_fraction": "Fracción de Rugosidad", + "render_pipeline.module.nrd.attribute.plane_distance_sensitivity": "Sensibilidad de Distancia de Plano", + "render_pipeline.module.nrd.attribute.specular_probability_thresholds_for_mv_modification_min": "Umbral MV Especular Mín.", + "render_pipeline.module.nrd.attribute.specular_probability_thresholds_for_mv_modification_max": "Umbral MV Especular Máx.", + "render_pipeline.module.nrd.attribute.firefly_suppressor_min_relative_scale": "Escala Relativa Mín. Supresor de Fireflies", + "render_pipeline.module.nrd.attribute.min_material_for_diffuse": "Material Mín. para Difuso", + "render_pipeline.module.nrd.attribute.min_material_for_specular": "Material Mín. para Especular", + "render_pipeline.module.nrd.attribute.checkerboard_mode": "Modo Tablero de Ajedrez", + "render_pipeline.module.nrd.attribute.enable_anti_firefly": "Habilitar Anti-Firefly", + "render_pipeline.module.nrd.attribute.hit_distance_reconstruction_mode": "Modo de Reconstrucción de Distancia de Impacto", + "render_pipeline.module.nrd.attribute.max_stabilized_frame_num": "Máx. Fotogramas Estabilizados", + "render_pipeline.module.nrd.attribute.specular_probability_threshold_low": "Umbral Prob. Especular Bajo", + "render_pipeline.module.nrd.attribute.specular_probability_threshold_high": "Umbral Prob. Especular Alto", + "render_pipeline.module.nrd.attribute.responsive_accumulation_roughness_threshold": "Umbral Rugosidad Acum. Responsiva", + "render_pipeline.module.nrd.attribute.responsive_accumulation_min_accumulated_frame_num": "Fotogramas Mín. Acum. Responsiva", + "render_pipeline.module.nrd.attribute.disocclusion_threshold": "Umbral de Desoclusión", + "render_pipeline.module.nrd.attribute.disocclusion_threshold_alternate": "Umbral de Desoclusión Alt.", + "render_pipeline.module.temporal_accumulation.attribute.alpha": "Alfa (Peso del Historial)", + "render_pipeline.module.temporal_accumulation.attribute.depth_threshold": "Umbral de Profundidad", + "render_pipeline.module.temporal_accumulation.attribute.depth_scale": "Escala de Profundidad", + "module_attribute_screen.no_attributes": "Sin Atributos", + "render_pipeline.preset.name": "Preset", + "render_pipeline.preset.rt_dlss": "RT-DLSSRR", + "render_pipeline.preset.rt_nrd": "RT-NRD", + "render_pipeline.preset.rt_nrd_fsr": "RT-NRD-FSR", + "render_pipeline.preset.rt_nrd_xess": "RT-NRD-XeSS", + "render_pipeline.mode.name": "Modo", + "render_pipeline.mode.pipeline": "Pipeline", + "render_pipeline.mode.preset": "Preset", + "render_pipeline.true": "Verdadero", + "render_pipeline.false": "Falso" +} From f8faffad958b3414d28fdf0cddf3111c152067c7 Mon Sep 17 00:00:00 2001 From: Gabrieli2806 <[tu-email@ejemplo.com]> Date: Fri, 10 Apr 2026 08:09:17 -0500 Subject: [PATCH 4/6] i18n: use Si/No for booleans in es_es --- src/main/resources/assets/radiance/lang/es_es.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/radiance/lang/es_es.json b/src/main/resources/assets/radiance/lang/es_es.json index 216b683..ccdb37c 100644 --- a/src/main/resources/assets/radiance/lang/es_es.json +++ b/src/main/resources/assets/radiance/lang/es_es.json @@ -165,6 +165,6 @@ "render_pipeline.mode.name": "Modo", "render_pipeline.mode.pipeline": "Pipeline", "render_pipeline.mode.preset": "Preset", - "render_pipeline.true": "Verdadero", - "render_pipeline.false": "Falso" + "render_pipeline.true": "Sí", + "render_pipeline.false": "No" } From d5d74031f42bef75780b79ac1382b37a297ea991 Mon Sep 17 00:00:00 2001 From: Gabrieli2806 <[tu-email@ejemplo.com]> Date: Fri, 10 Apr 2026 08:15:22 -0500 Subject: [PATCH 5/6] fix(gui): eliminate pipeline build on every menu open/close - Add isDirty flag to RenderPipelineScreen; close() only calls build() when the user actually changed something - Add idempotency guard to Pipeline.switchToPresetMode to skip rebuild when already in the same preset - Remove duplicate switchToPresetMode call in rebuildUI (applyActivePreset already calls it) - Move node.updateWidth() from render() loop to refreshPipeline() - Add Runnable onChanged param to AttributeWidgetUtil.buildWidgets and all sub-builders; fires isDirty=true on user edits in preset mode - Mark isDirty=true on structural changes: add/remove/connect modules, open attribute editor - Clear isDirty on Save, Reload, and mode toggle --- .../client/gui/AttributeWidgetUtil.java | 43 +++++++++++-------- .../client/gui/RenderPipelineScreen.java | 22 ++++------ .../radiance/client/pipeline/Pipeline.java | 29 ------------- 3 files changed, 34 insertions(+), 60 deletions(-) diff --git a/src/main/java/com/radiance/client/gui/AttributeWidgetUtil.java b/src/main/java/com/radiance/client/gui/AttributeWidgetUtil.java index 505946d..a92ac44 100644 --- a/src/main/java/com/radiance/client/gui/AttributeWidgetUtil.java +++ b/src/main/java/com/radiance/client/gui/AttributeWidgetUtil.java @@ -82,6 +82,12 @@ static int totalWidgetWidth(List widgets, int singleWidth, int return singleWidth; } + static List buildWidgets(AttributeConfig cfg, TextRenderer textRenderer, + int width, + int vec3ComponentWidth) { + return buildWidgets(cfg, textRenderer, width, vec3ComponentWidth, () -> {}); + } + static List buildWidgets(AttributeConfig cfg, TextRenderer textRenderer, int width, int vec3ComponentWidth, Runnable onChanged) { @@ -92,11 +98,11 @@ static List buildWidgets(AttributeConfig cfg, TextRenderer text } if (type.startsWith("int_range:")) { - return List.of(buildIntRange(cfg, cfg.type.substring(10), width, onChanged)); + return List.of(buildIntRange(cfg, cfg.type.substring(10), width)); } if (type.startsWith("float_range:")) { - return List.of(buildFloatRange(cfg, cfg.type.substring(12), width, onChanged)); + return List.of(buildFloatRange(cfg, cfg.type.substring(12), width)); } return switch (type) { @@ -109,7 +115,8 @@ static List buildWidgets(AttributeConfig cfg, TextRenderer text }; } - private static ClickableWidget buildBoolWidget(AttributeConfig cfg, int width, Runnable onChanged) { + private static ClickableWidget buildBoolWidget(AttributeConfig cfg, int width, + Runnable onChanged) { boolean b = "render_pipeline.true".equalsIgnoreCase(cfg.value); return ButtonWidget.builder( Text.translatable(b ? "render_pipeline.true" : "render_pipeline.false"), btn -> { @@ -120,7 +127,8 @@ private static ClickableWidget buildBoolWidget(AttributeConfig cfg, int width, R }).dimensions(0, 0, width, 20).build(); } - private static ClickableWidget buildEnumWidget(AttributeConfig cfg, String raw, int width, Runnable onChanged) { + private static ClickableWidget buildEnumWidget(AttributeConfig cfg, String raw, int width, + Runnable onChanged) { String[] values = raw.isEmpty() ? new String[]{""} : raw.split("-"); int idx = 0; if (cfg.value != null) { @@ -176,7 +184,8 @@ private static ClickableWidget buildFloatWidget(AttributeConfig cfg, TextRendere return tf; } - private static ClickableWidget buildStringWidget(AttributeConfig cfg, TextRenderer textRenderer, + private static ClickableWidget buildStringWidget(AttributeConfig cfg, + TextRenderer textRenderer, int width, Runnable onChanged) { TextFieldWidget tf = new TextFieldWidget(textRenderer, 0, 0, width, 20, Text.empty()); tf.setMaxLength(128); @@ -215,7 +224,11 @@ private static List buildVec3Widget(AttributeConfig cfg, y.setChangedListener(s -> syncIfValid.run()); z.setChangedListener(s -> syncIfValid.run()); - syncIfValid.run(); + // Normalize initial value without firing onChanged + String sx0 = x.getText(), sy0 = y.getText(), sz0 = z.getText(); + if (isStrictFloat(sx0) && isStrictFloat(sy0) && isStrictFloat(sz0)) { + cfg.value = sx0 + "," + sy0 + "," + sz0; + } return List.of(x, y, z); } @@ -230,7 +243,7 @@ private static TextFieldWidget vecField(TextRenderer textRenderer, float v, int return tf; } - private static ClickableWidget buildIntRange(AttributeConfig cfg, String raw, int width, Runnable onChanged) { + private static ClickableWidget buildIntRange(AttributeConfig cfg, String raw, int width) { Range r = parseRange(raw); int start = (int) r.start; int end = (int) r.end; @@ -248,12 +261,12 @@ private static ClickableWidget buildIntRange(AttributeConfig cfg, String raw, in } cur = MathHelper.clamp(cur, start, end); - IntRangeSlider slider = new IntRangeSlider(0, 0, width, 20, start, end, cur, cfg, onChanged); + IntRangeSlider slider = new IntRangeSlider(0, 0, width, 20, start, end, cur, cfg); slider.updateMessage(); return slider; } - private static ClickableWidget buildFloatRange(AttributeConfig cfg, String raw, int width, Runnable onChanged) { + private static ClickableWidget buildFloatRange(AttributeConfig cfg, String raw, int width) { Range r = parseRange(raw); float start = (float) r.start; float end = (float) r.end; @@ -271,7 +284,7 @@ private static ClickableWidget buildFloatRange(AttributeConfig cfg, String raw, } cur = MathHelper.clamp(cur, start, end); - FloatRangeSlider slider = new FloatRangeSlider(0, 0, width, 20, start, end, cur, cfg, onChanged); + FloatRangeSlider slider = new FloatRangeSlider(0, 0, width, 20, start, end, cur, cfg); slider.updateMessage(); return slider; } @@ -344,16 +357,14 @@ private static class IntRangeSlider extends SliderWidget { private final int start; private final int end; private final AttributeConfig cfg; - private final Runnable onChanged; public IntRangeSlider(int x, int y, int width, int height, int start, int end, int cur, - AttributeConfig cfg, Runnable onChanged) { + AttributeConfig cfg) { super(x, y, width, height, Text.empty(), (cur - (double) start) / (double) (end - start)); this.start = start; this.end = end; this.cfg = cfg; - this.onChanged = onChanged; this.value = (cur - (double) start) / (double) (end - start); } @@ -373,7 +384,6 @@ protected void updateMessage() { protected void applyValue() { int v = MathHelper.clamp(current(), start, end); cfg.value = Integer.toString(v); - onChanged.run(); } } @@ -382,16 +392,14 @@ private static class FloatRangeSlider extends SliderWidget { private final float start; private final float end; private final AttributeConfig cfg; - private final Runnable onChanged; public FloatRangeSlider(int x, int y, int width, int height, float start, float end, float cur, - AttributeConfig cfg, Runnable onChanged) { + AttributeConfig cfg) { super(x, y, width, height, Text.empty(), (cur - start) / (double) (end - start)); this.start = start; this.end = end; this.cfg = cfg; - this.onChanged = onChanged; this.value = (cur - start) / (double) (end - start); } @@ -411,7 +419,6 @@ protected void updateMessage() { protected void applyValue() { float v = MathHelper.clamp(current(), start, end); cfg.value = formatTwoDecimals(v); - onChanged.run(); } } } diff --git a/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java b/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java index 048c8a0..99f256c 100644 --- a/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java +++ b/src/main/java/com/radiance/client/gui/RenderPipelineScreen.java @@ -54,6 +54,7 @@ public class RenderPipelineScreen extends Screen { private boolean isPanning = false; private Mode mode = Mode.PIPELINE; + private boolean isDirty = false; private final List presets = new ArrayList<>(); private PresetEntry activePreset = null; private PresetSelector activePresetSelector = null; @@ -63,7 +64,6 @@ public class RenderPipelineScreen extends Screen { private ButtonWidget modeToggleBtn; private ButtonWidget secondaryBtn; - private boolean isDirty = false; private static final String RENDER_PIPELINE_PRESET_NAME = "render_pipeline.preset.name"; private static final String RENDER_PIPELINE_MODE_NAME = "render_pipeline.mode.name"; @@ -138,11 +138,11 @@ private void rebuildUI() { if (activePreset == null && !presets.isEmpty()) { activePreset = presets.getFirst(); } - Pipeline.preparePresetModeUI( + Pipeline.switchToPresetMode( activePreset != null ? activePreset.name() : "Default"); mode = Mode.PRESET; } else { - Pipeline.preparePipelineModeUI(); + Pipeline.switchToPipelineMode(); mode = Mode.PIPELINE; } isDirty = false; @@ -182,6 +182,7 @@ private void rebuildUI() { } else { syncPresetToPipeline(); } + isDirty = false; }).dimensions(secondaryX + secondaryW + 5, 6, 100, 20).build()); ButtonWidget reloadBtn = addDrawableChild( @@ -241,7 +242,6 @@ public void syncToPipeline() { } Pipeline.build(); - isDirty = false; refreshPipeline(); } @@ -474,7 +474,7 @@ private void drawModuleNode(DrawContext context, ModuleNode moduleNode) { context.drawTexture(RenderLayer::getGuiTextured, GEAR_TEX, gearX, btnY, 0, 0, btnSize, btnSize, btnSize, btnSize); - context.drawTextWithShadow(textRenderer, "×", deleteX + 3, btnY + 2, 0xFFFF5A5A); + context.drawTextWithShadow(textRenderer, "├ù", deleteX + 3, btnY + 2, 0xFFFF5A5A); for (int i = 0; i < moduleNode.rows(); i++) { int ry = y + moduleNode.headerH + moduleNode.pad + i * moduleNode.rowH + 7; @@ -666,6 +666,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) { } if (button == 0 && isGearClicked(node, mouseX, mouseY)) { + isDirty = true; MinecraftClient.getInstance() .setScreen(new ModuleAttributeScreen(this, node.module)); return true; @@ -688,7 +689,6 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) { if (isConnected) { moduleConnections.removeIf( link -> link.src == current || link.dst == current); - isDirty = true; } else if (clickedOut != null) { if (localFinalOutput != null && localFinalOutput != current) { localFinalOutput.finalOutput = false; @@ -696,7 +696,6 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) { localFinalOutput = (localFinalOutput == current) ? null : current; current.finalOutput = (localFinalOutput == current); - isDirty = true; } return true; } @@ -870,9 +869,7 @@ public boolean onClick(double mouseX, double mouseY) { Module module = selected.loadModule(); module.x = 100; module.y = 100; - ModuleNode newNode = new ModuleNode(module); - newNode.updateWidth(textRenderer); - nodes.add(newNode); + nodes.add(new ModuleNode(module)); isDirty = true; return true; } @@ -922,7 +919,7 @@ private void applyActivePreset() { return; } - Pipeline.preparePresetModeUI(activePreset.name()); + Pipeline.switchToPresetMode(activePreset.name()); List modules = new ArrayList<>(Pipeline.INSTANCE.getModules()); @@ -935,7 +932,6 @@ private void applyActivePreset() { for (AttributeConfig cfg : m.attributeConfigs) { List ws = buildPresetWidgets(cfg); for (ClickableWidget w : ws) { - w.visible = false; presetWidgets.add(addDrawableChild(w)); } block.rows.add(new PresetRow(cfg, ws)); @@ -955,7 +951,6 @@ private void applyActivePreset() { private void syncPresetToPipeline() { Pipeline.savePipeline(); Pipeline.build(); - isDirty = false; refreshPipeline(); } @@ -1001,6 +996,7 @@ public boolean onClick(double mouseX, double mouseY) { if (index >= 0 && index < options.size()) { activePreset = options.get(index); presetScrollY = 0; + Pipeline.switchToPresetMode(activePreset != null ? activePreset.name() : "Default"); applyActivePreset(); return true; } diff --git a/src/main/java/com/radiance/client/pipeline/Pipeline.java b/src/main/java/com/radiance/client/pipeline/Pipeline.java index e64c997..8646be1 100644 --- a/src/main/java/com/radiance/client/pipeline/Pipeline.java +++ b/src/main/java/com/radiance/client/pipeline/Pipeline.java @@ -889,35 +889,6 @@ public static void switchToPresetMode(String presetName) { build(); } - /** - * Assembles preset pipeline data in memory for UI display only. - * Does NOT call build() or savePipeline() — call those explicitly when applying. - */ - public static void preparePresetModeUI(String presetName) { - String processedPresetName = processPresetName(presetName); - if (INSTANCE.mode == PipelineMode.PRESET - && Objects.equals(INSTANCE.activePresetName, processedPresetName)) { - return; - } - List carryOverModules = capturePresetModules(); - INSTANCE.mode = PipelineMode.PRESET; - assemblePreset(processedPresetName); - PipelineConfigStorage storage = loadConfigStorage(); - if (storage != null && Objects.equals(storage.mode, PipelineMode.PRESET.name()) - && Objects.equals(storage.presetName, INSTANCE.activePresetName)) { - applyPresetModuleOverrides(storage.presetModules); - } - applyPresetModuleOverrides(carryOverModules); - } - - /** - * Sets pipeline mode to PIPELINE for UI display only. - * Does NOT call build() or savePipeline() — call those explicitly when applying. - */ - public static void preparePipelineModeUI() { - INSTANCE.mode = PipelineMode.PIPELINE; - } - public static void assemblePreset(String presetName) { String processedPresetName = processPresetName(presetName); if (processedPresetName == null) { From b0df38fa9bdb022c75f3cebcd55bc5751621b9c9 Mon Sep 17 00:00:00 2001 From: Gabrieli2806 <[tu-email@ejemplo.com]> Date: Sat, 11 Apr 2026 01:36:00 -0500 Subject: [PATCH 6/6] feat(dlss): add Ultra Performance mode --- src/main/java/com/radiance/client/option/DLSSMode.java | 10 ++++++---- src/main/java/com/radiance/client/option/Options.java | 2 ++ src/main/resources/assets/radiance/lang/en_us.json | 3 +++ src/main/resources/assets/radiance/lang/es_es.json | 3 +++ src/main/resources/assets/radiance/lang/zh_cn.json | 3 +++ src/main/resources/modules/dlss.yaml | 2 +- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/radiance/client/option/DLSSMode.java b/src/main/java/com/radiance/client/option/DLSSMode.java index 8923a56..459d796 100644 --- a/src/main/java/com/radiance/client/option/DLSSMode.java +++ b/src/main/java/com/radiance/client/option/DLSSMode.java @@ -4,16 +4,18 @@ import static com.radiance.client.option.Options.DLSS_MODE_DLAA; import static com.radiance.client.option.Options.DLSS_MODE_PERFORMANCE; import static com.radiance.client.option.Options.DLSS_MODE_QUALITY; +import static com.radiance.client.option.Options.DLSS_MODE_ULTRA_PERFORMANCE; import com.mojang.serialization.Codec; import net.minecraft.util.StringIdentifiable; import net.minecraft.util.TranslatableOption; public enum DLSSMode implements TranslatableOption, StringIdentifiable { - PERFORMANCE(0, "performance", DLSS_MODE_PERFORMANCE), - BALANCED(1, "balanced", DLSS_MODE_BALANCED), - QUALITY(2, "quality", DLSS_MODE_QUALITY), - DLAA(3, "dlaa", DLSS_MODE_DLAA); + ULTRA_PERFORMANCE(0, "ultra_performance", DLSS_MODE_ULTRA_PERFORMANCE), + PERFORMANCE(1, "performance", DLSS_MODE_PERFORMANCE), + BALANCED(2, "balanced", DLSS_MODE_BALANCED), + QUALITY(3, "quality", DLSS_MODE_QUALITY), + DLAA(4, "dlaa", DLSS_MODE_DLAA); public static final Codec Codec = StringIdentifiable.createCodec(DLSSMode::values); private final int ordinal; diff --git a/src/main/java/com/radiance/client/option/Options.java b/src/main/java/com/radiance/client/option/Options.java index 39830f9..7132299 100644 --- a/src/main/java/com/radiance/client/option/Options.java +++ b/src/main/java/com/radiance/client/option/Options.java @@ -20,11 +20,13 @@ public class Options { public static final String CATEGORY_TERRAIN = "options.video.category.terrain"; public static final String CATEGORY_PIPELINE = "options.video.category.pipeline"; + public static final String DLSS_MODE_ULTRA_PERFORMANCE_TOOLTIP = "options.video.dlss_mode.ultra_performance.tooltip"; public static final String DLSS_MODE_PERFORMANCE_TOOLTIP = "options.video.dlss_mode.performance.tooltip"; public static final String DLSS_MODE_BALANCED_TOOLTIP = "options.video.dlss_mode.balanced.tooltip"; public static final String DLSS_MODE_QUALITY_TOOLTIP = "options.video.dlss_mode.quality.tooltip"; public static final String DLSS_MODE_DLAA_TOOLTIP = "options.video.dlss_mode.dlaa.tooltip"; + public static final String DLSS_MODE_ULTRA_PERFORMANCE = "options.video.dlss_mode.ultra_performance"; public static final String DLSS_MODE_PERFORMANCE = "options.video.dlss_mode.performance"; public static final String DLSS_MODE_BALANCED = "options.video.dlss_mode.balanced"; public static final String DLSS_MODE_QUALITY = "options.video.dlss_mode.quality"; diff --git a/src/main/resources/assets/radiance/lang/en_us.json b/src/main/resources/assets/radiance/lang/en_us.json index 605fcb8..97051a6 100644 --- a/src/main/resources/assets/radiance/lang/en_us.json +++ b/src/main/resources/assets/radiance/lang/en_us.json @@ -6,10 +6,12 @@ "options.video.category.upscaler": "Upscaler", "options.video.category.terrain": "Terrain Build", "options.video.category.pipeline": "Pipeline Setup", + "options.video.dlss_mode.ultra_performance.tooltip": "Ultra Performance Mode", "options.video.dlss_mode.performance.tooltip": "Performance Mode", "options.video.dlss_mode.balanced.tooltip": "Balanced Mode", "options.video.dlss_mode.quality.tooltip": "Quality Mode", "options.video.dlss_mode.dlaa.tooltip": "DLAA Mode", + "options.video.dlss_mode.ultra_performance": "Ultra Performance", "options.video.dlss_mode.performance": "Performance Mode", "options.video.dlss_mode.balanced": "Balanced Mode", "options.video.dlss_mode.quality": "Quality Mode", @@ -39,6 +41,7 @@ "render_pipeline_screen.back_hint": "Experimental Render Pipeline Screen (press ESC or click Back to return)", "render_pipeline.module.dlss.name": "DLSS", "render_pipeline.module.dlss.attribute.mode": "Mode", + "render_pipeline.module.dlss.attribute.mode.ultra_performance": "Ultra Performance", "render_pipeline.module.dlss.attribute.mode.performance": "Performance", "render_pipeline.module.dlss.attribute.mode.balanced": "Balanced", "render_pipeline.module.dlss.attribute.mode.quality": "Quality", diff --git a/src/main/resources/assets/radiance/lang/es_es.json b/src/main/resources/assets/radiance/lang/es_es.json index ccdb37c..dd1ce06 100644 --- a/src/main/resources/assets/radiance/lang/es_es.json +++ b/src/main/resources/assets/radiance/lang/es_es.json @@ -6,10 +6,12 @@ "options.video.category.upscaler": "Escalador", "options.video.category.terrain": "Construcción de Terreno", "options.video.category.pipeline": "Configuración del Pipeline", + "options.video.dlss_mode.ultra_performance.tooltip": "Modo Ultra Rendimiento", "options.video.dlss_mode.performance.tooltip": "Modo Rendimiento", "options.video.dlss_mode.balanced.tooltip": "Modo Equilibrado", "options.video.dlss_mode.quality.tooltip": "Modo Calidad", "options.video.dlss_mode.dlaa.tooltip": "Modo DLAA", + "options.video.dlss_mode.ultra_performance": "Ultra Rendimiento", "options.video.dlss_mode.performance": "Rendimiento", "options.video.dlss_mode.balanced": "Equilibrado", "options.video.dlss_mode.quality": "Calidad", @@ -39,6 +41,7 @@ "render_pipeline_screen.back_hint": "Pantalla de Pipeline Experimental (pulsa ESC o haz clic en Volver para regresar)", "render_pipeline.module.dlss.name": "DLSS", "render_pipeline.module.dlss.attribute.mode": "Modo", + "render_pipeline.module.dlss.attribute.mode.ultra_performance": "Ultra Rendimiento", "render_pipeline.module.dlss.attribute.mode.performance": "Rendimiento", "render_pipeline.module.dlss.attribute.mode.balanced": "Equilibrado", "render_pipeline.module.dlss.attribute.mode.quality": "Calidad", diff --git a/src/main/resources/assets/radiance/lang/zh_cn.json b/src/main/resources/assets/radiance/lang/zh_cn.json index 82bd425..e405bdd 100644 --- a/src/main/resources/assets/radiance/lang/zh_cn.json +++ b/src/main/resources/assets/radiance/lang/zh_cn.json @@ -6,10 +6,12 @@ "options.video.category.upscaler": "超分", "options.video.category.terrain": "地形构建", "options.video.category.pipeline": "管线设置", + "options.video.dlss_mode.ultra_performance.tooltip": "超级性能模式", "options.video.dlss_mode.performance.tooltip": "性能模式", "options.video.dlss_mode.balanced.tooltip": "平衡模式", "options.video.dlss_mode.quality.tooltip": "质量模式", "options.video.dlss_mode.dlaa.tooltip": "DLAA模式", + "options.video.dlss_mode.ultra_performance": "超级性能", "options.video.dlss_mode.performance": "性能模式", "options.video.dlss_mode.balanced": "平衡模式", "options.video.dlss_mode.quality": "质量模式", @@ -39,6 +41,7 @@ "render_pipeline_screen.back_hint": "实验性渲染管线配置界面(使用ESC或者返回按钮返回上一页)", "render_pipeline.module.dlss.name": "DLSS", "render_pipeline.module.dlss.attribute.mode": "模式", + "render_pipeline.module.dlss.attribute.mode.ultra_performance": "超级性能", "render_pipeline.module.dlss.attribute.mode.performance": "性能模式", "render_pipeline.module.dlss.attribute.mode.balanced": "平衡模式", "render_pipeline.module.dlss.attribute.mode.quality": "质量模式", diff --git a/src/main/resources/modules/dlss.yaml b/src/main/resources/modules/dlss.yaml index 9ad08cc..1b667e7 100644 --- a/src/main/resources/modules/dlss.yaml +++ b/src/main/resources/modules/dlss.yaml @@ -23,5 +23,5 @@ outputImageConfigs: format: "R16_SFLOAT" attributeConfigs: - name: "render_pipeline.module.dlss.attribute.mode" - type: "enum:render_pipeline.module.dlss.attribute.mode.performance-render_pipeline.module.dlss.attribute.mode.balanced-render_pipeline.module.dlss.attribute.mode.quality-render_pipeline.module.dlss.attribute.mode.dlaa" + type: "enum:render_pipeline.module.dlss.attribute.mode.ultra_performance-render_pipeline.module.dlss.attribute.mode.performance-render_pipeline.module.dlss.attribute.mode.balanced-render_pipeline.module.dlss.attribute.mode.quality-render_pipeline.module.dlss.attribute.mode.dlaa" value: "render_pipeline.module.dlss.attribute.mode.balanced"