photonmap VEX function
The photonmap function will evaluate a photon map and return the resulting color information.
Contexts: image3d, chop, cop, pop, sop, surface, displace, fog, light, shadow, photon, cvex
-
vector photonmap(string mapname, vector P, vector N)
The photonmap function will evaluate a photon map and return the resulting color information.
You can specify additional keyword,value argument pairs to set the behavior of the evaluation. These arguments must be defined at load time (literals or parameters).
To specify one of the additional arguments, pass the keyword as a string, with the next argument being the value for the keyword. For example ..., "wrap", "clamp", "border", {.1,1,1}).
| Keyword | Value | ||||||
|---|---|---|---|---|---|---|---|
|
|
Specifies the number of photons to use in the filtering process. This specifies the maximum number of photons which will be filtered to produce the final color. The default is 50 photons. | ||||||
|
|
This parameter specifies how the photons should be interpreted. There are two possibilities for the type of photon filtering:
| ||||||
|
|
Specifies the “accuracy” for the lookup of photons in the photon map. This parameter determines the search radius to find photons in the map. Larger numbers will result in less accurate evaluations (i.e. smaller areas of the map will be scanned), while smaller number will result in larger areas of the map being scanned. The cost of filtering goes up as the error tolerance is decreased (meaning renders will take longer). The default 0.001. | ||||||
|
|
Specifies the “filter” for computing the irradiance from photons. When evaluating photon contributions, the incoming radiance is divided by the area that the photons cover (to determine the flux). The area can be computed in three different fashions:
|
Example:
Cf = photonmap(map, P, normalize(frontface(N, I)), "nphotons", 100, "type", "diffuse", "error", 0.05, "filter", "convex);