I think a lot of games solve this problem by just not having shadowmap support for point lights
They use a single 2D texture with all 6 faces on it.
I just can't figure out how to filter the cubemaps for the omnidirectional lights.
Filtering a cubemap texture is extremely slow.
The solution is not to use cubemaps at all. Use a single 2D texture.
If you want a cubemap resolution of 512-by-512, make a 2D texture 512-by-3,072.
The [0,0] - [512,512] area is the left face.
The [0,512] - [512,1024] area is the front face.
You render each face of the “cube” into one 512-by-512 section of the 2D texture.
Next you perform filtering. This is fairly basic. You simply have to make a coordinate converter so that taps off the edge of one face go to the proper part of the texture where the correct face is stored.
With that function, filtering is done the standard way.
Rendering with that texture is also fairly basic.
You just have to write your own 3D coordinate converter to take a 3D vector and pick the correct part of the texture to read. This can be made very efficient depending on how you organize the faces of the cube inside the texture.
This is how most game companies do it, and it runs in real-time on devices as low as iPad 3/Xbox 360/PlayStation 3.
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums