PDA

View Full Version : Creating a uniform color LUT from a set of numbers



tborgers
05-02-2011, 05:47 AM
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...

ZbuffeR
05-02-2011, 07:11 AM
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).