   Projective Texture Mapping for Spotlight
  Hi everyone,I've tried spotlight effect using projective texture mapping and it works fine. I've generated only seven texture coordinates by using glTexGen and rendered the spotlight effects by fragment shader. But, I want to render multiple spotlight effects in my scene (for example 20 spotlight effects).void main(void){    vec4 sceneColor = texture2D(baseTexture,gl_TexCoord[0].xy);    vec4 spotColor1 = texture2DProj(spotTexture1, gl_TexCoord[1]);    vec4 spotColor2 = texture2DProj(spotTexture2, gl_TexCoord[2]);    vec4 spotColor3 = texture2DProj(spotTexture3, gl_TexCoord[3]);    vec4 spotColor4 = texture2DProj(spotTexture4, gl_TexCoord[4]);    vec4 spotColor5 = texture2DProj(spotTexture5, gl_TexCoord[5]);    vec4 spotColor6 = texture2DProj(spotTexture6, gl_TexCoord[6]);    vec4 spotColor7 = texture2DProj(spotTexture7, gl_TexCoord[7]);    vec3 spotColor = spotColor1.rgb + spotColor2.rgb + spotColor3.rgb + spotColor4.rgb + spotColor5.rgb + spotColor6.rgb + spotColor7.rgb;    vec4 color = sceneColor * gl_LightSource[0].ambient;    float spotMapIntensity = 1 - gl_LightSource[0].diffuse.g / 3;    gl_FragColor = vec4(sceneColor.rgb * spotColor.rgb, 1.0) * spotMapIntensity + color;}Is there any suggestion about this subject? How about deferred lighting method?Thanks.Selman   
  Multiple passes would be one, it would also help you with all the versions of shaders you will have to write this way (1 spot + 6 point, 1 spot + 5 point).Deferred rendering solves this issue by having only one shader per type of light, so you will never run into this issue. It decouples the lighting contribution from the material. It's a whole different game though.   