- The spotlight shadow maps are regular 2D depth textures (A separate texture for each spotlight)
- The spotlight shadow maps are used in the shader as an array of sampler2DShadows ("shadowMaps[MAX_LIGHTS]")
Using an array of textures is not nearly the same as using an array texture. Of course, you have to bind every of your depth maps for itself to its own sampler. That's the whole point of array textures, because only with them, you don't need to do this. As I said in my last post.
All samplers in the 'shadowMaps'-array have different texture units bound to them, e.g.:
shadowMaps = Texture Unit 21; (GL_TEXTURE_20)
shadowMaps = Texture Unit 22; (GL_TEXTURE_21)
The spotlight shadow maps are then bound to the texture units the same way:
spotLightShadow -> GL_TEXTURE_20
spotLightShadow -> GL_TEXTURE_21
Now let's say there are only two spotlights. This means that no valid texture is bound to texture unit GL_TEXTURE_22, and thus shadowMaps.
This shouldn't be a problem, because shadowMaps isn't being used in the shader, but it causes the issues I've been talking about.
This is what I meant by 'ALL textures inside the array need to be bound to a valid depth texture'.