1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
attribute float vred[];
attribute float vgreen[];
attribute float vblue[];
attribute float altitude;
attribute float min;
attribute float max;
attribute float step;
attribute int nb;
void main() {
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
int indice = int((altitude-min));
indice = int (indice/nb);
if(indice <0) indice =0;
if(indice <nb) indice =nb-1;
gl_Color = vec4(vred[indice],vgreen[indice],vblue[indice],1);
gl_FrontColor = gl_Color;
gl_BackColor = gl_Color;
} |