AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
Nans produced by ACES_Glow10 (Forward) under HLSL
- 主要言語
- C++
- スター
- 2.1k
- フォーク
- 505
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
I'm using the "studio-config-v1.0.0_aces-v1.3_ocio-v2.1" config and OCIO v2.2.0. Performing any DisplayView transform produces nans (showing up as black on the screen).
OCIO produces this line of HLSL code for the ACES_Glow10 (Forward) section:
```hlsl
float chroma = sqrt( outColor.rgb.b * (outColor.rgb.b - outColor.rgb.g) + outColor.rgb.g * (outColor.rgb.g - outColor.rgb.r) + outColor.rgb.r * (outColor.rgb.r - outColor.rgb.b) )
```
I can work around this issue by replace that line with `sqrt(max(0.0, ...))`. I've not yet found the specific ACES2065-1 values that produce this issue (but by eye they seem to all be close to gray). My source is a 8 bit Rec.709 video converted to ACES2065-1 and then the rgb components scaled by some value > 1 (e.g. 3). I'm doing the scale with a MatrixTransform.
It seems like the value in the sqrt can become negative in some circumstances. Possibly due to fp issues? Interestingly this only appears when the shader is compiled with `DXC_ARG_SKIP_OPTIMIZATIONS` (`-Od`).
This shader is running on an RTX 3080Ti, I've not tested on another machine on windows. I don't get this issue with Metal on mac. But it seems safest to me to just always add that `max` function.
コントリビューションガイド
調査の方向性
まず、指定された studio config、DXC_ARG_SKIP_OPTIMIZATIONS (-Od)、および記載されている Rec.709-to-ACES2065-1 MatrixTransform のスケーリングを使用して生成された ACES_Glow10 (Forward) shader を再現します。平方根への入力を調査し、報告されている HLSL 条件下で DisplayView transform が NaNs を生成しなくなっていることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- computer-graphics
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100