Fisheye baking camera node

A forum where development builds are posted for testing by the community.
Forum rules
NOTE: The software in this forum is not %100 reliable, they are development builds and are meant for testing by experienced octane users. If you are a new octane user, we recommend to use the current stable release from the 'Commercial Product News & Releases' forum.
Post Reply
User avatar
jobigoud
OctaneRender Team
Posts: 250
Joined: Sat Aug 15, 2015 1:28 pm

Hello,

Attached to this post is a scripted node graph that acts as a dynamic fisheye camera. You can use it to position and orient a camera in the scene and get a fisheye image out of it. No scripting is required.
It uses a baking camera and thus works on one of the Octane 3.0 alpha, 3.0 alpha 4 at the time of this post.
Note that this is a side project that I worked on to become more familiar with the baking camera and scripted node graphs.

You can configure the field of view on the fly, including going higher than 180°, and select between a few mapping functions.
Here is a 270° fisheye of the well-known Sponza scene, using the stereographic mapping function.
sponza-270-512.jpg
How to use it
Drag and drop the orbx file on your scene graph to import the node. The node should sit between the main geometry and the render target. It has two outputs, a geometry and a camera, and takes as input the scene geometry, a transform to manipulate the camera and some parameters like the field of view and the fisheye function.
node.png
node.png (10.61 KiB) Viewed 3152 times
The "mesh" input is to connect your scene geometry.

The "camera transform" input is used to place and orient the camera in space. It's not possible to directly use the mouse on the viewport to manipulate the camera, you have to use the sliders/text boxes. If you are rendering small geometry you may want to scale down the camera to avoid it intersecting the scene.

The "field of view" input is used to control the field of view projected on the final image. It defaults to 180° and some artifacts may appear depending on the mapping function if you go in the very high ranges towards 360°.

The "fisheye function" input lets you select between 3 mappings ("Stereographic", "Equidistant" and "Equisolid") that alters the way the ray directions are converted to image coordinates. They really start to diverge above 180° and some are better suited to display very high field of views. The default is "Equidistant", which should actually give a similar result as using a thin lens camera at 1.0 distortion for a square image of the same field of view.

The "camera subdiv" input controls the tessellation level of the spherical camera surface. The default is 3. Higher values can be necessary if you render very large targets at high field of view. The trade-off is that changing the field of view on the fly becomes slower. You may stick with 3 until you find the perfect framing and switch to more for the final render.


How it works
If you are interested in the internals or want to modify the script, here is a short description of how it works.

Internally the scene geometry is combined with a pseudo-spherical mesh that acts as the camera surface. The mesh is created procedurally by subdividing an icosahedron. The UVs for the vertices are computed on the fly based on the provided field of view and mapping function.
The baking camera is configured on "baking position": all rays are shot from this unique position out towards the camera mesh surface. This position and the camera mesh are kept in sync through the user-exposed 3D transform.

Since it uses a complete sphere, we can go over 180°. The corners of the image are also naturally filled. As the UVs are generated in the script, the field of view and mapping function can be changed dynamically.

In some circumstances the edges of the polygons making up the sphere start to produce discontinuities in the output. This is where the subdivision level comes in. Here are wireframe views of the camera surface at the various subdivision levels.
camerasurface.png
That's it. Please do not hesitate to report issues or to comment on how to improve it! :D

Thanks,
Joan.
Attachments
fisheye-bench-scene.zip
Benchmark scene with fisheye node
(1.01 MiB) Downloaded 218 times
fisheye-node.orbx
Fisheye scripted node
(21.34 KiB) Downloaded 207 times
Last edited by jobigoud on Mon Feb 22, 2016 4:14 pm, edited 1 time in total.
pegot
Licensed Customer
Posts: 934
Joined: Mon Nov 07, 2011 3:44 am

Wow this looks fantastic can't wait to try it as soon as I re-assemble my computer. One quick question though. Can the output of this script be used to create full 360 spherical panos by using them as source images for a program like Pano2VR?
Win 10
3.7Ghz i9 10900k / 64GB
ASUS STRIX Z490-E
PSU: PowerSpec 850Wd
RTX 3090 Asus Tuff

Network rendering:
Win 10
4.2Ghz i7 7700k / 64GB
AsRock SuperCarrier
PSU: EVGA 1200w
RTX 3080 Ti EVGA Hybrid
RTX 3080 ASUS Tuff
GTX 1080ti SC Black (wc)
User avatar
mojave
OctaneRender Team
Posts: 1338
Joined: Sun Feb 08, 2015 10:35 pm

I'd say the panoramic camera would do just fine for that.
pegot
Licensed Customer
Posts: 934
Joined: Mon Nov 07, 2011 3:44 am

mojave wrote:I'd say the panoramic camera would do just fine for that.
Of course! And I have done that a few times already. How silly of me. I just got overly excited by something new to try and lost sight of practicality. :oops:
Win 10
3.7Ghz i9 10900k / 64GB
ASUS STRIX Z490-E
PSU: PowerSpec 850Wd
RTX 3090 Asus Tuff

Network rendering:
Win 10
4.2Ghz i7 7700k / 64GB
AsRock SuperCarrier
PSU: EVGA 1200w
RTX 3080 Ti EVGA Hybrid
RTX 3080 ASUS Tuff
GTX 1080ti SC Black (wc)
User avatar
mojave
OctaneRender Team
Posts: 1338
Joined: Sun Feb 08, 2015 10:35 pm

No worries :)

Just take into account this is just for educational purposes to illustrate how to combine several Octane features to achieve a new type of camera.

It also does not allow navigating the scene as with a thin lens or pano camera (unless your re-position the camera explicitly) and DOF and motion blur would not work with it.
anodin
Licensed Customer
Posts: 19
Joined: Wed Sep 30, 2015 3:51 am

Hey,
Interesting setup.
I don't know why my render viewport is black when i try your bench scene.

Question:
It is the same process than bake a mirror ball ?
If you use a mesh like my picture in attachement (sphere 210 degree with uv map equidistant)
this will work too ?
Dome210Duv_img.png
User avatar
jobigoud
OctaneRender Team
Posts: 250
Joined: Sat Aug 15, 2015 1:28 pm

Yes unfortunately the script will not work as is in the latest versions of 3.x, including the release. It's no longer possible for the rays to really "see through" the mesh. Lowering the mesh opacity or making it transparent will result in black. This is to support the primary use case of baking.
There is a solution, using reverse baking and doing point symmetry around the baking position. So that the rays start from the mesh, go towards the sphere center, and then expand towards the scene. The geometry is more complex to set up. I will try to work it out when time permits.
Post Reply

Return to “Development Build Releases”