AcademySoftwareFoundation / OpenColorIO

A color management framework for visual effects and animation.
https://opencolorio.org
BSD 3-Clause "New" or "Revised" License
1.79k stars 455 forks source link

Option to force 2D texture resource for all 1D luts #1758

Closed num3ric closed 1 year ago

num3ric commented 1 year ago

Hi,

OCIO's GPU processor will automatically switch the texture resource type from a 2D texture to a 1D texture with sufficiently small 1D LUTs (i.e. going from 4096x2 to 2048x1). (As illustrated by the issue @remia discovered with our integration.) The OpenGL sample does implement this, but I'd unfortunately missed this behavior entirely.

Fixing this remains problematic however. Unreal does not support 1D textures, and for reference neither does Unity nor OpenGL ES / WebGL. (I believe any sampling performance difference is non-existent, making them superfluous?)

As such, having an option to disable their use and always default to 2d textures would be essential. As Remi suggested, something like a setAllowTexture1D exposed on the GpuShaderCreator or the GpuShaderDesc class would work.

(Happy to work on a PR if this feature request gets approved.)

doug-walker commented 1 year ago

Thank you for exploring this problem @num3ric, we would certainly welcome your help in addressing it!