J'ai un fragment shader avec les éléments suivants:Table de recherche/shader palette sur l'iPhone
const lowp float colors[8] = float[8](// line 12
0,0,0,1,
1,0,0,1
);
mais il ne parvient pas à compiler:
ERROR: 0:12: 'array of float' : array type not supported here in glsl < 120
ERROR: 0:12: 'array of float' : constructor not supported for type
ERROR: 0:15: 'array of float' : no matching overloaded function found
ERROR: 0:12: 'const lowp float' : cannot declare arrays of this type
ERROR: 0:12: 'colors' : redefinition
Comment puis-je définir une table de consultation en GLSL? La texture d'entrée a des valeurs d'une énumération, dont chaque valeur doit être mappée à une couleur différente.
GLES2.0 ne supporte pas les textures 1D, mais j'ai utilisé une texture 2D de hauteur 1. – nornagon