I did this feature request (6 months ago) but esenthel is busy with EE 2.0.
http://www.esenthel.com/community/showth...p?tid=5273
Right now lightmaps only work in deferred mode, that means you can't use lightmaps for mobile applications (my case) since they use simple or forward renders modes. I've tried to code a shader for simple mode but always getting black texture.
I am going to share it, but doesn't work, I don't know why, looks like Tex(Lum, LightTex).rgb is always (0,0,0).
Code:
/******************************************************************************/
// VERTEX SHADER
/******************************************************************************/
void VS
(
// vertex input
VtxInput vtx,
// output
out Vec4 oPos:POSITION,
out Vec2 oDiffuseTex:TEXCOORD0,
out Vec2 oLightTex:TEXCOORD1
)
{
oDiffuseTex=vtx.tex(); // copy output texture coordinates
oLightTex=vtx.tex1();
Vec view_space_pos= TransformPos(vtx.pos4()) ; // transform input mesh vertex position by 'object/camera matrix' to view space
Vec view_space_nrm=Normalize(TransformDir(vtx.nrm ())); // transform input mesh vertex normal by 'object/camera matrix' to view space and normalize it
oPos=Project(view_space_pos); // return output position transformed by projection matrix
}
/******************************************************************************/
// PIXEL SHADER
/******************************************************************************/
Vec4 PS
(
Vec2 DiffuseTex:TEXCOORD0,
Vec2 LightTex:TEXCOORD1
):COLOR
{
Vec diff;
Vec light;
// Get the pixel color form the color texture.
diff = Tex(Col, DiffuseTex).rgb * MaterialColor().rgb;
// Get the pixel color from the light map.
light = Tex(Lum, LightTex).rgb;
Flt alpha=1.f;
return Vec4(diff*light,alpha);
}
/******************************************************************************/
// TECHNIQUE
/******************************************************************************/
TECHNIQUE(Main, VS(), PS());
You can learn more about renderer modes here:
http://www.esenthel.com/wiki/index.php?title=Renderers
You will not be able to create lightmaps with Esenthel editor.
PD: We are also using blender to create lightmaps.