Quake Lenses - F.A.Q.

### What's the point of this?

Mainly to see different ways of squeezing panoramic images on the screen. This has been done in photography and world maps, but rarely in the context of a game.

### Why choose an old game for a project like this?

Fisheye Quake already had the architecture implemented to make this project possible.

### Is this possible to do for modern games?

Yes, there are actually several ways to accomplish this.

Fisheye Quake was ported to OpenGL and is available in QuakeForge. It uses an evenly-spaced grid mesh for the screen. It then specifies cubemap texture coordinates at the vertices using the inverse mapping function. Another implemention is in the Cube engine (also from the author of Fisheye Quake) which instead uses evenly-spaced grid meshes for the cubemap faces. Then the cube faces are mapped to the screen using the forward mapping function. Details can be found here.

Stellarium uses a similar tesselation method for stereographic images of the sky. You can view a screenshot of that here.

Thomas K. Sharpless, creator of the Panini Projection, says here that you can implement it in OpenGL using a perspective projection of a cylinder texture on a cylinder mesh. In my opinion, this is likely the be-all and end-all of wide-angle gaming if it ever catches on.

OpenGL fragment shaders can also be used for a modern lens implementation. Using a fullscreen quad primitive, you can use a fragment shader program to map every pixel to the appropriate cubemap coordinate using the inverse mapping function.

### Do you plan on implementing this for modern games?

I'm actually hoping someone else will do it after looking at this. But if I do, I'll probably try it for Quake III or a racing game or flight sim, because those types of games have people who enjoy wide FOVs.

### What's the best lens to use?

In my opinion, stereographic projections are the only lenses you can use for considerable amount of time without getting motion sick. This is because they are just off-center perspective projections of an environment map. In English, this means you can move around the world and things around you warp fairly predictably according to perspective, which is good for preventing nausea.

So I suggest using either the stereographic or the panini lenses. I prefer Panini because it keeps vertical lines straight. I created a modified version of Panini called Gumby, which comprimises distortion in order to extend the range of Panini a little bit. It works by compressing the image horizontally along the cylinder and then vertically to compensate. I stick with Panini though.

### Where can I get more lenses?

The PROJ.4 project has close to 180 projections in their source code here. You can convert any of them to a Lua script using latlon_to_xy or xy_to_latlon since these follow the same coordinate systems used by PROJ.4. This is actually how I created several of the provided lenses.