Page 2 of 2

Re: wParallax products

Posted: Sun Jun 30, 2024 10:43 pm
by roeland
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 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);
…and replacing it with this.

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));
Example ORBX:
jiWindowBox example.orbx
(8.05 MiB) Downloaded 93 times
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. 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?

Re: wParallax products

Posted: Mon Jul 01, 2024 3:13 pm
by SSmolak
Roeland thank you for explanation. I did some changes to the code to make it works with additional layers and alpha for curtains to make them work with color correction node for individual curtain brightness control but I never knew how to change these axes.

I reviewed last C4D OSL versions and it works fine if MultiPlanarObj parameter is DISABLED. I don't know how OSL interface looks in 3D Max but please try to disable it. Anyway in C4D it works fine after that :

Re: wParallax products

Posted: Mon Jul 01, 2024 3:16 pm
by paride4331
Hi guys,
Pulled out from Roeland's ORBX.
Regards
Paride

Re: wParallax products

Posted: Tue Jul 02, 2024 8:28 am
by HHbomb
Hi roeland !
Can you please look at this file ?
It would be nice to see where the problem is.
Thanks a lot.

Re: wParallax products

Posted: Tue Jul 02, 2024 3:23 pm
by HHbomb
"Hi guys,
Pulled out from Roeland's ORBX.
Regards
Paride"


Hi paride.
I tried with the file you provide, it don't seem to work ( ? )

Re: wParallax products

Posted: Tue Jul 02, 2024 3:28 pm
by SSmolak
Try this C4D OSL. I don't know if it will works in 3ds max.

Re: wParallax products

Posted: Mon Jul 08, 2024 3:40 pm
by HHbomb
hi SSmolak !
Sorry not to be very responsible....
Thank you very much, your OSL for C4D seems to works fine with Max !!!
Best regards.