AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
Nans produced by ACES_Glow10 (Forward) under HLSL
- Vorherrschende Sprache
- C++
- Sterne
- 2.1k
- Forks
- 503
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Rechercherichtung
Beginne damit, den mit der angegebenen Studio-Konfiguration, DXC_ARG_SKIP_OPTIMIZATIONS (-Od) und der beschriebenen Rec.709-to-ACES2065-1 MatrixTransform-Skalierung generierten ACES_Glow10 (Forward)-Shader zu reproduzieren. Untersuche die Eingabe der Quadratwurzel und verifiziere, dass die DisplayView-Transformation unter den gemeldeten HLSL-Bedingungen keine NaNs mehr erzeugt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp
- Bereich
- computer-graphics
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100