Found this on shader toy for example https://www.shadertoy.com/view/MtjGRd which has a palette and sub palette array, but was unable to get anything happening in ISF without syntax errors. Testing the shadertoy example on the BookofShaders editor gives me a warning about GLSL3.0 so I'm wondering if it's even possible in ISF.
In the end, I created an alternate solution to determine an output color based on two menus (color and shade), but it's a bit messy. If there is a better way to do it, would be good to know.
The solution was to create constants for all the colors, create two lists (colorList and shadeList) and then read out the color with some if logic:
Code: Select all
int tableIndex = int((colorList * 10) + shadeList);
Code: Select all
if (tableIndex==0){selectedColor = red10;}
Code: Select all
//16-Color C64 color palette.
palette = vec3[](
RGB( 0, 0, 0),
RGB(255,255,255),
RGB(152, 75, 67),
RGB(121,193,200),
);