dumb ai
This commit is contained in:
24
conductor/tracks/frosted_glass_20260313/debrief.md
Normal file
24
conductor/tracks/frosted_glass_20260313/debrief.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Debrief: Failed Frosted Glass Implementation (Attempt 1)
|
||||||
|
|
||||||
|
## 1. Post-Mortem Summary
|
||||||
|
The initial implementation of the Frosted Glass effect was a catastrophic failure resulting in application crashes (`RecursionError`, `AttributeError`, `RuntimeError`) and visual non-functionality (black backgrounds or invisible blurs).
|
||||||
|
|
||||||
|
## 2. Root Causes
|
||||||
|
|
||||||
|
### A. Architectural Blindness (ImGui Timing)
|
||||||
|
I attempted to use `glCopyTexImage2D` to capture the "backbuffer" during the `_gui_func` execution. In an immediate-mode GUI (ImGui), the backbuffer is cleared at the start of the frame and draw commands are only recorded during `_gui_func`. The actual GPU rendering happens **after** `_gui_func` finishes. Consequently, I was capturing and blurring an empty black screen every frame.
|
||||||
|
|
||||||
|
### B. Sub-Agent Fragmentation (Class Scope Breaks)
|
||||||
|
By delegating massive file refactors to the `generalist` sub-agent, I lost control over the strict 1-space indentation required by this project. The sub-agent introduced unindented blocks that silently closed the `App` class scope, causing all subsequent methods to become global functions. This lead to the avalanche of `AttributeError: 'App' object has no attribute '_render_operations_hub_contents'` and similar errors.
|
||||||
|
|
||||||
|
### C. Style Stack Imbalance
|
||||||
|
The implementation of `_begin_window` and `_end_window` wrappers failed to account for mid-render state changes. Toggling the "Frosted Glass" checkbox mid-frame resulted in mismatched `PushStyleColor` and `PopStyleColor` calls, triggering internal ImGui assertions and hard crashes.
|
||||||
|
|
||||||
|
### D. High-DPI Math Errors
|
||||||
|
The UV coordinate math failed to correctly account for `display_framebuffer_scale`. On high-resolution screens, the blur sampling was offset by thousands of pixels, rendering the effect physically invisible or distorted.
|
||||||
|
|
||||||
|
## 3. Remedial Action Plan
|
||||||
|
- **Abandon Fragile Capture:** Stop trying to capture the backbuffer manually.
|
||||||
|
- **Native OS Integration:** Leverage the Windows Desktop Window Manager (DWM) via `SetWindowCompositionAttribute` for stable, high-performance blur-behind.
|
||||||
|
- **Surgical Code Control:** No more sub-agent delegation for core GUI logic. All indentation and scope changes must be manually verified.
|
||||||
|
- **Unified Pipeline:** Separate the "Animated Background" from the "Window Glass" logic to prevent pipeline conflicts.
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
# Track frosted_glass_20260313 Context
|
# Track frosted_glass_20260313 Context (REPAIR)
|
||||||
|
|
||||||
|
- [Debrief](./debrief.md)
|
||||||
- [Specification](./spec.md)
|
- [Specification](./spec.md)
|
||||||
- [Implementation Plan](./plan.md)
|
- [Implementation Plan](./plan.md)
|
||||||
- [Metadata](./metadata.json)
|
- [Metadata](./metadata.json)
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
"type": "feature",
|
"type": "feature",
|
||||||
"status": "new",
|
"status": "new",
|
||||||
"created_at": "2026-03-13T14:39:00Z",
|
"created_at": "2026-03-13T14:39:00Z",
|
||||||
"updated_at": "2026-03-13T14:39:00Z",
|
"updated_at": "2026-03-13T18:55:00Z",
|
||||||
"description": "Add 'frosted glass' bg for transparency on panels and popups. This blurring effect will allow drop downs and other elements of these panels to not get hard to discern from background text or elements behind the panel."
|
"description": "REPAIR: Implement stable frosted glass using native Windows DWM APIs."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,24 @@
|
|||||||
# Implementation Plan: Frosted Glass Background Effect
|
# Implementation Plan: Frosted Glass Background Effect (REPAIR - TRUE GPU)
|
||||||
|
|
||||||
## Phase 1: Shader Development & Integration
|
## Phase 1: Robust Shader & FBO Foundation
|
||||||
- [ ] Task: Audit `src/shader_manager.py` to identify existing background/post-process integration points.
|
- [ ] Task: Implement: Create `ShaderManager` methods for downsampled FBO setup (scene, temp, blur).
|
||||||
- [ ] Task: Write Tests: Verify `ShaderManager` can compile and bind a multi-pass blur shader.
|
- [ ] Task: Implement: Develop the "Deep Sea" background shader and integrate it as the FBO source.
|
||||||
- [ ] Task: Implement: Add `FrostedGlassShader` (GLSL) to `src/shader_manager.py`.
|
- [ ] Task: Implement: Develop the 2-pass Gaussian blur shaders with a wide tap distribution.
|
||||||
- [ ] Task: Implement: Integrate the blur shader into the `ShaderManager` lifecycle.
|
- [ ] Task: Conductor - User Manual Verification 'Phase 1: Robust Foundation' (Protocol in workflow.md)
|
||||||
- [ ] Task: Conductor - User Manual Verification 'Phase 1: Shader Development & Integration' (Protocol in workflow.md)
|
|
||||||
|
|
||||||
## Phase 2: Framebuffer Capture Pipeline
|
## Phase 2: High-Performance Blur Pipeline
|
||||||
- [ ] Task: Write Tests: Verify the FBO capture mechanism correctly samples the back buffer and stores it in a texture.
|
- [ ] Task: Implement: Create the `prepare_global_blur` method that renders the background and blurs it at 1/4 resolution.
|
||||||
- [ ] Task: Implement: Update `src/shader_manager.py` or `src/gui_2.py` to handle "pre-rendering" of the background into a texture for blurring.
|
- [ ] Task: Implement: Ensure the pipeline correctly handles high-DPI scaling (`fb_scale`) for internal FBO dimensions.
|
||||||
- [ ] Task: Implement: Ensure the blurred texture is updated every frame or on window move events.
|
- [ ] Task: Conductor - User Manual Verification 'Phase 2: High-Performance Pipeline' (Protocol in workflow.md)
|
||||||
- [ ] Task: Conductor - User Manual Verification 'Phase 2: Framebuffer Capture Pipeline' (Protocol in workflow.md)
|
|
||||||
|
|
||||||
## Phase 3: GUI Integration & Rendering
|
## Phase 3: GUI Integration & Screen-Space Sampling
|
||||||
- [ ] Task: Write Tests: Verify that a mocked ImGui window successfully calls the frosted glass rendering logic.
|
- [ ] Task: Implement: Update `_render_frosted_background` to perform normalized screen-space UV sampling.
|
||||||
- [ ] Task: Implement: Create a `_render_frosted_background(self, pos, size)` helper in `src/gui_2.py`.
|
- [ ] Task: Implement: Update `_begin_window` and `_end_window` to manage global transparency and call the blur renderer.
|
||||||
- [ ] Task: Implement: Update panel rendering loops (e.g. `_gui_func`) to inject the frosted background before calling `imgui.begin()` for major panels.
|
- [ ] Task: Implement: Apply the new window wrappers to all primary panels in `src/gui_2.py`.
|
||||||
- [ ] Task: Conductor - User Manual Verification 'Phase 3: GUI Integration & Rendering' (Protocol in workflow.md)
|
- [ ] Task: Conductor - User Manual Verification 'Phase 3: GUI Integration' (Protocol in workflow.md)
|
||||||
|
|
||||||
## Phase 4: UI Controls & Configuration
|
## Phase 4: UI Tuning & Persistence
|
||||||
- [ ] Task: Write Tests: Verify that modifying blur uniforms via the Live Editor updates the shader state.
|
- [ ] Task: Implement: Add "Frosted Glass" tuning sliders to the Shader Editor.
|
||||||
- [ ] Task: Implement: Add "Frosted Glass" sliders (Blur, Tint, Opacity) to the **Shader Editor** in `src/gui_2.py`.
|
- [ ] Task: Implement: Update `src/theme_2.py` to persist all frosted glass settings.
|
||||||
- [ ] Task: Implement: Update `src/theme.py` to parse and store frosted glass settings from `config.toml`.
|
- [ ] Task: Verify: Confirm zero recursion, zero attribute errors, and stable style stack.
|
||||||
- [ ] Task: Conductor - User Manual Verification 'Phase 4: UI Controls & Configuration' (Protocol in workflow.md)
|
- [ ] Task: Conductor - User Manual Verification 'Phase 4: Final Polishing' (Protocol in workflow.md)
|
||||||
|
|||||||
@@ -1,34 +1,30 @@
|
|||||||
# Specification: Frosted Glass Background Effect
|
# Specification: Frosted Glass Background Effect (REPAIR - TRUE GPU)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
Implement a high-fidelity "frosted glass" (acrylic) background effect for all GUI panels and popups within the Manual Slop interface. This effect will use a GPU-resident shader to blur the content behind active windows, improving readability and visual depth while preventing background text from clashing with foreground UI elements.
|
Implement a high-fidelity "frosted glass" (acrylic) background effect using a dedicated OpenGL pipeline. This implementation follows professional rendering patterns (downsampling, multi-pass blurring, and screen-space sampling) to ensure a smooth, milky look that remains performant on high-DPI displays.
|
||||||
|
|
||||||
## Functional Requirements
|
## Functional Requirements
|
||||||
- **GPU-Accelerated Blur:**
|
- **Dedicated Background Pipeline:**
|
||||||
- Implement a GLSL fragment shader (e.g., Gaussian or Kawase blur) within the existing `ShaderManager` pipeline.
|
- Render the animated "Deep Sea" background shader to an off-screen `SceneFBO` once per frame.
|
||||||
- The shader must sample the current frame buffer background and render a blurred version behind the active window's background.
|
- **Multi-Scale Downsampled Blur:**
|
||||||
- **Global Integration:**
|
- Downsample the `SceneFBO` texture to 1/4 or 1/8 resolution.
|
||||||
- The effect must automatically apply to all standard ImGui panels and popups.
|
- Perform 2-pass Gaussian blurring on the downsampled texture to achieve a creamy "milky" aesthetic.
|
||||||
- Integrate with `imgui.begin()` and `imgui.begin_popup()` (or via a reusable wrapper helper).
|
- **ImGui Panel Integration:**
|
||||||
- **Real-Time Tuning:**
|
- Each ImGui panel must sample its background from the blurred texture using screen-space UV coordinates.
|
||||||
- Add controls to the **Live Shader Editor** to adjust the following parameters:
|
- Automatically force window transparency (`alpha 0.0`) when the effect is active.
|
||||||
- **Blur Radius:** Control the intensity of the Gaussian blur.
|
- **Real-Time Shader Tuning:**
|
||||||
- **Tint Intensity:** Control the strength of the "frost" overlay color.
|
- Control blur radius, tint intensity, and opacity via the Live Shader Editor.
|
||||||
- **Base Opacity:** Control the overall transparency of the frosted layer.
|
- **Stability:**
|
||||||
- **Persistence:**
|
- Balanced style-stack management to prevent ImGui assertion crashes.
|
||||||
- Save frosted glass parameters to `config.toml` under the `theme` or `shader` section.
|
- Strict 1-space indentation and class scope protection.
|
||||||
|
|
||||||
## Technical Implementation
|
## Technical Implementation
|
||||||
- **Shader Pipeline:** Use `PyOpenGL` to manage a dedicated background texture/FBO for sampling.
|
- **FBO Management:** Persistent FBOs for scene, temp, and blur textures.
|
||||||
- **Coordinate Mapping:** Ensure the blur shader correctly maps screen coordinates to the region behind the current ImGui window.
|
- **UV Math:** `(window_pos / screen_res)` mapping to handle high-DPI scaling and vertical flipping.
|
||||||
- **State Integration:** Store tuning parameters in `App.shader_uniforms` and ensure they are updated every frame.
|
- **DrawList Callbacks:** (If necessary) use callbacks to ensure the background is ready before panels draw.
|
||||||
|
|
||||||
## Acceptance Criteria
|
## Acceptance Criteria
|
||||||
- [ ] Panels and popups have a distinct, blurred background that clearly separates them from the content behind them.
|
- [ ] Toggling the effect does not crash the app.
|
||||||
- [ ] Changing the "Blur Radius" slider in the Shader Editor immediately updates the visual frostiness.
|
- [ ] Windows show a deep, high-quality blur of the background shader.
|
||||||
- [ ] The effect remains stable during window dragging and resizing.
|
- [ ] Blur follows windows perfectly during drag/resize.
|
||||||
- [ ] No significant performance degradation (maintaining target FPS).
|
- [ ] The "Milky" look is highly visible even at low radii.
|
||||||
|
|
||||||
## Out of Scope
|
|
||||||
- Implementing different blur types (e.g., motion blur, radial blur).
|
|
||||||
- Per-panel unique blur settings (initially global only).
|
|
||||||
|
|||||||
Reference in New Issue
Block a user