[gaffer-dev] 3DEqualizer Distort/Undistort In Gaffer?

82 views
Skip to first unread message

Sachin Shrestha

unread,
Mar 8, 2023, 1:20:14 AM3/8/23
to gaffer-dev
Hi,

Does anyone know if there is a way to replicate the Nuke Lens Distortion node from 3DEqualizer in gaffer? I am assuming it should be possible via OSL (since there is OSL Image node now) but have never tried it so any pointers would help! Or if there is an implementation already in some repository then please do point me to it.

Cheers,
Sachin

aurora

unread,
Mar 8, 2023, 2:31:10 AM3/8/23
to gaffer-dev
3DE provides a GLSL implementations of their distortion models, which is made specifically for Flame's Matchbox implementation of the the distortion nodes.
https://www.3dequalizer.com/?site=tech_docs&id=110216_01
Not really an easy task, but you can try translating the GL shaders to OSL. 
Just wondering if you have tried going the STMap way?

John Haddon

unread,
Mar 8, 2023, 3:31:46 AM3/8/23
to gaffe...@googlegroups.com
On Wed, Mar 8, 2023 at 6:20 AM Sachin Shrestha <sshr...@fractalpicture.studio> wrote:
Does anyone know if there is a way to replicate the Nuke Lens Distortion node from 3DEqualizer in gaffer? I am assuming it should be possible via OSL (since there is OSL Image node now) but have never tried it so any pointers would help!

The OSLImage node only supports per-pixel operations at the moment, with no ability to sample different parts of the image. But the VectorWarp node can do arbitrary distortions, and you can use OSLImage to generate a distortion map to use with it. Or maybe you can export a distortion map out of 3DE? So it's definitely possible, but the 3DE part is an exercise for the user :)
Cheers...
John


 

Sachin Shrestha

unread,
Mar 8, 2023, 4:46:36 AM3/8/23
to gaffer-dev
Hey guys,

Thank you for the ideas. Didn't realize there was a GLSL implementation as well! STMap might be a better way to do this though so I am going to see how far I can go with this.

Cheers,
Sachin

Reply all
Reply to author
Forward
0 new messages