Search - User list
Full Version: Houdini 18 Karma Custom Fisheye Lens Shader Revisited
Root » Technical Discussion » Houdini 18 Karma Custom Fisheye Lens Shader Revisited
jlapre
I posted about this to the Houdini 18.0 Beta forum, but that forum has been archived. So I am re-posting here, to make sure it doesn't fall off the radar.

A number of years ago one of our technical directors, Matt Blackwell, developed a CVEX custom lens shader to create fisheye mantra renders for our full-dome productions.
Attached is an example of what a fisheye mantra render looks like, and a hip file with the custom lens shader HDA embedded.
I realize that SideFX has been super-busy pushing out Houdini 18, supporting documentation, and examples.

I just wanted to make sure, and hope, that /stage context LOPS Karma custom lens effects are still on their todo list.
Especially if Mantra will be retired, as the ability to render to a fisheye image is extremely important to us.

Others on the thread agreed that fisheye support would be of interest to the 360 video/VR community as well.

Sincerely,
Jeroen Lapré
Senior Technical Director | Visualization Studio | California Academy of Sciences

p.s. here is the CVEX code:

#pragma opname          fishLens
#pragma oplabel         "Fisheye Lens"

#pragma hint    x       hidden
#pragma hint    y       hidden
#pragma hint    P       hidden
#pragma hint    I       hidden
#pragma hint   valid   hidden

#include "math.h"

cvex
fishLens( /*equiangular fisheye lens shader with adjustable FOV and circular image format*/
        // Inputs
        float x = 0;
        float y = 0;

        // Outputs
        export vector P = 0;
        export vector I = 0;
        export int valid = 0;

        // Shader arguments
        float fov = 180.0;
        )
{
        float radius = sqrt(x*x+y*y); /*calculate distance from center of image plane*/
        /*following if statement means I is only computed inside r<=1, so that areas of image outside circular format aren't rendered*/
        if (radius <= 1){  /*using 1.0 produces blurriness(bug?), but 1.01 works fine*/
            float phi = atan2(y,x);
            float theta = radians(fov/2.0 * radius);
            I = set(sin(theta)*cos(phi),sin(theta)*sin(phi),cos(theta));
            valid = 1;

        }
}
jpparkeramnh
Jeroen,

I just missed entering the beta and we would have expected the same capability at AMNH. Probably like you, we use mantra because of its extreme flexibility that other renderers (I'm looking at you Pixar!) have eschewed over recent years, but are a necessity to do special format rendering of non-standard topics, for example rendering super computer simulations that are structured unlike typical VFX assets… ie, spherical volumes, massive particle counts, etc.

Having not been able to explore Karma and LOPs yet I'm hoping we can push our tools forward to take advantage of it,as long as the flexibility in rendering is still there.

Cheers,
Jon
jlapre
Hi Jon,
thanks for adding your voice to this request from another highly respected planetarium on the other side of the continent.
I hope you get to explore Karma and LOPs soon.
jlapre
Just checking in on this thread:
Any updates on custom lens shader support in Houdini 18 Karma / LOPS?

Thanks
mark
We're still looking into this. Hope to have something in the next few months.
jlapre
Great! Thanks for the update.
BradThompson
I just want to add my voice to this thread. Custom shaders are critical for the fulldome/planetarium work I do as well. I see Houdini 18.5 is nearing release. I wonder if there are any updates on this front.

Thanks!

Brad T.
mark
At 5:44 in the Houdini 18.5 Sneak Peak video they show a new physical lens shader for Karma.
maxecrow
Hi Jeroen,
By any chance have you had a look at another CVEX domelens shader for Karma in 18.5? I don't seem to able to copy it from SHOP to LOPS. I can get your shader to work the viewport (which in its self is amazing- almost realtime fisheye!) but errors when I render through Karma or MPlayer.
Regards,
Max
jlapre
Hi maxecrow,

I haven't had a chance to take a look at the new Houdini 18.5 physical lens shader to see if it can be used as a dome lens.
It's great that you were able to get Matt Blackell's fisheye lens shader to work in the viewport!
Any chance you could share the hip file with us to study?
Many thanks,
Jeroen
maxecrow
Hi Jeroen,
I didn't do anything special, I just I created an asset and pasted your code into it. I'm not sure how Matt exposed the fov or set it svalue to 180. It kind of works but I get this error...

<b style='color: red;'>Error loading lens shader: Unable to load shader 'opdef:/Vop/domelens?CVexVflCode'</b>
<b style='color: red;'>Error loading lens shader: must have P and I as outputs.</b>

Maybe this is something up Mr. Paul Ambrosiussen's street?
lens-shaders-for-gamedev... [cgsociety.org]
maxecrow
Karma render properties work fine too. just not Karma Render ROP
mark
USD doesn't currently have a facility to pass generic light or camera shaders. So, for an external process to reference the shaders, the shader needs to be stored on disk. Houdini can magically resolve shaders that are defined in the .hip file, but if you're rendering using the ROP, it sends the USD to the karmastand-alone.

If you have the lens shader as code, you can compile the shader into an HDA using vcc and then hopefully, it should work.
jsmack
mark
USD doesn't currently have a facility to pass generic light or camera shaders. So, for an external process to reference the shaders, the shader needs to be stored on disk. Houdini can magically resolve shaders that are defined in the .hip file, but if you're rendering using the ROP, it sends the USD to the karmastand-alone.

If you have the lens shader as code, you can compile the shader into an HDA using vcc and then hopefully, it should work.

Is that something that the rop can handle in the future? I.e. translating a houdini shader node to an hda or other disk resource and injecting that resource path into the usd as it's passed to karma standalone? Is this too karma-specific to belong in the usdrender rop?
jlapre
maxecrow
Hi Jeroen,
I didn't do anything special, I just I created an asset and pasted your code into it. I'm not sure how Matt exposed the fov or set it svalue to 180. It kind of works but I get this error...

<b style='color: red;'>Error loading lens shader: Unable to load shader 'opdef:/Vop/domelens?CVexVflCode'</b>
<b style='color: red;'>Error loading lens shader: must have P and I as outputs.</b>

Maybe this is something up Mr. Paul Ambrosiussen's street?
lens-shaders-for-gamedev... [cgsociety.org]

Hi maxecrow,
thanks for sharing your hip file. However, I get this error when I try to load it:
Warning: "/stage/materiallibrary1/domelens1" using incomplete asset definition (full definition not found).
The following node types are using incomplete asset definitions:
Vop/domelens

Could you share a hip file or an HDA with your Vop/domelens definition?
Thanks
Jeroen
mark
jsmack
Is that something that the rop can handle in the future? I.e. translating a houdini shader node to an hda or other disk resource and injecting that resource path into the usd as it's passed to karma standalone? Is this too karma-specific to belong in the usdrender rop?

I think this is unlikely. While it might make things somewhat easier if we could have COP images, SOP geometry and other assets either in the USD or as side-car files, it's not in our immediate (or even near future plans).
maxecrow
Hi Jeroen,
Here you go but it looks like some further compile shennigans is required.
jlapre
maxecrow
Hi Jeroen,
Here you go but it looks like some further compile shennigans is required.
Hi maxecrow.
Thanks.
The fisheye in the viewport is working for me now!
Fantastic!
As you mentioned, we need some help compiling it to work with Karma.

Thanks again.
Jeroen
jlapre
Dear fellow Houdini artists,

I'm just checking in on this thread to see if the Physical Lens Shader, introduced in Houdini 18.5, could be modified to support fisheye rendering in Karma?

https://www.sidefx.com/products/whats-new/18_5_lookdev/ [www.sidefx.com]

Thanks
BradThompson
I see there are instructions for creating lens shaders for Karma in the H19 docs now: https://www.sidefx.com/docs/houdini/solaris/karma_lens_shader.html [www.sidefx.com]

Even following those instructions, compiling the cvex code with vcc, I get the same errors Max mentioned above, when rendering to mplay or with the karma rop:

<b style='color: red;'>Error loading lens shader: Unable to load shader 'opdef:/Vop/domelens?CVexVflCode'</b>
<b style='color: red;'>Error loading lens shader: must have P and I as outputs.</b>

It works in the viewport though. Has anyone gotten dome or VR rendering working with H19 Karma yet?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB