Camera Series
Fisheye and Panoramic Projection
Version 1.0, Updated Jun 2024 using Octane 2023.1.3 and Cinema 4D 2024.4
About this guide
This is part of a series on using the Octane Camera. It was written using Cinema 4D, but the core concepts should hold in any incarnation of Octane.
This guide looks at the Fisheye mode in the Universal Camera and the various Panoramic modes in both the Universal and Panoramic cameras.
It assumes that you’re already familiar with all of the basic settings of the Octane Camera and know how to change cameras and modes. This is all explained in (exhaustive) detail in the Octane Camera: Thin Lens & Universal Camera Types guide.
It’s also helpful to at least skim through Photography Concepts for 3D artists to learn more about photography as it relates to 3D.
PDF
PDF Version of this guide can be found here
Part I: Intro
Graphical projection is a technique for taking a 3D scene and displaying it on a 2D surface. The most common projection for physical camera gear is called “perspective”. Objects appear larger or smaller depending on proximity to the lens, and parallel lines appear to converge as they go back into space.
Most camera lenses are “rectilinear”, which means lines that are straight in the scene also appear straight in the image that’s captured. This is the same way our eyes see. This is also what both C4D’s camera, and Octane’s default Thin Lens or Universal Camera use.
All of the standard camera settings and behaviors are covered in the Octane Camera: Thin Lens & Universal Camera Types guide.
This guide covers some of the non-standard projections and modes found in the Universal and Panoramic camera types.
These modes overlap between the camera types as we can see above. Fisheye mode is only available in the Universal camera type, and cylindrical mode is only available in the Panoramic camera type. Both camera types have a mode for Equirectangular/Spherical projection and Cube map.
Fisheye lenses are used in the real world in cases where we need a very wide field of view. Rectilinear lenses start to get difficult to manufacture and way too distorted to be useful and as they exceed a 120° horizontal field of view. Fisheyes usually start at 180° and can go as wide as ~240°+ (so they’re actually seeing behind themselves). They achieve this by using curvilinear distortion rather than rectilinear. This means straight lines appear to curve and bulge out from the center axis, giving the image a unique look.
Panoramic lenses are for capturing wider fields of view than rectilinear or even fisheye lenses. All three panoramic modes can capture a full 360° of horizontal view. In Octane, panoramic projection is more used as a utility for building HDRI/AR/VR environments and lights, but it’s possible to get artistic panoramas out of them as well as we’ll see.
Fisheye
All images from Unsplash
A fisheye lens that produces curvilinear images as opposed to the standard rectilinear images we’re used to. This means straight, parallel lines appear to curve around a central axis rather than stay straight and parallel. All other perspective rules hold true - objects further away appear smaller than ones closer, and lines do converge and foreshorten as they go back in space, just in a fun curvy way.
The illustration above shows our camera sitting in the center of a ring of poles. In the first panel, it’s fitted with one of the widest rectilinear ultra wide lenses we can buy in a store today - a 12mm. This gets in about 113° of the scene (horizontally), which translates to being able to see seven of the 24 poles. Next to that is a theoretical 6mm rectilinear ultrawide which gets us about 143° and we can now see nine of the poles, but becomes very difficult to work with due to the extreme perspective distortion. The straight lines are still straight, but it’s super wonky because it’s pinched in the middle and stretched on the edges.
To the right of that is a standard 180° fisheye lens. This is getting us - as advertised - 180 degrees of horizontal view, and now we can see 13 poles. The fisheye is achieving this massive field of view by spherizing the scene. All our nice parallel horizontal and vertical lines are curved, but it’s a lot easier to make sense of the scene compared to the rectilinear 6mm thanks to this type of distortion.
To the right of that Octane’s default Fisheye lens which gets in 240°, where we can now see at least some of all of the poles - it’s so wide that it’s actually seeing behind itself. This can’t be achieved with an ultrawide, and even if it could, the distortion would be so bad it would be unusable in pretty much all applications because we just wouldn’t be able to make out what we’re looking at.
Octane does let us go even wider with a fisheye - in fact, we can get to about 359.9°, but that’s not super useful unless we’re doing some acid trip type animation where we animate the angle from 360° to something like 180° (try it, it’s actually pretty cool).
Fisheye in Octane
Octane has a dedicated Fisheye mode in the Universal Camera. We can also kind of build our own fisheye lens using spherical or barrel distortion in the Universal Camera’s Thin Lens mode. Each of these have their own advantages and disadvantages.
Important: C4D itself does not have a fisheye mode in its standard camera, so the viewport will not match what we see in the Live Viewer. There is a workaround for this that we’ll explore in a bit.
Universal Camera: Fisheye mode
When we switch our camera type to Universal in the Thinlens tab, the tab itself gets renamed to “Universal”. In this new Universal tab, we can change the Camera mode to Fisheye. From here, if we look further down in the Universal tab, we’ll see the Fisheye settings. These settings are always here regardless of the mode we’re in, but they don’t do anything unless we’re in Fisheye mode.
The Fisheye angle is how wide the field of view is (both horizontally and vertically). We usually want to start at 180° and work our way toward 240°. More than 240° gets increasingly difficult to work with.
Nearly all lens assemblies use perfectly circular elements. This means that the images they are capable of capturing are perfect circles. Nearly all film and digital sensors, on the other hand, produce images in a rectangular or square format. This leads to a problem - either the full circle is projected inside the rectangle, everything is captured, and there are blacked out areas around the edges, or the circle is projected larger than the rectangle, some of the captured data is cropped out, and the image goes edge to edge and fills the rectangle.
Rectilinear lenses are almost always built to overshoot and crop because getting a full image is more important than details on the far edges. Fisheyes can go either way because sometimes stuff on the edges is more important than filling the frame (think CCTV surveillance camera).
In Octane, we can choose either method in the Fisheye type dropdown.
Circular will create an inscribed blacked out circular edges around the frame. Full frame will crop in so the edges disappear, but there will be less field of view.
But this isn’t a real world camera, though, is it? :). If we pick Circular mode and uncheck Hard vignette, Octane fills in our corners for us so we get the best of both worlds!
There are a few ways to calculate the fisheye distortion itself. These methods are called mapping functions. Octane refers to them as “Fisheye projections” and allows us to choose between them using the Fisheye projection dropdown.
The four functions/projections Octane simulates are Stereographic (default, least distortion around the edges of the four), Equidistant (more bulbous center), Equisolid (slightly more bulbous than Equidistant, and standard in less expensive real-world lenses), and Orthographic (most bulbous).
Note: Orthographic doesn’t support Hard Vignette, so it’s always in a circle, and it can’t go more than 180°.
Framing with fisheye
The more extreme we get with the angle, the more difficult it is to frame the scene, especially since C4D’s native camera can’t show fisheye distortion in the viewport (and <8mm gets extremely wonky).
Redshift’s camera CAN show fisheye distortion in the viewport, however, and every C4D user has access to this now, which is great.
Unfortunately, we can’t put an Octane Camera Tag on a Redshift Camera and have it render properly, but what we can do is nest an Octane camera under a Redshift camera (and remember to zero out the Octane Camera’s coordinates to the RS one once it’s nested). If we set the RS cam to Fisheye projection in the Object tab, set the Angle of View the same as the Angle that we set our fisheye Octane camera to, voila, we can now preview what our fisheye will look like.
Note: Redshift’s Fisheye is the Equidistant type if we really want a 1:1 match and pinpoint accuracy, but it’s generally good enough to frame any fisheye type that Octane supports.
Important: When it comes time to view in the Live Viewer or render, we just need to remember to switch cameras to the nested Octane camera.
Other Fisheye Methods
We can make our own reasonably wide fisheye with the Universal Camera set to Thinlens mode by applying Spherical distortion. The shorter the focal length, the wider the angle and stronger the effect, but since C4D’s focal length setting has a minimum of 1 mm, we can only get to ~173.6°. Practically, anything over 140° becomes very difficult to work with because of focusing and framing issues.
Why would we want to do this? Turns out that most other distortion, aberration, and optical vignetting settings do not work in Fisheye mode, so if we want to customize our bokeh, building our own fisheye is the only way that’s going to happen as of this writing. Chromatic aberration is the current exception since it’s a post effect.
Important: Spherical distortion “inflates” the scene from the center of the focus plane. Stuff in the middle of the frame gets closer to the camera and stuff on the edges goes back into the distance. Octane doesn’t move the focus plane to compensate, so it’s difficult to keep the subject in focus when using this kind of distortion. There is probably a formula to calculate this (if you know it, please leave it in the comments), but usually just setting up a null as a focus object and nudging it closer to the camera works well enough.
The Fisheye camera mode does compensate for this so it’s easier to maintain focus, but we can’t use any of the other aberration, optical vignetting or distortion settings with it.
Barrel distortion produces a similar effect, but rather than inflate the scene, it bends all the objects and the focal plane back in space. This produces a very different look, and since the focal plane bends, it doesn’t truly mimic a fisheye. In the illustration above we can see the difference - the white targets always stay in focus with barrel distortion while they go out of focus with spherical and fisheye distortion. We can also see what happens to the focus plane when we use Spherical distortion.
Panoramic Projection
In the photography world, panorama is generally accepted to mean “an image with a wide aspect ratio”, used to show off landscapes, cityscapes, and anything that better reads in a wide format. In Octane, panoramic projections are typically used to create images for environmental lighting (HDRI) and reflection maps, but we can also use them to build what we’d traditionally think of as “panoramas”.
Panoramic Modes in Octane
As of this writing, Octane supports three different panoramic projections: Spherical/Equirectangular, Cylindrical, and Cube Map.
Spherical/Equirectangular is used to create HDRI images and output for render engines and AR/VR systems that accept this type of projection.
Cube Map is for engines that use Skybox-type environmental lighting and reflection maps.
Cylindrical isn’t typically found out in the wild except in the case of Mercator projection world maps, but it’s here in case we need it for anything.
There’s both a dedicated Panoramic camera type, and various Panoramic modes in the Universal Camera. Where these two overlap, the render is identical. Most of the time we will want to use the Universal Camera type because we have other controls that we don’t get in the Panoramic camera type, but if we want Cylindrical projection, Panoramic is our only choice.
Spherical / Equirectangular Mode
Spherical mode in the Panoramic Camera type, and Equirectangular mode in the Universal Camera type are identical. Both distort the render so that it maps properly to the inside of a sphere.
Controls for the Panoramic camera set to Spherical mode are located in the Viewing Angle section of the Panoramic tab. Controls for the Universal camera type in Equirectangular mode are located in the Panoramic section of the Universal tab (confusing :/).
In both cases, the controls are basically just how much viewing angle we want horizontally and vertically (fov = field of view, measured in degrees), and whether we want to force the camera to be upright.
Typically we want the aspect ratio between the horizontal and vertical fov to match the aspect ratio of the frame, so if our resolution is 2000x1000px (2:1 aspect ratio), we’ll want to use a 2:1 fov aspect ratio like 180°x90° or 240°x120°.
Building an HDRI image
Most applications that can use HDRIs want them in a 2:1 aspect ratio. For memory optimization purposes, the resolution is usually in powers of two (1024x512, 2048x1024, 8192x4096, etc). The fov should be the full 360°(horizontal) x 180°(vertical) so the whole scene is captured and the result is seamless.
We want our spherical/equirectangular camera to be perfectly upright (there’s even a checkbox for this), not rotated in any way (R.H/R.P/R.B = 0), positioned at world X (P.X=0) and world Z (P.Z=0). Y position can be variable, but if we’re going for a realistic scene from the vantage point of a person, we’ll want the camera at eye level (P.Y = ~170cm).
An HDRI should be considered lighting data. Because of this, the file should be exported as a linear 32-bit EXR so that it can be used as a proper light source. It’ll look weird in a 2D photo editor, but 3D applications will know what to do with it.
The lighting in the scene that’s being captured should be physically plausible with real world values.
AR/VR/other systems may have different specs and targets, so it’s worth looking into that prior to building out the scene.
Panoramic Camera for Panoramas
The different panoramic camera modes can be used for what we’d think of as “Panoramas” (wide-aspect images meant for display), but with some caveats.
There’s no avoiding distortion using panoramic projection. There are ways to minimize it, but the fact is that there’s an upper limit to how wide a rectilinear lens can get, so to see more, spherical and cylindrical projections need to bend light in extreme ways to get it all projected on the “sensor”, which means the rendered lines are curved so they properly map back to a sphere once re-projected.
Cube map basically shoots four rectilinear images and stitches them together to form a cubic environment. While this stays rectilinear and works great as an environment, it can produce some weird looking seams if we try to use it as a single flat image.
Distortion
In the Illustration above, all cameras are inside the center of a cube, and they’re all perfectly upright - no rotation at all. The rectilinear projection 10mm ultra wide is about as wide as we can go with this type of projection, and we can see about 122° of the scene. The Fisheye gets us to 240°. Wider is possible, but the resulting image is hard to use, and the distortion gets really wild toward the edges of the frame.
The Cylindrical and Spherical modes show us the full 360°, so we can see all of all four walls. Any horizontal lines that are above and below the horizontal center of the image will curve. Vertical lines that are at 0°, +/-90°, and +/-180° will be straight. All other lines will bend out from them.
Note: Cylindrical Projection’s vertical fov does NOT go the full 180° - it will break the render. A good start is V:160° and then reduce it from there.
Minimizing Distortion
When using a spherical/equirectangular or cylindrical camera, to avoid as much distortion as possible, the camera should be upright. Tweaking the R.H (pan) is fine to find a good left-right center point, but R.P (tilt) and R.B (roll) need to be at zero, otherwise the whole scene will appear to bend up or down.
Spherical/equirectangular and cylindrical projection distorts images the least along the horizontal axis, and then it just gets worse as it goes further up or down the vertical axis.
Minimizing the vertical fov means we can avoid a lot of the super distorted areas on the top and bottom. If we want to keep the full 360° of horizontal fov, we can take a vertical center crop by changing the aspect ratio (and vertical fov to match) so we end up with a much wider render. If we don’t care so much about the horizontal fov, we can just reduce both that and the vertical proportionately (e.g. 180°x60°).
Cube Map Projection
Octane also offers Cubemap projection, which is used in some video game engines and some render engines that use “skybox” type environments. It’s available in both the Panoramic and Universal cameras and offers a few different layouts, as well as an equi-angular mode in the Universal Camera only.
In some cases, we might be able to get a decent rectilini-ish pano out of stitching the X and Z panels of the cube map together. Horizontally, this provides 360°, so the left edge of the left panel will stitch perfectly with the right edge of the right panel, meaning we have a few options for how to order them.
Important: the output resolution MUST be set at a 6x1 aspect ratio (e.g. 3600x600) for this to work well.
Since this is essentially four shots taken at 90° rotation increments, the foreshortening won’t line up properly at the seams as seen in the floor in the image above. It doesn’t matter so much in organic shapes like terrain, but it may get squirrely with buildings or other large geometric objects on the seams.
We also don’t have control over the max vertical field of view or rectilinear distortion/background compression. All six shots have a 90° horizontal and vertical field of view (18mm focal length, 1:1 aspect ratio). Four of these lined up give us 360° of horizontal view and 90° of vertical view.
Finally, Octane doesn’t have a +Z/-X/-Z/+X layout. We can get individual views, or +X/-X/+Y/-Y/+Z/-Z in a line. This makes it annoying to frame the scene up since we’re looking at the panels out of order.
Wrap Up
If you made it through this guide, you probably have a much better understanding of how to work with a fisheye/panoramic setup than you did before, and you’re aware of all the gotchas and idiosyncrasies involved.