Creating a uniform color LUT from a set of numbers

I’ve got a file with a list of numbers for a color LUT, with each line in the format r,g,b. I want to use this file to create a color LUT in GLSL.

Using JOGL, how can i pass the file contents to GLSL using a uniform variable? From the information i can find on LUT’s, i’ve found that i probably need a sampler3d, but I don’t quite see how i can create one from just a list of numbers…

Create a 1D texture, and sample it from the shader, as if it was an array.
Depending on the use, check your texture interpolation settings (GL_NEAREST or GL_LINEAR etc).

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.