ply ascii parser supports vertex colors

This commit is contained in:
Thomas FORGIONE
2017-01-18 10:27:34 +01:00
parent 5ee5d5c3f9
commit 1113c6d137
5 changed files with 78 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
varying vec3 fNormal;
varying vec4 fFrontColor;
vec3 ambientLight = vec3(0.2,0.2,0.2);
vec3 directionnalLight = normalize(vec3(10,5,7));
@@ -15,7 +16,7 @@ void main() {
vec4 color = texture2D(tex, gl_TexCoord[0].st);
vec4 fragColor = noTexColor * color;
gl_FragColor = fragColor;
gl_FragColor = fragColor * fFrontColor;
}

View File

@@ -1,10 +1,12 @@
varying vec3 fNormal;
varying vec4 fTexCoord;
varying vec4 fFrontColor;
void main() {
fNormal = gl_Normal;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
fFrontColor = gl_Color;
}