Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm wondering if it is possible to generate a dynamic spherical environment map using a single frame render using a pincushion Curvilinear Perspective Projection Matrix (phew that's a mouthful).

I've been researching this for a few days now and the closest thing I can find is a Curvilinear Perspective but it isn't a commonly used projection matrix so there isn't any help I was easily able to google and I still don't know if it supports a full circle FOV.


The standard perspective matrix but it begins to look very strange and distorted above 180 degrees vertical FOV and completely fails to render when approaching 360 degrees. So instead most games render the scene 6 times using 90 degree FOV facing the faces of a cube.

Rendering the scene 6 times seems like a waste if it might be possible to simply imagine a camera that has a 360 degree view across both axis and then render that to a spherical environment map.

share|improve this question
It depends a bit on your geometry complexity. Your whole scene needs to be made of very small triangles, since that is what the graphics card will operate on. Your projection matrix will only transform vertices, which means that lines will be preserved as lines, not as curves. You might be able to do this using a geometry shader or similar. Or render to cubemap as possible with GL4/DX11, where you can render your scene in one drawcall. –  void Jun 13 '11 at 7:48
Correction, not one drawcall. But you don't have to render each face separately. –  void Jun 13 '11 at 9:39
@void Luckily my scene is entirely made of triangles. Thank you. Would you mind providing any references you know of? I found wiki.gamedev.net/index.php/… but it seems like the site is down and no cache is available. Beyond that result I'm having a hard time even when searching the term 'single pass environment map' –  NtscCobalt Jun 13 '11 at 14:43
Well, of course it is triangles. The question is how big they are and if they will look sane in a curvelinear mapping. your triangles will have to be something like 3-5 px big in the rendered reflection map to not look distorted. On single pass environment map: Microsoft has a sample in the DirectX SDK on how to do it with D3D10/11. For GL you can use multilayered framebuffer attachments and then set gl_Layer in your geometry program to output geometry to different cube sides. –  void Jun 13 '11 at 14:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.