AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
Nans produced by ACES_Glow10 (Forward) under HLSL
- Lenguaje dominante
- C++
- Estrellas
- 2.1k
- Forks
- 503
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
Línea de trabajo
Comienza reproduciendo el shader ACES_Glow10 (Forward) generado con la configuración de estudio indicada, DXC_ARG_SKIP_OPTIMIZATIONS (-Od) y el escalado de Rec.709-to-ACES2065-1 MatrixTransform descrito. Inspecciona la entrada de la raíz cuadrada y verifica que la transformación DisplayView ya no produzca NaNs bajo las condiciones de HLSL indicadas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp
- Área
- computer-graphics
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100