Re: wParallax products
Posted: Sun Jun 30, 2024 10:43 pm
As far as I can tell, this shader works the same in Octane versions 2022, 2023, and 2024.
Starting from https://github.com/julsVFX/osl/tree/main/jiWindowBox, take the
You can make it work with any orientation as long as it has UV coordinates by finding these lines:
…and replacing it with this.
Example ORBX:
The more technical explanation: this line of code defines how to interpret the viewing direction. The rest of the shader expects the viewing direction relative to the surface, in a coordinate space where the X and Y axes are tangent, and the Z axis is along the normal.
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?
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?