summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmytro Dadyka <d.dadyka@gmail.com>2015-03-25 16:07:49 -0700
committerJean-Philippe ANDRE <jpeg@videolan.org>2015-03-25 16:08:32 -0700
commitefecbef773633653949e824d6a3a37576c191bd7 (patch)
treecec7e09e04d6342d56b1fb4afec368e2bf7eec9e
parent0ef41604e88b8a8224818824217ebc09c93789d5 (diff)
[Evas: Evas_3D] Improve shaders math
Reviewers: cedric, jpeg Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2244 On many platforms the built-in mix(x, y, a) function faster than its equivalent x * a + y * (1 - a)
-rw-r--r--src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x106
-rw-r--r--src/modules/evas/engines/gl_common/shader_3d/include.shd13
2 files changed, 49 insertions, 70 deletions
diff --git a/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x b/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x
index f5b42e093d..eaf7ece7c9 100644
--- a/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x
+++ b/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x
@@ -26,8 +26,7 @@ static const char const vertex_color_vert_glsl[] =
26 "void main()\n" 26 "void main()\n"
27 "{\n" 27 "{\n"
28 " #ifdef VERTEX_POSITION_BLEND\n" 28 " #ifdef VERTEX_POSITION_BLEND\n"
29 " vec4 position = aPosition0 * uPositionWeight +\n" 29 " vec4 position = mix(aPosition1, aPosition0, uPositionWeight);\n"
30 " aPosition1 * (1.0 - uPositionWeight);\n"
31 " position = vec4(position.xyz, 1.0);\n" 30 " position = vec4(position.xyz, 1.0);\n"
32 "#else\n" 31 "#else\n"
33 "#ifdef VERTEX_POSITION\n" 32 "#ifdef VERTEX_POSITION\n"
@@ -95,8 +94,7 @@ static const char const diffuse_vert_glsl[] =
95 "void main()\n" 94 "void main()\n"
96 "{\n" 95 "{\n"
97 " #ifdef VERTEX_POSITION_BLEND\n" 96 " #ifdef VERTEX_POSITION_BLEND\n"
98 " vec4 position = aPosition0 * uPositionWeight +\n" 97 " vec4 position = mix(aPosition1, aPosition0, uPositionWeight);\n"
99 " aPosition1 * (1.0 - uPositionWeight);\n"
100 " position = vec4(position.xyz, 1.0);\n" 98 " position = vec4(position.xyz, 1.0);\n"
101 "#else\n" 99 "#else\n"
102 "#ifdef VERTEX_POSITION\n" 100 "#ifdef VERTEX_POSITION\n"
@@ -104,8 +102,7 @@ static const char const diffuse_vert_glsl[] =
104 "#endif // VERTEX_POSITION\n" 102 "#endif // VERTEX_POSITION\n"
105 "#endif //VERTEX_POSITION_BLEND\n" 103 "#endif //VERTEX_POSITION_BLEND\n"
106 " #ifdef VERTEX_TEXCOORD_BLEND\n" 104 " #ifdef VERTEX_TEXCOORD_BLEND\n"
107 " vTexCoord = aTexCoord0.st * uTexCoordWeight +\n" 105 " vTexCoord = mix(aTexCoord1.st, aTexCoord0.st, uTexCoordWeight);\n"
108 " aTexCoord1.st * (1.0 - uTexCoordWeight);\n"
109 "#else\n" 106 "#else\n"
110 "#ifdef VERTEX_TEXCOORD\n" 107 "#ifdef VERTEX_TEXCOORD\n"
111 " vTexCoord = aTexCoord0.st;\n" 108 " vTexCoord = aTexCoord0.st;\n"
@@ -142,8 +139,8 @@ static const char const diffuse_frag_glsl[] =
142 " vec4 color;\n" 139 " vec4 color;\n"
143 " \n" 140 " \n"
144 "#ifdef DIFFUSE_TEXTURE_BLEND\n" 141 "#ifdef DIFFUSE_TEXTURE_BLEND\n"
145 " color = texture2D(uTextureDiffuse0, vTexCoord) * uTextureDiffuseWeight +\n" 142 " color = mix(texture2D(uTextureDiffuse1, vTexCoord),\n"
146 " texture2D(uTextureDiffuse1, vTexCoord) * (1.0 - uTextureDiffuseWeight);\n" 143 " texture2D(uTextureDiffuse0, vTexCoord), uTextureDiffuseWeight);\n"
147 " color *= uMaterialDiffuse;\n" 144 " color *= uMaterialDiffuse;\n"
148 "#else\n" 145 "#else\n"
149 "#ifdef DIFFUSE_TEXTURE\n" 146 "#ifdef DIFFUSE_TEXTURE\n"
@@ -259,8 +256,7 @@ static const char const flat_vert_glsl[] =
259 "void main()\n" 256 "void main()\n"
260 "{\n" 257 "{\n"
261 " #ifdef VERTEX_POSITION_BLEND\n" 258 " #ifdef VERTEX_POSITION_BLEND\n"
262 " vec4 position = aPosition0 * uPositionWeight +\n" 259 " vec4 position = mix(aPosition1, aPosition0, uPositionWeight);\n"
263 " aPosition1 * (1.0 - uPositionWeight);\n"
264 " position = vec4(position.xyz, 1.0);\n" 260 " position = vec4(position.xyz, 1.0);\n"
265 "#else\n" 261 "#else\n"
266 "#ifdef VERTEX_POSITION\n" 262 "#ifdef VERTEX_POSITION\n"
@@ -268,16 +264,14 @@ static const char const flat_vert_glsl[] =
268 "#endif // VERTEX_POSITION\n" 264 "#endif // VERTEX_POSITION\n"
269 "#endif //VERTEX_POSITION_BLEND\n" 265 "#endif //VERTEX_POSITION_BLEND\n"
270 " #ifdef VERTEX_NORMAL_BLEND\n" 266 " #ifdef VERTEX_NORMAL_BLEND\n"
271 " vec3 normal = aNormal0.xyz * uNormalWeight +\n" 267 " vec3 normal = mix(aNormal1.xyz, aNormal0.xyz, uNormalWeight);\n"
272 " aNormal1.xyz * (1.0 - uNormalWeight);\n"
273 "#else\n" 268 "#else\n"
274 "#ifdef VERTEX_NORMAL\n" 269 "#ifdef VERTEX_NORMAL\n"
275 " vec3 normal = aNormal0.xyz;\n" 270 " vec3 normal = aNormal0.xyz;\n"
276 "#endif //VERTEX_NORMAL\n" 271 "#endif //VERTEX_NORMAL\n"
277 "#endif //VERTEX_NORMAL_BLEND\n" 272 "#endif //VERTEX_NORMAL_BLEND\n"
278 " #ifdef VERTEX_TEXCOORD_BLEND\n" 273 " #ifdef VERTEX_TEXCOORD_BLEND\n"
279 " vTexCoord = aTexCoord0.st * uTexCoordWeight +\n" 274 " vTexCoord = mix(aTexCoord1.st, aTexCoord0.st, uTexCoordWeight);\n"
280 " aTexCoord1.st * (1.0 - uTexCoordWeight);\n"
281 "#else\n" 275 "#else\n"
282 "#ifdef VERTEX_TEXCOORD\n" 276 "#ifdef VERTEX_TEXCOORD\n"
283 " vTexCoord = aTexCoord0.st;\n" 277 " vTexCoord = aTexCoord0.st;\n"
@@ -369,8 +363,8 @@ static const char const flat_frag_glsl[] =
369 "#ifdef DIFFUSE\n" 363 "#ifdef DIFFUSE\n"
370 " \n" 364 " \n"
371 "#ifdef DIFFUSE_TEXTURE_BLEND\n" 365 "#ifdef DIFFUSE_TEXTURE_BLEND\n"
372 " color = texture2D(uTextureDiffuse0, vTexCoord) * uTextureDiffuseWeight +\n" 366 " color = mix(texture2D(uTextureDiffuse1, vTexCoord),\n"
373 " texture2D(uTextureDiffuse1, vTexCoord) * (1.0 - uTextureDiffuseWeight);\n" 367 " texture2D(uTextureDiffuse0, vTexCoord), uTextureDiffuseWeight);\n"
374 " color *= uMaterialDiffuse;\n" 368 " color *= uMaterialDiffuse;\n"
375 "#else\n" 369 "#else\n"
376 "#ifdef DIFFUSE_TEXTURE\n" 370 "#ifdef DIFFUSE_TEXTURE\n"
@@ -386,8 +380,8 @@ static const char const flat_frag_glsl[] =
386 "#ifdef SPECULAR\n" 380 "#ifdef SPECULAR\n"
387 " \n" 381 " \n"
388 "#ifdef SPECULAR_TEXTURE_BLEND\n" 382 "#ifdef SPECULAR_TEXTURE_BLEND\n"
389 " color = texture2D(uTextureSpecular0, vTexCoord) * uTextureSpecularWeight +\n" 383 " color = mix(texture2D(uTextureSpecular1, vTexCoord),\n"
390 " texture2D(uTextureSpecular1, vTexCoord) * (1.0 - uTextureSpecularWeight);\n" 384 " texture2D(uTextureSpecular0, vTexCoord), uTextureSpecularWeight);\n"
391 " color *= uMaterialSpecular;\n" 385 " color *= uMaterialSpecular;\n"
392 "#else\n" 386 "#else\n"
393 "#ifdef SPECULAR_TEXTURE\n" 387 "#ifdef SPECULAR_TEXTURE\n"
@@ -404,8 +398,8 @@ static const char const flat_frag_glsl[] =
404 "#ifdef AMBIENT\n" 398 "#ifdef AMBIENT\n"
405 " \n" 399 " \n"
406 "#ifdef AMBIENT_TEXTURE_BLEND\n" 400 "#ifdef AMBIENT_TEXTURE_BLEND\n"
407 " color = texture2D(uTextureAmbient0, vTexCoord) * uTextureAmbientWeight +\n" 401 " color = mix(texture2D(uTextureAmbient1, vTexCoord),\n"
408 " texture2D(uTextureAmbient1, vTexCoord) * (1.0 - uTextureAmbientWeight);\n" 402 " texture2D(uTextureAmbient0, vTexCoord), uTextureAmbientWeight);\n"
409 " color *= uMaterialAmbient;\n" 403 " color *= uMaterialAmbient;\n"
410 "#else\n" 404 "#else\n"
411 "#ifdef AMBIENT_TEXTURE\n" 405 "#ifdef AMBIENT_TEXTURE\n"
@@ -419,8 +413,8 @@ static const char const flat_frag_glsl[] =
419 "#ifdef EMISSION\n" 413 "#ifdef EMISSION\n"
420 " \n" 414 " \n"
421 "#ifdef EMISSION_TEXTURE_BLEND\n" 415 "#ifdef EMISSION_TEXTURE_BLEND\n"
422 " color = texture2D(uTextureEmission0, vTexCoord) * uTextureEmissionWeight +\n" 416 " color = mix(texture2D(uTextureEmission1, vTexCoord),\n"
423 " texture2D(uTextureEmission1, vTexCoord) * (1.0 - uTextureEmissionWeight);\n" 417 " texture2D(uTextureEmission0, vTexCoord), uTextureEmissionWeight);\n"
424 " color *= uMaterialEmission;\n" 418 " color *= uMaterialEmission;\n"
425 "#else\n" 419 "#else\n"
426 "#ifdef EMISSION_TEXTURE\n" 420 "#ifdef EMISSION_TEXTURE\n"
@@ -511,8 +505,7 @@ static const char const phong_vert_glsl[] =
511 "}\n" 505 "}\n"
512 "void main() {\n" 506 "void main() {\n"
513 " #ifdef VERTEX_POSITION_BLEND\n" 507 " #ifdef VERTEX_POSITION_BLEND\n"
514 " vec4 position = aPosition0 * uPositionWeight +\n" 508 " vec4 position = mix(aPosition1, aPosition0, uPositionWeight);\n"
515 " aPosition1 * (1.0 - uPositionWeight);\n"
516 " position = vec4(position.xyz, 1.0);\n" 509 " position = vec4(position.xyz, 1.0);\n"
517 "#else\n" 510 "#else\n"
518 "#ifdef VERTEX_POSITION\n" 511 "#ifdef VERTEX_POSITION\n"
@@ -520,16 +513,14 @@ static const char const phong_vert_glsl[] =
520 "#endif // VERTEX_POSITION\n" 513 "#endif // VERTEX_POSITION\n"
521 "#endif //VERTEX_POSITION_BLEND\n" 514 "#endif //VERTEX_POSITION_BLEND\n"
522 " #ifdef VERTEX_NORMAL_BLEND\n" 515 " #ifdef VERTEX_NORMAL_BLEND\n"
523 " vec3 normal = aNormal0.xyz * uNormalWeight +\n" 516 " vec3 normal = mix(aNormal1.xyz, aNormal0.xyz, uNormalWeight);\n"
524 " aNormal1.xyz * (1.0 - uNormalWeight);\n"
525 "#else\n" 517 "#else\n"
526 "#ifdef VERTEX_NORMAL\n" 518 "#ifdef VERTEX_NORMAL\n"
527 " vec3 normal = aNormal0.xyz;\n" 519 " vec3 normal = aNormal0.xyz;\n"
528 "#endif //VERTEX_NORMAL\n" 520 "#endif //VERTEX_NORMAL\n"
529 "#endif //VERTEX_NORMAL_BLEND\n" 521 "#endif //VERTEX_NORMAL_BLEND\n"
530 " #ifdef VERTEX_TEXCOORD_BLEND\n" 522 " #ifdef VERTEX_TEXCOORD_BLEND\n"
531 " vTexCoord = aTexCoord0.st * uTexCoordWeight +\n" 523 " vTexCoord = mix(aTexCoord1.st, aTexCoord0.st, uTexCoordWeight);\n"
532 " aTexCoord1.st * (1.0 - uTexCoordWeight);\n"
533 "#else\n" 524 "#else\n"
534 "#ifdef VERTEX_TEXCOORD\n" 525 "#ifdef VERTEX_TEXCOORD\n"
535 " vTexCoord = aTexCoord0.st;\n" 526 " vTexCoord = aTexCoord0.st;\n"
@@ -644,8 +635,8 @@ static const char const phong_frag_glsl[] =
644 "#ifdef DIFFUSE\n" 635 "#ifdef DIFFUSE\n"
645 " \n" 636 " \n"
646 "#ifdef DIFFUSE_TEXTURE_BLEND\n" 637 "#ifdef DIFFUSE_TEXTURE_BLEND\n"
647 " color = texture2D(uTextureDiffuse0, vTexCoord) * uTextureDiffuseWeight +\n" 638 " color = mix(texture2D(uTextureDiffuse1, vTexCoord),\n"
648 " texture2D(uTextureDiffuse1, vTexCoord) * (1.0 - uTextureDiffuseWeight);\n" 639 " texture2D(uTextureDiffuse0, vTexCoord), uTextureDiffuseWeight);\n"
649 " color *= uMaterialDiffuse;\n" 640 " color *= uMaterialDiffuse;\n"
650 "#else\n" 641 "#else\n"
651 "#ifdef DIFFUSE_TEXTURE\n" 642 "#ifdef DIFFUSE_TEXTURE\n"
@@ -666,8 +657,8 @@ static const char const phong_frag_glsl[] =
666 " factor = pow(factor, uMaterialShininess);\n" 657 " factor = pow(factor, uMaterialShininess);\n"
667 " \n" 658 " \n"
668 "#ifdef SPECULAR_TEXTURE_BLEND\n" 659 "#ifdef SPECULAR_TEXTURE_BLEND\n"
669 " color = texture2D(uTextureSpecular0, vTexCoord) * uTextureSpecularWeight +\n" 660 " color = mix(texture2D(uTextureSpecular1, vTexCoord),\n"
670 " texture2D(uTextureSpecular1, vTexCoord) * (1.0 - uTextureSpecularWeight);\n" 661 " texture2D(uTextureSpecular0, vTexCoord), uTextureSpecularWeight);\n"
671 " color *= uMaterialSpecular;\n" 662 " color *= uMaterialSpecular;\n"
672 "#else\n" 663 "#else\n"
673 "#ifdef SPECULAR_TEXTURE\n" 664 "#ifdef SPECULAR_TEXTURE\n"
@@ -688,8 +679,8 @@ static const char const phong_frag_glsl[] =
688 "#ifdef AMBIENT\n" 679 "#ifdef AMBIENT\n"
689 " \n" 680 " \n"
690 "#ifdef AMBIENT_TEXTURE_BLEND\n" 681 "#ifdef AMBIENT_TEXTURE_BLEND\n"
691 " color = texture2D(uTextureAmbient0, vTexCoord) * uTextureAmbientWeight +\n" 682 " color = mix(texture2D(uTextureAmbient1, vTexCoord),\n"
692 " texture2D(uTextureAmbient1, vTexCoord) * (1.0 - uTextureAmbientWeight);\n" 683 " texture2D(uTextureAmbient0, vTexCoord), uTextureAmbientWeight);\n"
693 " color *= uMaterialAmbient;\n" 684 " color *= uMaterialAmbient;\n"
694 "#else\n" 685 "#else\n"
695 "#ifdef AMBIENT_TEXTURE\n" 686 "#ifdef AMBIENT_TEXTURE\n"
@@ -708,8 +699,8 @@ static const char const phong_frag_glsl[] =
708 "#ifdef EMISSION\n" 699 "#ifdef EMISSION\n"
709 " \n" 700 " \n"
710 "#ifdef EMISSION_TEXTURE_BLEND\n" 701 "#ifdef EMISSION_TEXTURE_BLEND\n"
711 " color = texture2D(uTextureEmission0, vTexCoord) * uTextureEmissionWeight +\n" 702 " color = mix(texture2D(uTextureEmission1, vTexCoord),\n"
712 " texture2D(uTextureEmission1, vTexCoord) * (1.0 - uTextureEmissionWeight);\n" 703 " texture2D(uTextureEmission0, vTexCoord), uTextureEmissionWeight);\n"
713 " color *= uMaterialEmission;\n" 704 " color *= uMaterialEmission;\n"
714 "#else\n" 705 "#else\n"
715 "#ifdef EMISSION_TEXTURE\n" 706 "#ifdef EMISSION_TEXTURE\n"
@@ -846,8 +837,7 @@ static const char const normal_map_vert_glsl[] =
846 "void main()\n" 837 "void main()\n"
847 "{\n" 838 "{\n"
848 " #ifdef VERTEX_POSITION_BLEND\n" 839 " #ifdef VERTEX_POSITION_BLEND\n"
849 " vec4 position = aPosition0 * uPositionWeight +\n" 840 " vec4 position = mix(aPosition1, aPosition0, uPositionWeight);\n"
850 " aPosition1 * (1.0 - uPositionWeight);\n"
851 " position = vec4(position.xyz, 1.0);\n" 841 " position = vec4(position.xyz, 1.0);\n"
852 "#else\n" 842 "#else\n"
853 "#ifdef VERTEX_POSITION\n" 843 "#ifdef VERTEX_POSITION\n"
@@ -855,8 +845,7 @@ static const char const normal_map_vert_glsl[] =
855 "#endif // VERTEX_POSITION\n" 845 "#endif // VERTEX_POSITION\n"
856 "#endif //VERTEX_POSITION_BLEND\n" 846 "#endif //VERTEX_POSITION_BLEND\n"
857 " #ifdef VERTEX_NORMAL_BLEND\n" 847 " #ifdef VERTEX_NORMAL_BLEND\n"
858 " vec3 normal = aNormal0.xyz * uNormalWeight +\n" 848 " vec3 normal = mix(aNormal1.xyz, aNormal0.xyz, uNormalWeight);\n"
859 " aNormal1.xyz * (1.0 - uNormalWeight);\n"
860 "#else\n" 849 "#else\n"
861 "#ifdef VERTEX_NORMAL\n" 850 "#ifdef VERTEX_NORMAL\n"
862 " vec3 normal = aNormal0.xyz;\n" 851 " vec3 normal = aNormal0.xyz;\n"
@@ -871,8 +860,7 @@ static const char const normal_map_vert_glsl[] =
871 "#endif //VERTEX_TANGENT\n" 860 "#endif //VERTEX_TANGENT\n"
872 "#endif //VERTEX_TANGENT_BLEND\n" 861 "#endif //VERTEX_TANGENT_BLEND\n"
873 " #ifdef VERTEX_TEXCOORD_BLEND\n" 862 " #ifdef VERTEX_TEXCOORD_BLEND\n"
874 " vTexCoord = aTexCoord0.st * uTexCoordWeight +\n" 863 " vTexCoord = mix(aTexCoord1.st, aTexCoord0.st, uTexCoordWeight);\n"
875 " aTexCoord1.st * (1.0 - uTexCoordWeight);\n"
876 "#else\n" 864 "#else\n"
877 "#ifdef VERTEX_TEXCOORD\n" 865 "#ifdef VERTEX_TEXCOORD\n"
878 " vTexCoord = aTexCoord0.st;\n" 866 " vTexCoord = aTexCoord0.st;\n"
@@ -1031,8 +1019,8 @@ static const char const normal_map_frag_glsl[] =
1031 "#ifdef DIFFUSE\n" 1019 "#ifdef DIFFUSE\n"
1032 " \n" 1020 " \n"
1033 "#ifdef DIFFUSE_TEXTURE_BLEND\n" 1021 "#ifdef DIFFUSE_TEXTURE_BLEND\n"
1034 " color = texture2D(uTextureDiffuse0, vTexCoord) * uTextureDiffuseWeight +\n" 1022 " color = mix(texture2D(uTextureDiffuse1, vTexCoord),\n"
1035 " texture2D(uTextureDiffuse1, vTexCoord) * (1.0 - uTextureDiffuseWeight);\n" 1023 " texture2D(uTextureDiffuse0, vTexCoord), uTextureDiffuseWeight);\n"
1036 " color *= uMaterialDiffuse;\n" 1024 " color *= uMaterialDiffuse;\n"
1037 "#else\n" 1025 "#else\n"
1038 "#ifdef DIFFUSE_TEXTURE\n" 1026 "#ifdef DIFFUSE_TEXTURE\n"
@@ -1052,8 +1040,8 @@ static const char const normal_map_frag_glsl[] =
1052 " factor = pow(factor, uMaterialShininess);\n" 1040 " factor = pow(factor, uMaterialShininess);\n"
1053 " \n" 1041 " \n"
1054 "#ifdef SPECULAR_TEXTURE_BLEND\n" 1042 "#ifdef SPECULAR_TEXTURE_BLEND\n"
1055 " color = texture2D(uTextureSpecular0, vTexCoord) * uTextureSpecularWeight +\n" 1043 " color = mix(texture2D(uTextureSpecular1, vTexCoord),\n"
1056 " texture2D(uTextureSpecular1, vTexCoord) * (1.0 - uTextureSpecularWeight);\n" 1044 " texture2D(uTextureSpecular0, vTexCoord), uTextureSpecularWeight);\n"
1057 " color *= uMaterialSpecular;\n" 1045 " color *= uMaterialSpecular;\n"
1058 "#else\n" 1046 "#else\n"
1059 "#ifdef SPECULAR_TEXTURE\n" 1047 "#ifdef SPECULAR_TEXTURE\n"
@@ -1074,8 +1062,8 @@ static const char const normal_map_frag_glsl[] =
1074 "#ifdef AMBIENT\n" 1062 "#ifdef AMBIENT\n"
1075 " \n" 1063 " \n"
1076 "#ifdef AMBIENT_TEXTURE_BLEND\n" 1064 "#ifdef AMBIENT_TEXTURE_BLEND\n"
1077 " color = texture2D(uTextureAmbient0, vTexCoord) * uTextureAmbientWeight +\n" 1065 " color = mix(texture2D(uTextureAmbient1, vTexCoord),\n"
1078 " texture2D(uTextureAmbient1, vTexCoord) * (1.0 - uTextureAmbientWeight);\n" 1066 " texture2D(uTextureAmbient0, vTexCoord), uTextureAmbientWeight);\n"
1079 " color *= uMaterialAmbient;\n" 1067 " color *= uMaterialAmbient;\n"
1080 "#else\n" 1068 "#else\n"
1081 "#ifdef AMBIENT_TEXTURE\n" 1069 "#ifdef AMBIENT_TEXTURE\n"
@@ -1092,8 +1080,8 @@ static const char const normal_map_frag_glsl[] =
1092 "#ifdef EMISSION\n" 1080 "#ifdef EMISSION\n"
1093 " \n" 1081 " \n"
1094 "#ifdef EMISSION_TEXTURE_BLEND\n" 1082 "#ifdef EMISSION_TEXTURE_BLEND\n"
1095 " color = texture2D(uTextureEmission0, vTexCoord) * uTextureEmissionWeight +\n" 1083 " color = mix(texture2D(uTextureEmission1, vTexCoord),\n"
1096 " texture2D(uTextureEmission1, vTexCoord) * (1.0 - uTextureEmissionWeight);\n" 1084 " texture2D(uTextureEmission0, vTexCoord), uTextureEmissionWeight);\n"
1097 " color *= uMaterialEmission;\n" 1085 " color *= uMaterialEmission;\n"
1098 "#else\n" 1086 "#else\n"
1099 "#ifdef EMISSION_TEXTURE\n" 1087 "#ifdef EMISSION_TEXTURE\n"
@@ -1147,8 +1135,7 @@ static const char const shadow_map_vert_glsl[] =
1147 "void main()\n" 1135 "void main()\n"
1148 "{\n" 1136 "{\n"
1149 "#ifdef VERTEX_POSITION_BLEND\n" 1137 "#ifdef VERTEX_POSITION_BLEND\n"
1150 " vec4 position = aPosition0 * uPositionWeight +\n" 1138 " vec4 position = mix(aPosition1, aPosition0, uPositionWeight);\n"
1151 " aPosition1 * (1.0 - uPositionWeight);\n"
1152 " position = vec4(position.xyz, 1.0);\n" 1139 " position = vec4(position.xyz, 1.0);\n"
1153 "#else\n" 1140 "#else\n"
1154 "#ifdef VERTEX_POSITION\n" 1141 "#ifdef VERTEX_POSITION\n"
@@ -1157,8 +1144,7 @@ static const char const shadow_map_vert_glsl[] =
1157 "#endif //VERTEX_POSITION_BLEND\n" 1144 "#endif //VERTEX_POSITION_BLEND\n"
1158 "#ifdef ALPHA_TEST_ENABLED\n" 1145 "#ifdef ALPHA_TEST_ENABLED\n"
1159 " #ifdef VERTEX_TEXCOORD_BLEND\n" 1146 " #ifdef VERTEX_TEXCOORD_BLEND\n"
1160 " vTexCoord = aTexCoord0.st * uTexCoordWeight +\n" 1147 " vTexCoord = mix(aTexCoord1.st, aTexCoord0.st, uTexCoordWeight);\n"
1161 " aTexCoord1.st * (1.0 - uTexCoordWeight);\n"
1162 "#else\n" 1148 "#else\n"
1163 "#ifdef VERTEX_TEXCOORD\n" 1149 "#ifdef VERTEX_TEXCOORD\n"
1164 " vTexCoord = aTexCoord0.st;\n" 1150 " vTexCoord = aTexCoord0.st;\n"
@@ -1222,8 +1208,7 @@ static const char const color_pick_vert_glsl[] =
1222 "void main()\n" 1208 "void main()\n"
1223 "{\n" 1209 "{\n"
1224 " #ifdef VERTEX_POSITION_BLEND\n" 1210 " #ifdef VERTEX_POSITION_BLEND\n"
1225 " vec4 position = aPosition0 * uPositionWeight +\n" 1211 " vec4 position = mix(aPosition1, aPosition0, uPositionWeight);\n"
1226 " aPosition1 * (1.0 - uPositionWeight);\n"
1227 " position = vec4(position.xyz, 1.0);\n" 1212 " position = vec4(position.xyz, 1.0);\n"
1228 "#else\n" 1213 "#else\n"
1229 "#ifdef VERTEX_POSITION\n" 1214 "#ifdef VERTEX_POSITION\n"
@@ -1329,8 +1314,7 @@ static const char const parallax_occlusion_vert_glsl[] =
1329 "void main()\n" 1314 "void main()\n"
1330 "{\n" 1315 "{\n"
1331 " #ifdef VERTEX_POSITION_BLEND\n" 1316 " #ifdef VERTEX_POSITION_BLEND\n"
1332 " vec4 position = aPosition0 * uPositionWeight +\n" 1317 " vec4 position = mix(aPosition1, aPosition0, uPositionWeight);\n"
1333 " aPosition1 * (1.0 - uPositionWeight);\n"
1334 " position = vec4(position.xyz, 1.0);\n" 1318 " position = vec4(position.xyz, 1.0);\n"
1335 "#else\n" 1319 "#else\n"
1336 "#ifdef VERTEX_POSITION\n" 1320 "#ifdef VERTEX_POSITION\n"
@@ -1338,8 +1322,7 @@ static const char const parallax_occlusion_vert_glsl[] =
1338 "#endif // VERTEX_POSITION\n" 1322 "#endif // VERTEX_POSITION\n"
1339 "#endif //VERTEX_POSITION_BLEND\n" 1323 "#endif //VERTEX_POSITION_BLEND\n"
1340 " #ifdef VERTEX_NORMAL_BLEND\n" 1324 " #ifdef VERTEX_NORMAL_BLEND\n"
1341 " vec3 normal = aNormal0.xyz * uNormalWeight +\n" 1325 " vec3 normal = mix(aNormal1.xyz, aNormal0.xyz, uNormalWeight);\n"
1342 " aNormal1.xyz * (1.0 - uNormalWeight);\n"
1343 "#else\n" 1326 "#else\n"
1344 "#ifdef VERTEX_NORMAL\n" 1327 "#ifdef VERTEX_NORMAL\n"
1345 " vec3 normal = aNormal0.xyz;\n" 1328 " vec3 normal = aNormal0.xyz;\n"
@@ -1354,8 +1337,7 @@ static const char const parallax_occlusion_vert_glsl[] =
1354 "#endif //VERTEX_TANGENT\n" 1337 "#endif //VERTEX_TANGENT\n"
1355 "#endif //VERTEX_TANGENT_BLEND\n" 1338 "#endif //VERTEX_TANGENT_BLEND\n"
1356 " #ifdef VERTEX_TEXCOORD_BLEND\n" 1339 " #ifdef VERTEX_TEXCOORD_BLEND\n"
1357 " vTexCoord = aTexCoord0.st * uTexCoordWeight +\n" 1340 " vTexCoord = mix(aTexCoord1.st, aTexCoord0.st, uTexCoordWeight);\n"
1358 " aTexCoord1.st * (1.0 - uTexCoordWeight);\n"
1359 "#else\n" 1341 "#else\n"
1360 "#ifdef VERTEX_TEXCOORD\n" 1342 "#ifdef VERTEX_TEXCOORD\n"
1361 " vTexCoord = aTexCoord0.st;\n" 1343 " vTexCoord = aTexCoord0.st;\n"
diff --git a/src/modules/evas/engines/gl_common/shader_3d/include.shd b/src/modules/evas/engines/gl_common/shader_3d/include.shd
index aea3c8f658..489c4ff17e 100644
--- a/src/modules/evas/engines/gl_common/shader_3d/include.shd
+++ b/src/modules/evas/engines/gl_common/shader_3d/include.shd
@@ -61,8 +61,8 @@ varying float vLightDist;
61 61
62define(`FRAGMENT_SHADER_TEXTURE_BLEND', ` 62define(`FRAGMENT_SHADER_TEXTURE_BLEND', `
63#ifdef $1_TEXTURE_BLEND 63#ifdef $1_TEXTURE_BLEND
64 color = texture2D(uTexture$2`0', vTexCoord) * uTexture$2Weight + 64 color = mix(texture2D(uTexture$2`1', vTexCoord),
65 texture2D(uTexture$2`1', vTexCoord) * (1.0 - uTexture$2Weight); 65 texture2D(uTexture$2`0', vTexCoord), uTexture$2Weight);
66 color *= uMaterial$2; 66 color *= uMaterial$2;
67#else 67#else
68#ifdef $1_TEXTURE 68#ifdef $1_TEXTURE
@@ -160,8 +160,7 @@ uniform float uColorWeight;
160 160
161define(`VERTEX_SHADER_POSITION', 161define(`VERTEX_SHADER_POSITION',
162`#ifdef VERTEX_POSITION_BLEND' 162`#ifdef VERTEX_POSITION_BLEND'
163 vec4 position = aPosition0 * uPositionWeight + 163 vec4 position = mix(aPosition1, aPosition0, uPositionWeight);
164 aPosition1 * (1.0 - uPositionWeight);
165 position = vec4(position.xyz, 1.0); 164 position = vec4(position.xyz, 1.0);
166`#else' 165`#else'
167 166
@@ -173,8 +172,7 @@ define(`VERTEX_SHADER_POSITION',
173 172
174define(`VERTEX_SHADER_NORMAL', 173define(`VERTEX_SHADER_NORMAL',
175`#ifdef VERTEX_NORMAL_BLEND' 174`#ifdef VERTEX_NORMAL_BLEND'
176 vec3 normal = aNormal0.xyz * uNormalWeight + 175 vec3 normal = mix(aNormal1.xyz, aNormal0.xyz, uNormalWeight);
177 aNormal1.xyz * (1.0 - uNormalWeight);
178`#else' 176`#else'
179 177
180`#ifdef VERTEX_NORMAL' 178`#ifdef VERTEX_NORMAL'
@@ -184,8 +182,7 @@ define(`VERTEX_SHADER_NORMAL',
184 182
185define(`VERTEX_SHADER_TEXCOORD', 183define(`VERTEX_SHADER_TEXCOORD',
186`#ifdef VERTEX_TEXCOORD_BLEND' 184`#ifdef VERTEX_TEXCOORD_BLEND'
187 vTexCoord = aTexCoord0.st * uTexCoordWeight + 185 vTexCoord = mix(aTexCoord1.st, aTexCoord0.st, uTexCoordWeight);
188 aTexCoord1.st * (1.0 - uTexCoordWeight);
189`#else' 186`#else'
190 187
191`#ifdef VERTEX_TEXCOORD' 188`#ifdef VERTEX_TEXCOORD'