OSL Camera shader in Blender

A public forum for discussing and asking questions about the demo version of Octane Render.
Forum rules
For new users: this forum is moderated. Your first post will appear only after it has been reviewed by a moderator, so it will not show up immediately.
This is necessary to avoid this forum being flooded by spam.
Post Reply
heinzelnisse
Posts: 1
Joined: Mon Mar 31, 2025 8:51 am

Hey!

I've been playing around with the Octane OSL Camera shaders in blender and I have encountered some issues:

1.
To get the render uv's I'm using the 'getattribute("hit:uv", 2, uv)' function. However, this seems to not take into account the cameras uv's, only the current screen area.

So when I look through a camera and move around within the camera view the render stays the same. I would expect the rendered image to be locked in place relative to the camera border as when using a standard perspective camera.

Also, when I move out from camera view it still renders with the OSL camera shader. Is that expected behavior? Is there a way to revert it back to a standard perspective camera when not viewing through the camera?

2.
How can I execute the bpy.ops.octane.compile_osl_node() function within the right context in python?

This is the node path where I would like to press the "Compile OSL Node" button:
bpy.data.materials["OctaneCameraShader"].node_tree.nodes["OSL camera"]

So far I have tried to set the window context to be the material node editor, and the selected node to the "OSL camera" node, but it still gives me this error:
RuntimeError: Operator bpy.ops.octane.compile_osl_node.poll() failed, context is incorrect

How can I do this? Preferably I would like to do this "hidden" without having to edit or change the current window setup.

3.
Are textures supported in OSL Camera shaders? I tried to sample an image using the texture() function but the render just stays black. Also, the render turns black just by having a 'string imgtext = "Test.jpg",' as an input parameter. I don't get any errors so I'm not sure if its suppose to work or not.

Håvard
Post Reply

Return to “Demo Version Questions & Discussion”