summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/shader_3d/diffuse_vert.shd
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/evas/engines/gl_common/shader_3d/diffuse_vert.shd')
-rw-r--r--src/modules/evas/engines/gl_common/shader_3d/diffuse_vert.shd52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_common/shader_3d/diffuse_vert.shd b/src/modules/evas/engines/gl_common/shader_3d/diffuse_vert.shd
new file mode 100644
index 0000000000..2b62b829cc
--- /dev/null
+++ b/src/modules/evas/engines/gl_common/shader_3d/diffuse_vert.shd
@@ -0,0 +1,52 @@
1uniform mat4 uMatrixMvp;
2
3#ifdef VERTEX_POSITION
4attribute vec4 aPosition0;
5#endif //VERTEX_POSITION
6
7#ifdef VERTEX_POSITION_BLEND
8attribute vec4 aPosition1;
9uniform float uPositionWeight;
10#endif //VERTEX_POSITION_BLEND
11
12#ifdef VERTEX_TEXCOORD
13attribute vec4 aTexCoord0;
14#endif //VERTEX_TEXCOORD
15
16#ifdef VERTEX_TEXCOORD_BLEND
17attribute vec4 aTexCoord1;
18uniform float uTexCoordWeight;
19#endif //VERTEX_TEXCOORD_BLEND
20
21#ifdef NEED_TEX_COORD
22varying vec2 vTexCoord;
23#endif //NEED_TEX_COORD
24
25void main()
26{
27
28#ifdef VERTEX_POSITION_BLEND
29 vec4 position = aPosition0 * uPositionWeight +
30 aPosition1 * (1.0 - uPositionWeight);
31 position = vec4(position.xyz, 1.0);
32#else
33
34#ifdef VERTEX_POSITION
35 vec4 position = vec4(aPosition0.xyz, 1.0);
36#endif // VERTEX_POSITION
37
38#endif //VERTEX_POSITION_BLEND
39
40#ifdef VERTEX_TEXCOORD_BLEND
41 vTexCoord = aTexCoord0.st * uTexCoordWeight +
42 aTexCoord1.st * (1.0 - uTexCoordWeight);
43#else
44
45#ifdef VERTEX_TEXCOORD
46 vTexCoord = aTexCoord0.st;
47#endif //VERTEX_TEXCOORD
48
49#endif //VERTEX_TEXCOORD_BLEND
50
51 gl_Position = uMatrixMvp * position;
52}