jit.gl.bfg palette settings are mysterious (to me)

mattyo's icon

Can anyone enlighten me as to what the palette values in a colorized jit.gl.bfg mean, and how they interact? I notice that the first value goes between red and blue, the second between green & purple, and the third between a different blue and a kind of yellow, but I can't really figure out how the colorspace is being navigated -- can anyone give me some tips? All the ref says is: "Adjust the colorization effect when colorize is enabled (default = 0 1 2).', which doesn't tell me much...

thanks!

\M

Rob Ramirez's icon
mattyo's icon

Thanks, Rob!

Julien Bayle's icon

I can see in the bfg glsl code this single one use of palette variable:

color = 0.5 + 0.5 * cos( color.y * 6.2831 + palette );

In the link you mentioned, we can see a cosine based palette :
vec3 palette( in float t, in vec3 a, in vec3 b, in vec3 c, in vec3 d ) { return a + b*cos( 6.28318*(c*t+d) ); }

where a, b, c and d are all vec3 which gives more way to control color gradient.

Would you have another way to do that in Max ?

Actually, I was thinking about coloring the output using a kind of lookup table (?) but I think I can't.

pelo's icon

Hello,

Funny I am trying something similar.
Colorizing a Texture with a gradient which has more than 2 colors.
https://cycling74.com/forums/recolor-image-with-jit-gl-pix-using-a-3-color-gradient-mimic-%22tritone%22-efx

Perhaps someone has a hint how to generate and apply a color lookup table.

All the best,
Penelope