int Init ( ESContext *esContext )
{
UserData *userData = esContext->userData;
GLbyte vShaderStr[] =
"attribute vec4 a_position0; \n"
"attribute vec2 a_texCoord0; \n"
"varying vec2 v_texCoord0; \n"
"attribute vec2 a_texCoord1; \n"
"uniform mat2 rotMatrix ; \n"
"varying vec2 v_texCoord1; \n"
"void main() \n"
"{ \n"
// "int A; \n"
" gl_Position = a_position0; \n"
" v_texCoord0 = a_texCoord0; \n" // ((angle*3.14)/180)
" v_texCoord1 = mat2 (0.7,-0.7,0.7,0.7)*a_texCoord1; or rotMatrix*a_texCoord1; \n"
// " v_texCoord1.x = cos((angle*3.14)/180)*a_texCoord1.x-sin((angle*3.14)/180)*a_texCoord1.y; \n"
//" v_texCoord1.y = sin((angle*3.14)/180)*a_texCoord1.x+cos((angle*3.14)/180)*a_texCoord1.y; \n"
"} \n";
GLbyte fShaderStr[] =
"precision mediump float; \n"
"varying vec2 v_texCoord0; \n"
"varying vec2 v_texCoord1; \n"
"uniform sampler2D s_baseMap; \n"
"uniform sampler2D s_lightMap; \n"
"void main() \n"
"{ \n"
" vec4 baseColor; \n"
" vec4 lightColor; \n"
" \n"
" baseColor = texture2D( s_baseMap, v_texCoord0 ); \n"
" lightColor = texture2D( s_lightMap, v_texCoord1 ); \n"
" gl_FragColor = (baseColor) * (lightColor+0.25 ); \n"
"} \n";