Rendering a scene with a very wide FOV

IRC dump with extra useful info:

[17:19] From what I understand the lens of ordinary OpenGL camera cannot go above 179 degrees. What I need is to render the scene at 195 degrees, and make it mappable to a custom projection mesh, similar to what VR devices need. Also, the center of the camera has to be set differently than center of screen. Is this is in any way possible with Panda? Even if two renders have to be made and somehow stitched together that will also work.
[17:22] Yes, it’s possible
[17:23] regnavoimi: either you could look up the documentation for NonlinearImager in Panda3D (there are some code samples in the forums) or you could use cube map rendering and then use a shader or piece of geometry to distort that into whwatever way you wish
[17:24] regnavoimi: CylindricalLens - #4 by drwr
[17:26] Thank you. Is there a way to change camera’s center? And is there much difference of using a 3d modelled meshe’s UV map for distortion rather than a shader? Many people use shaders for this but from what I understand both should be fast enough
[17:26] I had meant to reply to your post sooner, now I did. :stuck_out_tongue:
[17:26] What do you mean by a camera’s centre?
[17:27] I think people may find a shader easier, and with a shader you can precisely define the relationship as a mathematical formula so you are not dependent on the mesh being sufficiently tessellated
[17:27] Well, the FOV distortion is applied from center to the edges of the FOV right now, I want the center and the resulting distortion to be offsetted in X axis
[17:28] With a UV map you need the mesh to be tessellated enough for it to work, but it is potentially more efficient / may work better on older hardware
[17:28] I think you can change this in the lens
[17:28] You should poke into the API reference for the Lens class
[17:29] I think setFilmOffset can be used to create an off-axis rendering
[17:30] setFilmOffset
[17:30] you bet me to it
[17:30] If all else fails you can always specify your own projection mat with a MatrixLens
[17:31] thanks