Fisheye Projection Matrix

I was just thinking about how to do a fisheye projection or at least simulate one. I understand that a fisheye projection is “nonlinear” so it’s not easy to do with the projection matrix. I was just curious about your thoughts on a projection matrix that simulated a fisheye (gluPerspective with ~180 degree fov) or would the best method be to write a vertex shader? Just curious about your thoughts :slight_smile:

~Nick

look at fisheye quake

If you have control over the tesselation of your models, go with the vertex shader approach. Otherwise, you can render to a cube map (three faces that share a corner come to mind), and then render a hemisphere centered at the eye, textured with the cube map. Since its nonlinear, you’re going to have to pick what kind of distortion you want to deal with.
-W