OSL camera compile

Houdini Integrated Plugin

Moderator: juanjgon

Post Reply
michaelskripin
Licensed Customer
Posts: 23
Joined: Mon Jul 20, 2020 4:58 pm

Hey everyone!

I’m experimenting with connecting different OSL scripts to the OSL camera from the Vectron Tools, but the ‘Compile and Build GUI’ button doesn’t seem to work. I also tried copying the code directly into the ‘OSL Code’ input, but no luck there either.

The scripts themselves work fine in the camera, but I can’t control them at all.

Has anyone else run into this? Any tips on getting the GUI to show up?

Appreciate any help!
MacOS 15.4.1, M1 Max, Houdini 20.5, Octane 2025.1
ricky_otoy
OctaneRender Team
Posts: 289
Joined: Mon Jun 19, 2023 6:34 am

Hi there!

OSL Camera seems to be working ok here, see if this works for you:

Code: Select all

shader OslCamera(
    float Distortion = 0.0
    [[
        string help = "Lens distortion",
        float min = -1.0,
        float max = 1.0
    ]],
    
    float Scale = 1.0
    [[
        string help = "View scale",
        float min = 0.1,
        float max = 2.0
    ]],
    
    output point pos = 0,
    output vector dir = 0,
    output float tMax = 1.0/0.0)
{
    pos = P;
    vector right = cross(I, N);
    
    // Apply scale and distortion to UV coordinates
    float uu = (u - 0.5);
    float vv = (v - 0.5);
    
    // Optional radial distortion
    if (Distortion != 0.0) {
        float r2 = uu * uu + vv * vv;
        float f = 1.0 + Distortion * r2;
        uu *= f;
        vv *= f;
    }
    
    // Apply scale
    uu *= Scale;
    vv *= Scale;
    
    dir = I + right * uu + N * vv;
}
michaelskripin
Licensed Customer
Posts: 23
Joined: Mon Jul 20, 2020 4:58 pm

Just test it. Unfortunately, it doesn't work. I pasted the code and clicked the 'compile and build GUI' button, but nothing happened.

I tried reloading Houdini, but that didn't help.

MacOS Sequoia 15.1.1, Octane 2024.1.2.0, Houdini 20.5.445
MacOS 15.4.1, M1 Max, Houdini 20.5, Octane 2025.1
marcikola
Licensed Customer
Posts: 17
Joined: Sun Aug 18, 2024 10:01 pm

also not working for me
ricky_otoy
OctaneRender Team
Posts: 289
Joined: Mon Jun 19, 2023 6:34 am

Ok thanks will look into it further. It had worked my side but will see what the issue may be.

What builds are you using too @marcikola?
scaprendering
Posts: 9
Joined: Fri Dec 21, 2018 2:03 pm

Here it worked, just be sure that octane live viewer is not paused or it won't compile !
Feel free to reach out directly if you have issues with V tools :)
Post Reply

Return to “Houdini”