fix: #98 eye_strain GLSL にブラー段を追加し等価テストの偽装を解消#119
Merged
Conversation
eye_strain.frag が CPU vision::eye_strain の disk blur 段(半径 strength*1.5px)を欠いており、universal-experience の表示と CPU が乖離して いた。等価テスト simulate_eye_strain_glsl は実 .frag を読まずブラー段の無い 別アルゴリズムをインライン再実装しており、その欠落を隠蔽していた。 - eye_strain.frag に CPU と同一順序(contrast → vignette → disk blur)の ブラー段を追加。厳密 pillbox を Fibonacci lattice 16 tap で近似(#97 の photophobia.frag と同方式)。各 tap で contrast+vignette を再計算してから 円盤状に平均、linear sRGB 空間で処理 - simulate_eye_strain_glsl を新 .frag と式を 1:1 対応する形に書き換え、CPU・ .frag・sim の3者一致を保証(偽装解消) - shader_equiv_eye_strain_strength_0_5_psnr を追加。既存 strength=1.0 も新 sim で検証。PSNR は 32x32 で s=0.5→40.0dB / s=1.0→42.3dB(下限 30dB 超) - API 追加: eye_strain_uniforms(strength, width, height) と EyeStrainUniforms (uRadiusPx / uTexelSize)。eye_strain_glsl() の外部呼び出し元なし、既存 シグネチャ変更なしの純粋な追加
CPU↔GLSL 等価テストに以下6観点を追加(実装担当の strength=0.5 と重複なし): - strength=0.0 identity(CPU は byte-exact、GLSL は効果オフを高 PSNR で確認) - radius<0.5 境界(radius=0.45px で blur 段が無効化され center 経路を通ることを byte-exact 参照と一致で証明) - 大画像 128x128 の等価(16tap lattice 近似が破綻しないこと) - 非正方形 64x32 / 32x64 の等価(texel アスペクト下の blur 等方性) - 効果アサート(identity 偽陽性排除): 明暗エッジで contrast 圧縮、一様グレーで vignette 減光が実際に起きること simulate_eye_strain_glsl は eye_strain.frag と式が 1:1 対応していることを確認済み。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
関連 Issue
closes #98
問題
vision::eye_strainは contrast→vignette の後にstrength*1.5pxdisk blur を適用するが、eye_strain.fragは contrast+vignette のみでブラー段が無かった。simulate_eye_strain_glslが実 .frag を読まずブラー無しの別アルゴリズムをインライン再実装していたため、.frag のブラー欠落がテストから見えなかった(偽装)。変更内容
EyeStrainUniforms/eye_strain_uniforms(strength,width,height)新設(純追加、外部呼び出し元なし)simulate_eye_strain_glslを実 .frag 忠実ミラーに書き換え(偽装解消)。これで CPU・.frag・sim の3者が一致し、ブラー欠落が起きれば PSNR が崩れて検出される検証