bonjour
voila mon code shader
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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;
}

Ca ne compile pas.

Ce que je veux faire,c'est passer trois tableau de float ( R,G,B), un min, un max, un nombre de couleur, et déterminer la couleur en fonction d'un hauteur.

Merci pour votre aide.
:o