feat(theme): Implement comprehensive CRT Filter (scanlines, vignette, noise)

This commit is contained in:
2026-03-09 01:19:16 -04:00
parent 9facecb7a5
commit e635c2925d
3 changed files with 88 additions and 28 deletions

View File

@@ -131,7 +131,8 @@ class App:
self._token_stats: dict[str, Any] = {}
self._token_stats_dirty: bool = True
self.perf_history: dict[str, list] = {"frame_time": [0.0] * 100, "fps": [0.0] * 100}
self._nerv_scanlines = theme_fx.ScanlineOverlay()
self._nerv_crt = theme_fx.CRTFilter()
self.ui_crt_filter = True
self._nerv_alert = theme_fx.AlertPulsing()
self._nerv_flicker = theme_fx.StatusFlicker()
@@ -307,9 +308,8 @@ class App:
ws = imgui.get_io().display_size
self._nerv_alert.update(self.ai_status)
self._nerv_alert.render(ws.x, ws.y)
self._nerv_scanlines.render(ws.x, ws.y)
pushed_prior_tint = False
self._nerv_crt.enabled = self.ui_crt_filter
self._nerv_crt.render(ws.x, ws.y)
if self.perf_profiling_enabled: self.perf_monitor.start_component("_gui_func")
if self.is_viewing_prior_session:
imgui.push_style_color(imgui.Col_.window_bg, vec4(50, 40, 20))
@@ -2895,17 +2895,21 @@ def hello():
ch_ct, ctrans = imgui.slider_float("##ctrans", theme.get_child_transparency(), 0.1, 1.0, "%.2f")
if ch_ct:
theme.set_child_transparency(ctrans)
self._flush_to_config()
models.save_config(self.config)
imgui.separator()
bg = bg_shader.get_bg()
ch_bg, bg.enabled = imgui.checkbox("Animated Background Shader", bg.enabled)
if ch_bg:
gui_cfg = self.config.setdefault("gui", {})
gui_cfg["bg_shader_enabled"] = bg.enabled
self._flush_to_config()
models.save_config(self.config)
ch_crt, self.ui_crt_filter = imgui.checkbox("CRT Filter", self.ui_crt_filter)
if ch_crt:
gui_cfg = self.config.setdefault("gui", {})
gui_cfg["crt_filter_enabled"] = self.ui_crt_filter
self._flush_to_config()
models.save_config(self.config)
self._flush_to_config()
models.save_config(self.config)
imgui.end()
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_theme_panel")