PxrCurvature
This is a simple and useful pattern for creating edge effects and curvature based results like wear on edges and objects in contact with other surfaces.
Parameters
Num Samples
Controls the number of samples used to calculate curvature. More samples can reduce the noise at the cost of increased render time.
Max Distance
Samples travel a certain distance before being terminated. Lower values tend to generate sharper changes while larger ones spread out the effect and may lose details. Other objects may occlude as your distance becomes higher. Interiors are the most obvious way to see this effect. 0.0 means "infinite", or essentially your scene extent.
Trace Set
You may use Trace Sets to include other objects from the rays being traced. Helpful when you need a large Max Distance but don't want other objects occluding the result. Note this is not an exclusion, it's inclusion of the specified set.
Sample Distribution
Possible values are, in order, uniform and cosine (Lambertian).
| Description |
---|---|
Uniform | Rays are not weighted in any particular direction. |
Cosine | Rays are weighted in the normal direction based on Cosine Spread parameter below. |
Cosine Spread
Sample spread of rays when using cosine distribution. A value of 1.0 gives a perfect Lambertian distribution. Lower values shrink or "tighten" the effect along curves while larger amounts spread out the effect.
Bias
The bias will affect the falloff of the curvature and will be linear, decreasing with the distance from the shaded point. Bias can be used to take further samples into account more or less while nearby points have more weight.
The closer to 0.0, only points closest to the shading point will contribute.
With the default of 0.5 any points close to Max Distance will contribute less, and points close to the shaded point will contribute more.
The closer to 1.0, the more all sampled points will contribute. At exactly 1.0 sampled points at all distances will contribute equally.
Convex Threshold
Increasing this parameter erodes the result, shrinking the visible effect.
Concave Threshold
Increasing this parameter erodes the result, shrinking the visible effect.
Output
Output Gain
A multiplier for the resulting curvature effect (areas without curvature are naturally unaffected)
Output Type
Set to "Concave", only concave curvature will be output. Set to "Convex", only convex curvature will be output. "Both" will show both convex and concave curvature.
Monochrome Output
The result is a simple white or greyscale value for both concave and convex results. Off outputs Convex as Red and Concave as Green
Clamp Output
Values are clamped to 0-1 ranges by default. If you require an expanded range (perhaps with the gain control or to drive another parameter connection) you can disable this.