- vertex:
- attribute vec3 aPosition;
- attribute vec3 aNormal;
- attribute vec2 aTexCoord;
- varying vec3 vNormal;
- varying vec2 vTexCoord;
- uniform vec4 uMyColor;
- varying vec4 vColor;
- uniform mat4 uModelView;
- uniform mat4 uPerspective;
- void main() {
- gl_Position = uModelView * vec4(aPosition, 1.0);
- vTexCoord = aTexCoord;
- vNormal = aNormal;
- vColor = uMyColor;
- }
- fragment:
- varying vec3 vNormal;
- varying vec2 vTexCoord;
- uniform sampler2D uTexture;
- uniform vec4 uMyColor;
- void main() {
- gl_FragColor = texture2D(uTexture, vTexCoord);
- }