Starting from https://github.com/julsVFX/osl/tree/main/jiWindowBox, take the
jiWindowBox_LWOctane.osl
version. This version works in Octane but it requires planes to be oriented along the XY plane in object space.You can make it work with any orientation as long as it has UV coordinates by finding these lines:
Code: Select all
//global variables & remapping
vector objI = transform("object", -I);
Code: Select all
//global variables & remapping
// convert world space to tangent space
vector objI = -vector(
dot(normalize(dPdu), I),
dot(normalize(dPdv), I),
dot(normalize(N), I));
I
is originally in world coordinates. The original gives you I
in object coordinate space, that is why that version only works with planes that are oriented in the XY plane. The replacement gives I
in so-called tangent space, this space is defined as having the X and Y axes on the surface, and the Z axis along the normal. So it works for any orientation as long as there are suitable UV coordinates.None of this should have changed in any recent versions of Octane, if there is a regression can you attach an ORBX file with an example?