Re: LUT tables in OCIO


Gonzalo Garramuno <ggar...@...>
 


  if (enableLut)
    {
      c.rgb = lutT + lutM * log( clamp(c.rgb, lutMin, lutMax) );
      c.rgb = exp( texture3D(lut, c.rgb).rgb ); 
    }


I was able to match the output of ociodisplay with a NUM_STOPS of 8, a lattice of 64x64x64 and with the following change to the shader code: 

      c.rgb = exp( scale * texture3D(lut, c.rgb).rgb + offset ); 

where scale and offset are based on the lut edge len, as shown in the original Sony Imageworks' GPUGems 2, chapter 24.

Now I need to understand why the GpuShaderDesc of OCIO spits out some more vector multiplications before the shader look up.  That seems to improve the lookup so that only a lattice of 32x32x32 is needed.

Join ocio-dev@lists.aswf.io to automatically receive all group messages.