1 // Vertex shader for a skybox
3 attribute mediump vec3 aPosition; // DALi shader builtin
4 uniform mediump mat4 uMvpMatrix; // DALi shader builtin
6 varying mediump vec3 vTexCoord;
10 vTexCoord.x = aPosition.x;
11 vTexCoord.y = -aPosition.y; // convert to GL coords
12 vTexCoord.z = aPosition.z;
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.