I’m creating fisheye projections in Unity3D for dome projection. The way I have done this since the early days of Unity was to implement a 4 pass camera model to create the required cube maps, render each camera to texture, apply those textures to meshes that implement the fisheye mapping, and finally view the result with an orthographic camera. But I was wondering about using a vertex shader to “warp” the vertices so that when the resulting geometry is viewed with an ortho camera the correct fisheye result is achieved. This has the advantage of only needing a single camera pass, it has the disadvantage of needing more tessellated geometry (“straight” lines in fisheye space are not “straight”).
Question: I know how to create the vertex shader, what I don’t know how to do is apply it to all existing geometry in an existing scene. Suggestions?
You’d have to replace all of the shaders in the scene with custom shaders. The nice thing is then you can make everything use tessellation shaders.