Color grading using .cube LUTs

made a smol package so you can use .cube textures for color grading, idk how accurate it is rn will test out later to compare side-by-side w/ blender.

followed this spec: https://kono.phpage.fr/images/a/a1/Adobe-cube-lut-specification-1.0.pdf
package: babylon-cube-luts - npm
PG: https://playground.babylonjs.com/#WP9WDU#208
repo: GitHub - Heaust-ops/babylon-cube-luts: an extension to use .cube LUTS in babylonjs

1 Like

I wonder if we should add it like we do for the .3dl format: packages\dev\core\src\Materials\Textures\colorGradingTexture.ts

2 Likes

oh for sure, looking at how colorGradingTexture.ts works, I think that’s the better way to do it actually!

it even handles cases where 3d textures aren’t supported. extending that case can handle the .cube case where we get a 1D LUT.

a few questions tho

will prolly need different shaders depending on 1D or 3D LUT too.

also the most we can do trilinear w/ the texture options but the .cube spec demands tetrahedral so rn experimenting w/ that. I think most programs do trilinear anyway and give you the option to switch to tetrahedral which just has a more expensive shader altogether. (not sure but rn it’s looking that way)

1 Like

About the shader code it is all handled for you in imageProcessingFunctions.fx and would work everywhere image processing is applied in babylon :slight_smile:

1 Like

nice! I’ll check it out :slight_smile:

1 Like