Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-demo.git] / resources / shaders / pbr_shader.vsh
1 #version 300 es
2
3 in vec3 aPosition;
4 in vec2 aTexCoord;
5 in vec3 aNormal;
6 in vec3 aTangent;
7
8 out vec2 vUV;
9 out vec3 vNormal;
10 out vec3 vTangent;
11 out vec3 vBitangent;
12 out vec3 vViewVec;
13 out mat4 uCubeMatrix;
14
15 uniform vec3 uSize;
16
17 uniform mat4 uMvpMatrix;
18 uniform mat3 uNormalMatrix;
19 uniform mat4 uModelMatrix;
20 uniform mat4 uModelView;
21 uniform mat4 uViewMatrix;
22
23
24 void main()
25 {
26   vec4 vPosition = vec4( aPosition * uSize , 1.0);
27   gl_Position = uMvpMatrix * vPosition;
28   vUV = aTexCoord;
29
30   vNormal = normalize(uNormalMatrix * aNormal);
31
32   vTangent = normalize(uNormalMatrix * aTangent);
33
34   vBitangent = cross(vNormal, vTangent);
35
36   vViewVec = (uModelView * vPosition).xyz;
37
38   uCubeMatrix  = transpose(uModelView);
39
40 }