3.10 Discontinuities
There are several functions which “clamp” their inputs in various ways, i.e.
potentially lose some information in their inputs and introduce discontinuities.
These are documented in Tables 3.21, 3.22, and 3.23. The first set of functions
are sharp discontinuities, the second supports smoothed discontinuities, as
required in shaders for antialiasing. The smoothed version of a function typically
has smooth in front of the name and an extra parameter for setting the width of
the transition region.
|
|
| | Operation | r a,b,c,... | Description |
|
|
|
|
|
| | max | N N,N | Componentwise maximum
|
|
|
| | / max | 1 N | Tuple maximum
|
|
|
| | min | N N,N | Componentwise minimum
|
|
|
| | / min | 1 N | Tuple minimum
|
|
|
| | pos | N N | Componentwise maximum with 0 |
|
|
| | / sat | N N | Componentwise minimum with 1 |
|
|
| | |
| Table 3.22: | Minimum and maximum functions. |
|
|
|
| | Operation | r a,b,c,... | Description |
|
|
|
|
|
| | / smoothstep | N N,N,N | Linear smooth step of ai centered
around bi with width ci |
|
|
| | / smoothpulse | N N,N,N,N | Linear smooth pulse of ai between bi
and ci with width di |
|
|
| | |
| Table 3.23: | Smooth clamping functions. |
|
Note: This manual is available as a bound book from AK Peters, including better formatting, in-depth examples, and about 200 pages not available on-line.