# Cube map faster than 6 2D textures? - shadow mapping

I've managed to implement shadow mapping to a scene. However, I had problems using a cube map so I eventually gave it up and used 6 2D texture maps instead. To make this work with 6 2D maps, during the rendering process I have to identify in which texture of the 6 each fragment belongs. I'm afraid this could be dropping my frames significantly.

I'm not gonna go into many details for now. I will upload the relevant code if necessary. My main concern is if this method makes my program slower.Will my fps increase using a cube map?

• It probably will. Dec 30 '18 at 12:45
• Yes; it's a single texture and there's no branching logic required in your pixel/fragment shader. You should ask a new question about the problems you had with cube maps rather than editing or adding to this one, however. Dec 30 '18 at 13:15
• There are no answers here yet, so I see no harm in editing the question to ask about the problems you've had implementing a cube map version instead. Dec 30 '18 at 13:35
• I've already uploaded a question on the problems I've had. Actually, I have followed tutorials right on point and I don't know why it's not working. gamedev.stackexchange.com/questions/166342/… I'll give it a shot again since it will be faster. I will soon delete this question, thank you. Dec 30 '18 at 13:56

There is no need to use 6 individual textures as you can just use one big 2D strip with the dimensions x=shadowmap_width y= 6*shadowmap_height and then do 6 renderpasses adjusting the viewport to draw at the right place of the texture. (glViewport + glScissor in openGL).