summaryrefslogtreecommitdiffstats
path: root/src/render/shaders/es2/pervertexcolor.vert
blob: 7fc3e649fa118d629fff8f5739ef4d73d0b09c1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
attribute vec3 vertexPosition;
attribute vec3 vertexNormal;
attribute vec3 vertexColor;

varying vec3 worldPosition;
varying vec3 worldNormal;
varying vec3 color;

uniform mat4 modelMatrix;
uniform mat3 modelNormalMatrix;
uniform mat4 mvp;

void main()
{
    worldNormal = normalize( modelNormalMatrix * vertexNormal );
    worldPosition = vec3( modelMatrix * vec4( vertexPosition, 1.0 ) );
    color = vertexColor;

    gl_Position = mvp * vec4( vertexPosition, 1.0 );
}