Fisheye OSL lens

Forums: Fisheye OSL lens
Newtek Lightwave 3D (exporter developed by holocube, Integrated Plugin developed by juanjgon)

Moderator: juanjgon

Fisheye OSL lens

Postby baltort » Mon Aug 13, 2018 12:02 pm

baltort Mon Aug 13, 2018 12:02 pm
Hi all,

For anyone that likes funky lenses, here's a quick implementation of a fisheye lens I've written in OSL.

It defaults to a FOV of 180 degrees, an aperture of 1 unit and a focal distance of 5 units. These can be overwritten in the node editor by connecting scalar nodes to those inputs...

Enjoy!

James.

fisheye dof 1.jpg
Attachments
fisheyeCamDOF.zip
(638 Bytes) Downloaded 692 times
baltort
Licensed Customer
Licensed Customer
 
Posts: 72
Joined: Mon Jul 07, 2014 4:00 pm

Re: Fisheye OSL lens

Postby Kalua » Fri Aug 17, 2018 3:37 am

Kalua Fri Aug 17, 2018 3:37 am
Thank you
This OSL works great in C4D!
Thanks for sharing.
Cheers!
C4D 25.117 Octane 2022.1.2 R4, <<2 X 3090 + NVlink>>, Windows 10, X399, AMD TR 1950X, 128 GB RAM, NVIDIA SD 536.67
https://www.behance.net/PaperArchitect
Kalua
Licensed Customer
Licensed Customer
 
Posts: 481
Joined: Fri Oct 11, 2013 2:13 am
Location: Caribbean Sea

Re: Fisheye OSL lens

Postby LightwaveGuru » Fri Aug 17, 2018 7:16 pm

LightwaveGuru Fri Aug 17, 2018 7:16 pm
baltort wrote:Hi all,

For anyone that likes funky lenses, here's a quick implementation of a fisheye lens I've written in OSL.

It defaults to a FOV of 180 degrees, an aperture of 1 unit and a focal distance of 5 units. These can be overwritten in the node editor by connecting scalar nodes to those inputs...

Enjoy!

James.

fisheye dof 1.jpg



:)

Thansk James! Thats great!

snip lwguru
http://www.neotek.laboratories.de or http://www.youtube.com/c/Lightwaveguru or http://www.facebook.com/safarifx 4x Titan X 12 GB watercooled / 6x 2080 ti air cooled / 2x 980 ti watercooled
User avatar
LightwaveGuru
Licensed Customer
Licensed Customer
 
Posts: 487
Joined: Wed Jun 25, 2014 9:34 am
Location: Germany

Re: Fisheye OSL lens

Postby noisyboyuk » Wed Aug 22, 2018 10:54 am

noisyboyuk Wed Aug 22, 2018 10:54 am
Hey man!

This is awesome! Do you know if there is an anamorphic lens OSL script anywhere or whether this could be adapted as such?

Cheers :)
noisyboyuk
Licensed Customer
Licensed Customer
 
Posts: 103
Joined: Thu Apr 21, 2016 5:28 am

Re: Fisheye OSL lens

Postby pixym » Thu Aug 23, 2018 5:32 am

pixym Thu Aug 23, 2018 5:32 am
Thanks for that :)
Work Station : MB ASUS X299-Pro/SE - Intel i9 7980XE (2,6ghz 18 cores / 36 threads) - 32GB - 2 GTX 1080 TI - Win 10 64
NET RENDER : MB Biostar TB250-BTC Pro - Celeron 2C/2T - Open "Mining" Rig - 2 RTX 2080 TI - Win 7
pixym
Licensed Customer
Licensed Customer
 
Posts: 592
Joined: Thu Jan 21, 2010 4:27 pm
Location: French West Indies

Re: Fisheye OSL lens

Postby 3dworks » Sat Aug 25, 2018 8:51 am

3dworks Sat Aug 25, 2018 8:51 am
baltort wrote:Hi all,

For anyone that likes funky lenses, here's a quick implementation of a fisheye lens I've written in OSL.

It defaults to a FOV of 180 degrees, an aperture of 1 unit and a focal distance of 5 units. These can be overwritten in the node editor by connecting scalar nodes to those inputs...

Enjoy!

James.

fisheye dof 1.jpg



thank you!!
Specs: Apple MacBook Pro M1 max 64GB 2TB, MacOS 12.5 / MacPro 5,1 with NVIDIA GeForce GTX 1080 8G, MacOS 10.13.6 / Mac Pro 5,1 with AMD RX5700 8G, MacOS 12.3.1 / HP Z600 with NVIDIA 3060 RTX 12G, Windows 10 pro + Netstor GPU box, 4 x NVIDIA GTX 980ti 6G.
User avatar
3dworks
Licensed Customer
Licensed Customer
 
Posts: 294
Joined: Fri May 21, 2010 5:08 pm
Location: Berlin

Re: Fisheye OSL lens

Postby baltort » Tue Aug 28, 2018 10:02 am

baltort Tue Aug 28, 2018 10:02 am
noisyboyuk wrote:Hey man!

This is awesome! Do you know if there is an anamorphic lens OSL script anywhere or whether this could be adapted as such?

Cheers :)


Anamorphic lenses... Interesting. I think you could create this effect in native lightwave just by changing the aspect parameter on the camera, but this appears to be ignored by Octane.

What's the appeal of anamorphic lenses? I think the main visual effect is that a wide image is squeezed onto a narrower negative. When this is then stretched back out during projection any optical effects that happen within the lens are stretched too; bokeh and lens flairs become stretched horizontally. I think this is conceptually the same as having an elliptical aperture in the camera. Is that what you're trying to create? Fairly straight forward in OSL.

Cheers,

James.
baltort
Licensed Customer
Licensed Customer
 
Posts: 72
Joined: Mon Jul 07, 2014 4:00 pm

Re: Fisheye OSL lens

Postby addol95 » Mon Sep 10, 2018 1:20 pm

addol95 Mon Sep 10, 2018 1:20 pm
Hi!

I'm currently doing RnD for a project, and I stumbled upon this great OSL camera.

However, we'd need full-frame coverage. Is there a way to modify this so that we can crop the image directly in the script and avoid the black parts?
(we don't want to render double resolution and then crop out the area to display)

thanks in advance
addol95
Licensed Customer
Licensed Customer
 
Posts: 11
Joined: Mon Nov 23, 2015 9:46 pm

Re: Fisheye OSL lens

Postby baltort » Tue Sep 11, 2018 10:31 am

baltort Tue Sep 11, 2018 10:31 am
Hi,

That's straight forward enough... Here's an updated camera with a pin for cropping. It defaults to not cropped, but you can make it crop by attaching an integer of value 1 to this input.

I've set it up so that we reach full field of view at the mid points of the edge of frame. This means the bits that are now no longer cropped are wider than the FOV of the camera. In short, it's quite likely that the corners of the image will show points behind the camera...

I've also tidied up the DOF calculations, so it's worth switching to v2 of the camera even if people don't want the crop/uncrop functionality.

Let me know how you get on.

Cheers,

James.
Attachments
fisheyeCamDOF v2.zip
(734 Bytes) Downloaded 352 times
baltort
Licensed Customer
Licensed Customer
 
Posts: 72
Joined: Mon Jul 07, 2014 4:00 pm

Re: Fisheye OSL lens

Postby frankmci » Tue Sep 11, 2018 1:27 pm

frankmci Tue Sep 11, 2018 1:27 pm
Nice addition, James. Thanks!

To maybe save somebody a bit of messing around, I've found that a FOV of 127.5 degrees with a standard 16:9 aspect ratio will give you the max fishiness without rendering anything that would actually be behind the camera. I think that's what you'd actually see if you cropped a real world 180 fisheye image. It's simple enough to test this for whatever aspect ratio you need by placing an appropriately obvious textured test plane right behind the camera and perpendicular to the line of sight.

Also, I can confirm this OSL still works fine in C4D.
- Frank
Technical Director - C4D, Maya, AE, - Washington DC
frankmci
Licensed Customer
Licensed Customer
 
Posts: 820
Joined: Fri May 26, 2017 2:00 pm
Next

Return to Lightwave 3D


Who is online

Users browsing this forum: No registered users and 8 guests

Tue Apr 16, 2024 4:32 am [ UTC ]