Yeah I use them but I have to retouch them, because, the background is not transparent and they are not on a big image.
And sometimes the shadow is rendered. (I don't need it, I can generate light and shadow myself with a shader)
I have begin to write a small shader for this :
perPixelLighting = new Shader();
const std::string vertexShader =
"void main () {"
"gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
"gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;"
"gl_FrontColor = gl_Color;"
"}";
const std::string fragmentShader =
"uniform sampler2D depthBuffer;"
"uniform vec3 resolution;"
"uniform vec4 lightPos;"
"uniform vec4 lightColor;"
"const vec2 size = vec2(2.0,0.0);"
"const ivec3 off = ivec3(-1,0,1);"
"void main () { "
"vec2 position = ( gl_FragCoord.xy / resolution.xy );"
"vec4 depth = texture2D(depthBuffer, position);"
"float s01 = textureOffset(depthBuffer, position, off.xy).z;"
"float s21 = textureOffset(depthBuffer, position, off.zy).z;"
"float s10 = textureOffset(depthBuffer, position, off.yx).z;"
"float s12 = textureOffset(depthBuffer, position, off.yz).z;"
"vec3 va = normalize (vec3(size.xy, s21 - s01));"
"vec3 vb = normalize (vec3(size.yx, s12 - s10));"
"vec3 bump = normalize(vec3 (cross(va, vb)));"
"vec4 pixPos = vec3 (position.x, position.y, depth.z, 0);"
"vec4 vertexToLight = lightPos - pixPos;"
"float attenuation = 1.0f - (length(vertexToLight) / lightPos.a);"
"vec3 dirToLight = normalize(vertexToLight.xyz);"
"float nDotl = dot (dirToLight, bump);"
"float attenuation *= nDotl;"
"gl_FragColor = lightColor * max(0.0f, attenuation);"
"}";
But it's for the 3D, and, I havent' tested yet.
The idea is to generate the normal map with the depth buffer.