--- ray/doc/ray.1 2023/11/15 18:28:09 1.41 +++ ray/doc/ray.1 2024/12/09 19:21:38 1.47 @@ -1,8 +1,8 @@ -.\" RCSid "$Id: ray.1,v 1.41 2023/11/15 18:28:09 greg Exp $" +.\" RCSid "$Id: ray.1,v 1.47 2024/12/09 19:21:38 greg Exp $" .\" Print using the -ms macro package -.DA 11/13/2023 +.DA 12/09/2024 .LP -.tl """Copyright \(co 2023 Regents, University of California +.tl """Copyright \(co 2024 Regents, University of California .sp 2 .TL The @@ -639,6 +639,64 @@ mod ashik2 id 8 dred dgrn dblu sred sgrn sblu u-power v-power .DE .LP +.UL WGMDfunc +.PP +WGMDfunc is a more programmable version of trans2, +with separate modifier paths and variables to control each component. +(WGMD stands for Ward-Geisler-Moroder-Duer, which is the basis for +this empirical model, similar to the previous ones beside Ashik2.)\0 +The specification of this material is given below. +.DS +mod WGMDfunc id +13+ rs_mod rs rs_urough rs_vrough + ts_mod ts ts_urough ts_vrough + td_mod + ux uy uz funcfile transform +0 +9+ rfdif gfdif bfdif + rbdif gbdif bbdif + rtdif gtdif btdif + A10 .. +.DE +The sum of specular reflectance ( +.I rs +), specular transmittance ( +.I ts +), diffuse reflectance ( +.I "rfdif gfdif bfdif" +for front and +.I "rbdif gbdif bbdif" +for back) +and diffuse transmittance ( +.I "rtdif gtdif btdif" +) should be less than 1 for each +channel. +.PP +Unique to this material, separate modifier channels are +provided for each component. +The main modifier is used on the diffuse reflectance, both +front and back. +The +.I rs_mod +modifier is used for specular reflectance. +If "void" is given for +.I rs_mod, +then the specular reflection color will be white. +The special "inherit" keyword may also be given, in which case +specular reflectance will share the main modifier. +This behavior is replicated for the specular transmittance modifier +.I ts_mod, +which has its own independent roughness expressions. +Finally, the diffuse transmittance modifier is given as +.I td_mod, +which may also be "void" or "inherit". +Note that any spectra or color for specular components must be +carried by the named modifier(s). +.PP +The main advantage to this material over BRTDfunc and +other programmable types described below is that the specular sampling is +well-defined, so that all components are fully computed. +.LP .UL Dielectric .PP A dielectric material is transparent, and it refracts light @@ -1207,14 +1265,12 @@ mod spectrum id 0 5+ nmA nmB s1 s2 .. sN .DE -The first two real arguments indicate the limits of the covered +The first two real arguments indicate the extrema of the spectral range in nanometers. -Subsequent real values correspond to multipliers in each wavelength band, -where the first band goes from nmA to nmA+(nmB-nmA)/N, and N is the -number of bands (i.e., the number of real arguments minus 2). -The nmA wavelength may be greater or less than the nmB wavelength, -but they may not be equal, and their ordering must correspond to -the ordering of the spectral values. +Subsequent real values correspond to multipliers at each wavelength. +The nmA wavelength may be greater or less than nmB, +but they may not be equal, and their ordering matches +the order of the spectral values. A minimum of 3 values must be given, which would act more or less the same as a constant RGB multiplier. As with RGB values, spectral quantities normally range between 0 @@ -1251,16 +1307,57 @@ The specfunc primitive offers dynamic control over a s pattern, similar to the colorfunc type. .DS mod specfunc id -2+ sval funcfile transform +2+ sfunc funcfile transform 0 2+ nmA nmB A3 .. .DE Like the spectrum primitive, the wavelength range is specified in the first two real arguments, and additional real values are -accessible to the sval function. +set in the evaluation context. This function is fed a wavelenth sample between nmA and nmB as its only argument, and it returns the corresponding spectral intensity. +.LP +.UL Specdata +.PP +Specdata is like brightdata and colordata, but with more +than 3 specular samples. +.DS +mod specdata id +3+n+ + func datafile + funcfile x1 x2 .. xn transform +0 +m A1 A2 .. Am +.DE +The data file must have one more dimension than the coordinate +variable count, as this final dimension corresponds to the covered +spectrum. +The starting and ending wavelengths are specified in "datafile" +as well as the number of spectral samples. +The function "func" will be called with two parameters, the +interpolated spectral value for the current coordinate and the +associated wavelength. +If the spectrum is broken into 12 components, then 12 calls +will be made to "func" for the relevant ray evaluation. +.LP +.UL Specpict +.PP +Specpict is a special case of specdata, where the pattern is +a hyperspectral image stored in the common-exponent file format. +The dimensions of the image data are determined by the picture +just as with the colorpict primitive. +.DS +mod specpict id +5+ + func specfile + funcfile u v transform +0 +m A1 A2 .. Am +.DE +The function "func" is called with the interpolated pixel value +and the wavelength sample in nanometers, the same as specdata, +with as many calls made as there are components in "specfile". .NH 3 Mixtures .PP