I'm quite a novice and not a developer really. I'm naively attempting to piece together stuff from well...RSL (no experience in that at all, but it seems like the resources available for it were one way of getting into OSL and the concepts in general)
Larry, in the Advanced Renderman book, you give a toon outline example where you correct for low/high curvatures at certain viewing angles that the outlines go out of wack by dividing the angle by its derivative. Could that work in OSL?
I thought I'd just try:
float a = abs(dot(normalize(N), normalize(I)));
float da = filterwidth(a);
At least in RM I got...0 for da. My gut feeling was that I couldn't pass just any variable to filterwidth(). (That seemed too easy:)
Then I tried the partialDeriv() function from PxrBump2Roughness.h thinking that I could get the rate with respect to u and to v... but I was wrong.
It uses Dx() and Dy() and both return 0 for a. So, now i'm thinking I've no clue what i'm doing. Can anyone see where i'm going wrong with this?