Files
behind_glass/docs/ref1-scene-simplification.md
T
2026-10-06 12:16:46 +09:00

40 lines
5.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Ref1 scene simplification: palette SSE experiment
## 최신 정정 — 눈·코 보호 유지
2026-09-14 사용자는 이 실험의 실제 출력을 확인한 뒤 눈·코 보호 예외를 제거하지 않도록 정정했다. 기존의 안전 palette 우선 보호와 필요한 픽셀의 원본색 fallback을 복원한다. 아래의 보호 제거 설명은 실험 당시 이력이다. SSE 선택, 배경의 큰 색면, 가장자리 색면 강도, 거리 감쇠 제거와 시점/70ms 보간은 유지한다.
복원 완료: `mosaic.frag`에서 원본 밝기 < 0.20이고 후보가 원본보다 0.16 초과 밝을 때 own palette → 허용 가능한 최암색 → 원본 RGB 순으로 보호한다. 눈·코를 인식하는 마스크가 아니라 어두운 특징에 공통 적용되므로 잔디의 작은 어두운 무늬도 일부 다시 남는다. dog1 / AI 상대 depth / 색면 1 / Grid 13 / 굴곡 1 / Distortion 1에서 정면과 +120px 이동의 두 눈·코 식별 및 큰 배경 색면 유지를 확인했다. axis-split, depth-distance, camera-history 테스트와 build 통과(기존 번들 크기 경고). 연속 영상 flicker나 실기기 FPS 검증은 아니다.
2026-09-14 update to the adopted comparison baseline in `docs/ref1-current-baseline.md`. The baseline itself remains unchanged; this records the follow-up experiment and its observed result.
## Change
이번 후속 작업은 눈·코의 어두운 색/원본 RGB 보호 분기를 제거하고 얼굴·사진 배경에 동일한 규칙을 적용한다. 복잡한 잔디에도 유효한 두 색 분할의 적용 신뢰도를 최소 0.85로 두며, 색면 강도에서 사진 가장자리의 광학 taper 감쇠를 분리했다. 굴절 자체의 가장자리 taper, 시점 반응 계수 0.18과 70ms 색면 보간은 유지한다. 단일 색밖에 관측되지 않는 셀에는 임의의 두 번째 색을 만들지 않는다.
The 8×8 cell samples are still assigned to the existing four-color palette. For each candidate axis and cut, the selector now tests distinct labels that were actually observed on their respective sides and minimizes the sum of squared palette-color error:
```text
costA(a) = Σ_l votesA[l] * distanceColor(p_l, p_a)
costB(b) = Σ_l votesB[l] * distanceColor(p_l, p_b)
score(a,b) = costA(a) + costB(b)
```
The existing `distanceColor` metric is used for every pixel, including dark pixels; there is no eye/nose exception. Candidate traversal and strict comparisons preserve deterministic tie order (X before Y; cuts 4, 3, 5, 2, 6; then ascending labels). The selected pair's sample accuracy and gain still determine the existing confidence curve, with the valid two-color model confidence floor of 0.85. A cell without an observed, distinct label on both sides keeps the radial fallback.
The previous count selector chose the observed label pair with the largest `votesA[a] + votesB[b]`, then chose the candidate with the highest pair accuracy. To restore that scoring rule, replace the `candidateCost`/`pairCost` comparisons in `src/shaders/region-palette.frag` with that pair-vote maximum and restore the cross-candidate `bestAccuracy` comparison. Palette fitting, metadata format, history smoothing, depth validity, distance-independent color application, edge-independent color strength, and view-dependent refraction were not changed in this experiment.
## Verification
Automated checks passed:
- `node scripts/test-region-axis-split.mjs` checks the SSE scoring formula, a fixture where SSE selects a different representative than count majority, observed-side constraints, exact horizontal/vertical cuts, checkerboard and single-label behavior, confidence, and metadata encoding.
- `node scripts/test-mosaic-depth-distance.mjs` passed 21 perspective reconstructions and the invalid-surface guards.
- `npm run build` passed. Vite reported the existing large-chunk warning.
Visual QA used dog1 with AI-estimated depth and the same front-view comparison settings (region strength 1, grid 10, curvature 1, distortion 1). The SSE version retained the large face and grass color planes. Where the count version had mostly absorbed the right eye into beige, SSE showed a weak brown shape, improving the overall expression in this sample. At +120 px camera movement, the large planes and face/background regions changed while remaining visible.
This does not guarantee eye or nose recognition: the left eye and nose contrast also became weaker. The comparison is a manual visual check on one photo, not a broad image evaluation or a measured frame-by-frame flicker/performance test. The selected SSE rule is adopted for this baseline follow-up, without claiming Ref1 is complete.
추가 브라우저 확인: dog1에서 색면 단순화 0은 큰 색면을 해제하고 원래 잔디 질감과 얼굴을 복원했다. 색면 1 / Distortion 0에서도 색면과 굴절이 해제된 출력을 확인했다. QA 종료 후 브라우저에서 관측했던 사용자 조절값인 색면 0.57 / Grid 13으로 복원했다. 이 값은 위 기준 비교값 1 / 10과 구분한다.