phaser/plugins/mesh/Mesh.vert

27 lines
589 B
GLSL
Raw Normal View History

2020-09-18 16:51:23 +00:00
#define SHADER_NAME PHASER_MESH_VS
precision mediump float;
attribute vec3 aVertexPosition;
attribute vec3 aVertexNormal;
attribute vec2 aTextureCoord;
uniform mat4 uViewProjectionMatrix;
uniform mat4 uModelMatrix;
uniform mat4 uNormalMatrix;
varying vec2 vTextureCoord;
varying vec3 vNormal;
varying vec3 vPosition;
void main ()
{
vTextureCoord = aTextureCoord;
vPosition = vec3(uModelMatrix * vec4(aVertexPosition, 1.0));
vNormal = vec3(uNormalMatrix * vec4(aVertexNormal, 1.0));
gl_Position = uViewProjectionMatrix * uModelMatrix * vec4(aVertexPosition, 1.0);
}