When running the following OSL, I would expect dPdu and dPdv to be valid?
--snip--
vector worldTangent = normalize(dPdu);
vector worldBitangent = normalize(dPdv);
vector worldNormal = normalize(N);
//
printf("worldTangent: %f\n", worldTangent);
printf("worldBitangent: %f\n", worldBitangent);
printf("worldNormal: %f\n", worldNormal);
--snip--
I'm only getting 0,0,0 while N is correctly being passed
--snip--
worldTangent: 0.000000 0.000000 0.000000
worldBitangent: 0.000000 0.000000 0.000000
worldNormal: -0.027439 -0.272305 0.961820
worldTangent: 0.000000 0.000000 0.000000
worldBitangent: 0.000000 0.000000 0.000000
worldNormal: 0.929598 -0.367538 0.027624
worldTangent: 0.000000 0.000000 0.000000
worldBitangent: 0.000000 0.000000 0.000000
worldNormal: -0.084531 0.070302 0.993938
--snip--
This makes it impossible to do any anisotropy type effects.
It would be good to check Dx(), Dy(), Dz() to see if these are working as expected.
--snip--
vector worldTangent = normalize(dPdu);
vector worldBitangent = normalize(dPdv);
vector worldNormal = normalize(N);
//
printf("worldTangent: %f\n", worldTangent);
printf("worldBitangent: %f\n", worldBitangent);
printf("worldNormal: %f\n", worldNormal);
--snip--
I'm only getting 0,0,0 while N is correctly being passed
--snip--
worldTangent: 0.000000 0.000000 0.000000
worldBitangent: 0.000000 0.000000 0.000000
worldNormal: -0.027439 -0.272305 0.961820
worldTangent: 0.000000 0.000000 0.000000
worldBitangent: 0.000000 0.000000 0.000000
worldNormal: 0.929598 -0.367538 0.027624
worldTangent: 0.000000 0.000000 0.000000
worldBitangent: 0.000000 0.000000 0.000000
worldNormal: -0.084531 0.070302 0.993938
--snip--
This makes it impossible to do any anisotropy type effects.
It would be good to check Dx(), Dy(), Dz() to see if these are working as expected.
Comment