I’m taking my first steps with shadows, so to speak. When dealing with directional lights, I render each depth map to the same texture which works as a shadow atlas. Then I just scale down the projected coordinates and offset them in the final fragment shader. It’s kind of like a spritesheet.
This system works alright. But I’m wondering, can I do something similar with a cubemap for point lamps? I may be wording my searches wrong but I haven’t been able to find any examples of this.
Note that this approach is less than ideal, as the hardware has no knowledge of the boundary between sprites. It’s preferable to use a 2D array texture with a distinct layer for each light. More generally, 2D array textures should be used instead of atlases on any implementation which supports them.
You can’t have a cube map atlas, but you can have a cube map array texture (GL_TEXTURE_CUBE_MAP_ARRAY) with OpenGL 4.0 or the ARB_texture_cube_map_array extension. Note that most of the online reference pages haven’t yet been updated to include these. There is some information on the wiki. From the client side, they mostly behave like 2D array textures with 6×n layers.