I was trying again to understand shaders:
my goal would be to apply a normal map shader to my tilebased game.
I have a tilemap which is composed by rgb tiles, with "objects (Sprites - but could be meshes)" on top of it.
I am currently using a basic fog of war made with rendertarget and various "holes" in a black shape to simulate lights.
I'd like to "bump" these objects according to my existing lights. I can provide normal map textures for each object.
My textures come from a texturepack, so I am using atilim's trick to get texture regionshttp://giderosmobile.com/forum/discussion/comment/21594#Comment_21594
I understood that in normal map example there is a mesh with the "first texture" set here
local mesh = Mesh.new()
mesh:setVertexArray(0, 0, 512, 0, 512, 512, 0, 512)
mesh:setTextureCoordinateArray(0, 0, 512, 0, 512, 512, 0, 512)
mesh:setIndexArray(1, 2, 3, 1, 3, 4)
but I am missing a lot of things, starting from the basics:
1) "where" are the coordinates to the "normal map texture"?
2) Is it possible to add more than one light source? How?