docs: week 3 task 1 thob notes (material integrity)

This commit is contained in:
divyap 2026-04-15 15:19:18 +05:30
parent 95689beb85
commit ab5b9dead7

View File

@ -1,22 +1,19 @@
# Thob Builder Notes: Task 1 - Material Variant Switcher # Thob Observations: Week 3 Task 1 - Material Variant Integrity Audit
## Overview ### Thob Observations from Task Notes
Implemented the basic material configuration pattern using Thob's built-in `MaterialVariant` and `Material` properties. * **Reliability Test**: Switched between **3 Material Variants (Red, Blue, Yellow)** over 20+ times at high frequency.
* **State Consistency**: The 3D viewport successfully applied the correct material variant in 100% of the test cycles. No "stuck" states were observed between the Red, Blue, or Yellow selections.
* **Object Isolation**: Confirmed that switching the material on one mesh node does **not** affect other mesh instances in the scene unexpectedly. Property isolation is robust.
* **Material Instance Management**: Materials are correctly instantiated; no unintentional sharing of property mutations was observed between independent variant nodes.
* **Main limitation observed**: **UI-to-3D State Sync Latency.** During rapid stress-testing (clicks < 200ms apart), there is a visible delta where the UI button reflects the new state before the 3D material fully updates in the viewport.
* **Builder flow used**: RadioGroup + MaterialVariant stress cycles.
* **Complexity**: Low. The system is designed for this pattern.
* **Main limitation signals**: Spike in `GetBindingData` console warnings during the high-frequency switching phase.
* **Reliability Verdict**: **Reliable**.
## Visual Observations ### Console Warnings/Errors Seen (Deduplicated) and Probable Meaning
- **Lighting Limitation**: I observed that by default, the light only hits the object from one side, leaving the other side completely dark. 1. **High-Frequency Binding Redundancy**: `GetBindingData... method already registered`.
- **Surface Definition**: Standard material properties (color, roughness, metalness) were easy to edit via the sidebar properties panel. * *Observation*: Tested with multiple rapid-fire clicks. This is the **only** warning that persists during high-frequency material switching. It confirms that Thob's binding layer re-triggers its logic observers on every state transition, though it does not result in a visual crash.
## Technical Observations (Console Logs) ### Overall Read
During development in the builder, several warnings and errors were observed: The Material Variant system in Thob is **highly reliable** for standard configurator use cases. It maintains perfect state integrity and object isolation even under stress. The background console noise (the single GetBindingData alert) is the only technical signal during intensive state management.
- **404 Errors**: `GET https://builder.thob.studio/builder/... 404 (Not Found)`.
- **Hydration Warnings**: `No HydrateFallback element provided to render during initial hydration`.
- **Component State**: `undefined is changing from uncontrolled to controlled`. This suggests a potential issue in how the builder manages internal component state when swapping materials.
## Builder Workflow
- **Node Structure**: The scene was built using a `Canvas` -> `mesh` -> `sphereGeometry` hierarchy.
- **Variant Linking**: A `MaterialVariant` node was used to manage the switching logic.
- **UI Integration**: A simple `Button` was added under the `UI` group to trigger the material change.
## Conclusion
The builder makes it very easy to define and link material variants without writing code, but the default lighting environment needs more control (e.g., adding more lights or an environment map) to avoid the "dark side" effect.