Convert shaders in dali-demo to use shader compilation tool
[platform/core/uifw/dali-demo.git] / examples / rendering-skybox / shaders / rendering-skybox.vert
1 // Vertex shader for a skybox
2
3 attribute mediump vec3 aPosition;  // DALi shader builtin
4 uniform   mediump mat4 uMvpMatrix; // DALi shader builtin
5
6 varying mediump vec3 vTexCoord;
7
8 void main()
9 {
10   vTexCoord.x =  aPosition.x;
11   vTexCoord.y = -aPosition.y; // convert to GL coords
12   vTexCoord.z =  aPosition.z;
13
14   mediump vec4 vertexPosition = vec4(aPosition, 1.0);
15   vec4 clipSpacePosition = uMvpMatrix * vertexPosition;
16   gl_Position = clipSpacePosition.xyww; // Writes 1.0, the maximum depth value, into the depth buffer.
17                                         // This is an optimization to avoid running the fragment shader
18                                         // for the pixels hidden by the scene's objects.
19 }