Mario MarengoActually, I believe that there's a compile time switch to turn off smoothing in shader . This means you have to recompile your shader to change the smoothing behaviour.
Derivative “smoothing” will cause the magnitude of the differentials to be adjusted non-uniformly over patches
Since dPds is the differential and Du(s) is its magnitude, then with “smoothing” off, Mantra gives you a single value for Du(s) across each patch. AFAIK, there's no equivalent to this switch in PRMan.
Mario Marengo
The one thing that I can't seem to get anywhere with is the “extrapolate” option… no matter what I throw at it, I can't see any effect – Can anyone describe a situation where this option would make a visible difference?
The most obvious way to see what the extrapolate option does is to write a quick little shader to compute normals with an option to turn extrapolate on/off. Use the SHOP viewer to run your shader on a sphere or torus and watch the patch boundaries appear and disappear.
surface
foo(int extrapolate=1)
{
vector nn;
nn = computenormal(P, “extrapolate”, extrapolate);
Cf = normalize(nn) * .5 + .5;
}
It's most noticable if you view the geometry with a low level of detail.
Extrapolation will estimate derivatives at the patch boundaries slightly differently. It estimates (by extrapolation) what the values on the other side of the patch are. This should give smooth values across smooth surfaces. However, it should be noted that with high frequency displacement shading, that extrapolation may attenuate discontinuities. Since the surface isn't smooth, the “guess” at what the adjacent patch value is might actually be more inaccurate than a non-extrapolated value. When this happens, the patch boundary will become more noticable. Still, it might just as “right” as a non-extrapolated value, so it's probably safe to have it turned on all the time.
Hope this helps.
Mark.