diff options
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.shd | 52 |
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 @@ | |||
1 | uniform mat4 uMatrixMvp; | ||
2 | |||
3 | #ifdef VERTEX_POSITION | ||
4 | attribute vec4 aPosition0; | ||
5 | #endif //VERTEX_POSITION | ||
6 | |||
7 | #ifdef VERTEX_POSITION_BLEND | ||
8 | attribute vec4 aPosition1; | ||
9 | uniform float uPositionWeight; | ||
10 | #endif //VERTEX_POSITION_BLEND | ||
11 | |||
12 | #ifdef VERTEX_TEXCOORD | ||
13 | attribute vec4 aTexCoord0; | ||
14 | #endif //VERTEX_TEXCOORD | ||
15 | |||
16 | #ifdef VERTEX_TEXCOORD_BLEND | ||
17 | attribute vec4 aTexCoord1; | ||
18 | uniform float uTexCoordWeight; | ||
19 | #endif //VERTEX_TEXCOORD_BLEND | ||
20 | |||
21 | #ifdef NEED_TEX_COORD | ||
22 | varying vec2 vTexCoord; | ||
23 | #endif //NEED_TEX_COORD | ||
24 | |||
25 | void 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 | } | ||