summaryrefslogblamecommitdiff
path: root/src/modules/evas/engines/gl_common/shader_3d/diffuse_vert.shd
blob: 2b62b829cc3b73f0085d67bf728d0db1fed167c5 (plain) (tree)



















































                                                 
uniform mat4  uMatrixMvp;

#ifdef VERTEX_POSITION
attribute   vec4  aPosition0;
#endif //VERTEX_POSITION

#ifdef VERTEX_POSITION_BLEND
attribute   vec4  aPosition1;
uniform     float uPositionWeight;
#endif //VERTEX_POSITION_BLEND

#ifdef VERTEX_TEXCOORD
attribute   vec4  aTexCoord0;
#endif //VERTEX_TEXCOORD

#ifdef VERTEX_TEXCOORD_BLEND
attribute   vec4  aTexCoord1;
uniform     float uTexCoordWeight;
#endif //VERTEX_TEXCOORD_BLEND

#ifdef NEED_TEX_COORD
varying vec2 vTexCoord;
#endif //NEED_TEX_COORD

void main()
{

#ifdef VERTEX_POSITION_BLEND
   vec4 position = aPosition0 * uPositionWeight +
   aPosition1 * (1.0 - uPositionWeight);
   position = vec4(position.xyz, 1.0);
#else

#ifdef VERTEX_POSITION
   vec4 position = vec4(aPosition0.xyz, 1.0);
#endif // VERTEX_POSITION

#endif //VERTEX_POSITION_BLEND

#ifdef VERTEX_TEXCOORD_BLEND
   vTexCoord = aTexCoord0.st * uTexCoordWeight +
   aTexCoord1.st * (1.0 - uTexCoordWeight);
#else

#ifdef VERTEX_TEXCOORD
   vTexCoord = aTexCoord0.st;
#endif //VERTEX_TEXCOORD

#endif //VERTEX_TEXCOORD_BLEND

   gl_Position = uMatrixMvp * position;
}