--- ray/doc/ray.html 2004/10/21 16:16:14 1.4 +++ ray/doc/ray.html 2025/05/29 16:42:28 1.41 @@ -1,7 +1,8 @@ + -The RADIANCE 3.6 Synthetic Imaging System +The RADIANCE 6.0 Synthetic Imaging System @@ -9,7 +10,7 @@ The RADIANCE 3.6 Synthetic Imaging System

-The RADIANCE 3.6 Synthetic Imaging System +The RADIANCE 6.0 Synthetic Imaging System

@@ -82,7 +83,7 @@ The diagram in Figure 1 shows the flow between program (ovals). The central program is rpict, which produces a picture from a scene description. -Rview is a variation of rpict that computes and displays images +Rvu is a variation of rpict that computes and displays images interactively, and rtrace computes single ray values. Other programs (not shown) connect many of these elements together, such as the executive programs @@ -147,6 +148,8 @@ It is stored as ASCII text, with the following bas ... +

+ A comment line begins with a pound sign, `#'.

@@ -393,6 +396,7 @@ The basic types are given below. 0 +

If the modifier is "void", then surfaces will use the modifiers given in the original description. Otherwise, the modifier specified is used in their place. @@ -437,6 +441,8 @@ The basic types are given below. 0 +

+ If the modifier is "void", then surfaces will use the modifiers given in the original mesh description. Otherwise, the modifier specified is used in their place. @@ -531,6 +537,7 @@ A material defines the way light interacts with a sur 4 red green blue maxrad +

If maxrad is zero, then the surface will never be tested for shadow, although it may participate in an interreflection calculation. If maxrad is negative, then the surface will never contribute to scene illumination. Glow sources will never illuminate objects on the other side of an illum surface. @@ -564,7 +571,7 @@ A material defines the way light interacts with a sur

- Mirror is used for planar surfaces that produce secondary source reflections. + Mirror is used for planar surfaces that produce virtual source reflections. This material should be used sparingly, as it may cause the light source calculation to blow up if it is applied to many small surfaces. This material is only supported for flat surfaces such as polygons and rings. The arguments are simply the RGB reflectance values, which should be between 0 and 1. @@ -579,20 +586,40 @@ This is only appropriate if the surface hides other (m 3 red green blue +While alternate materials that are reflective will appear as normal, +indirect rays will use the mirror's reflectance rather than the +alternate type. +Transmitting materials are an exception, where both transmission and +reflection will use the alternate type for all rays not specifically +targeting virtual light sources. +Therefore, transmitting alternate types should only have pure specular +reflection if they reflect at all, to maintain a valid calculation. +

+The mirror material type reflects light sources only from the front side +of a surface, regardless of any alternate material. +If virtual source generation is desired on both sides, two coincident +surfaces with opposite normal orientations may be employed to achieve +this effect. +The reflectance and alternate material type may be +different for the overlapped surfaces, +and the two sides will behave accordingly. + +

+

Prism1
- The prism1 material is for general light redirection from prismatic glazings, generating secondary light sources. + The prism1 material is for general light redirection from prismatic glazings, generating virtual light sources. It can only be used to modify a planar surface (i.e., a polygon or disk) and should not result in either light concentration or scattering. The new direction of the ray can be on either side of the material, - and the definitions must have the correct bidirectional properties to work properly with secondary light sources. + and the definitions must have the correct bidirectional properties to work properly with virtual light sources. The arguments give the coefficient for the redirected light and its direction.
@@ -602,6 +629,8 @@ This is only appropriate if the surface hides other (m
         n A1 A2 .. An
 
+

+ The new direction variables dx, dy and dz need not produce a normalized vector. For convenience, the variables DxA, DyA and DzA are defined as the normalized direction to the target light source. See section 2.2.1 on function files for further information. @@ -645,6 +674,7 @@ This is only appropriate if the surface hides other (m 3 source1 mirror1>source10 mirror2>mirror1>source3 +

Normally, only one source is given per mist material, and there is an upper limit of 32 to the total number of active scattering sources. The extinction coefficient, if given, is added the the global @@ -659,12 +689,14 @@ a perfectly scattering medium (no absorption). The scattering eccentricity parameter will likewise override the global setting if it is present. Scattering eccentricity indicates how much scattered light favors the -forward direction, as fit by the Heyney-Greenstein function: +forward direction, as fit by the Henyey-Greenstein function:

 	P(theta) = (1 - g*g) / (1 + g*g - 2*g*cos(theta))^1.5
 
+

+ A perfectly isotropic scattering medium has a g parameter of 0, and a highly directional material has a g parameter close to 1. Fits to the g parameter may be found along with typical extinction @@ -679,6 +711,8 @@ cloud types in USGS meteorological tables. 0|3|6|7 [ rext gext bext [ ralb galb balb [ g ] ] ] +

+ There are two usual uses of the mist type. One is to surround a beam from a spotlight or laser so that it is visible during rendering. @@ -797,7 +831,8 @@ unless the line integrals consider enclosed geometry.

Trans2 is the anisotropic version of trans. - The string arguments are the same as for plastic2, and the real arguments are the same as for trans but with an additional roughness value. + The string arguments are the same as for plastic2, + and the real arguments are the same as for trans but with an additional roughness value.
         mod trans2 id
@@ -809,6 +844,87 @@ unless the line integrals consider enclosed geometry.
 

+ + Ashik2 + + +
+ Ashik2 is the anisotropic reflectance model by Ashikhmin & Shirley. + The string arguments are the same as for plastic2, but the real + arguments have additional flexibility to specify the specular color. + Also, rather than roughness, specular power is used, which has no + physical meaning other than larger numbers are equivalent to a smoother + surface. + Unlike other material types, total reflectance is the sum of + diffuse and specular colors, and should be adjusted accordingly. +
+	mod ashik2 id
+	4+ ux uy uz funcfile transform
+	0
+	8 dred dgrn dblu sred sgrn sblu u-power v-power
+
+ +

+ +

+ + WGMDfunc + + +
+ 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 previous ones beside Ashik2.) + The specification of this material is given below. +
+	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 ..
+
+ +

+ +The sum of specular reflectance (rs), specular transmittance (ts), +diffuse reflectance (rfdif gfdif bfdif for front and rbdif gbdif bbdif for back) +and diffuse transmittance (rtdif gtdif btdif) should be less than 1 for each +channel. + +

+ +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 rs_mod modifier is used for specular reflectance. +If "void" is given for 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 +ts_mod, which also has its own independent roughness expressions. +Finally, the diffuse transmittance modifier is given as +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). + +

+ +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. + +

+ +

Dielectric @@ -869,6 +985,8 @@ unless the line integrals consider enclosed geometry. tn = (sqrt(.8402528435+.0072522239*Tn*Tn)-.9166530661)/.0036261119/Tn
+

+ Standard 88% transmittance glass has a transmissivity of 0.96. (A pattern modifying glass will affect the transmissivity.) If a fourth real argument is given, it is interpreted as the index of refraction to use instead of 1.52. @@ -900,6 +1018,8 @@ unless the line integrals consider enclosed geometry. 4+ red green blue spec A5 .. +

+ The function refl takes four arguments, the x, y and z direction towards the incident light, and the solid angle subtended by the source. @@ -941,6 +1061,8 @@ unless the line integrals consider enclosed geometry. 6+ red green blue rspec trans tspec A7 .. +

+ Where trans is the total light transmitted and tspec is the non-Lambertian fraction of transmitted light. The function brtd should integrate to 1 over each projected hemisphere. @@ -968,6 +1090,8 @@ unless the line integrals consider enclosed geometry. A10 .. +

+ The variables rrefl, grefl and brefl specify the color coefficients for the ideal specular (mirror) reflection of the surface. The variables rtrns, gtrns and btrns specify the color coefficients for the ideal specular transmission. The functions rbrtd, gbrtd and bbrtd take the direction to the incident light (and its solid angle) and @@ -1012,6 +1136,8 @@ unless the line integrals consider enclosed geometry. 4+ red green blue spec A5 .. +

+ The coordinate indices (x1, x2, etc.) are themselves functions of the x, y and z direction to the incident light, plus the solid angle subtended by the light source (usually ignored). The data function (func) takes five variables, the @@ -1053,6 +1179,116 @@ unless the line integrals consider enclosed geometry.

+ + BSDF + + +
+ The BSDF material type loads an XML (eXtensible Markup Language) + file describing a bidirectional scattering distribution function. + Real arguments to this material may define additional + diffuse components that augment the BSDF data. + String arguments are used to define thickness for proxied + surfaces and the "up" orientation for the material. + +
+	mod BSDF id
+	6+ thick BSDFfile ux uy uz funcfile transform
+	0
+	0|3|6|9
+		rfdif gfdif bfdif
+		rbdif gbdif bbdif
+		rtdif gtdif btdif
+
+ +

+ The first string argument is a "thickness" parameter that may be used + to hide detail geometry being proxied by an aggregate BSDF material. + If a view or shadow ray hits a BSDF proxy with non-zero thickness, + it will pass directly through as if the surface were not there. + Similar to the illum type, this permits direct viewing and + shadow testing of complex geometry. + The BSDF is used when a scattered (indirect) ray hits the surface, + and any transmitted sample rays will be offset by the thickness amount + to avoid the hidden geometry and gather samples from the other side. + In this manner, BSDF surfaces can improve the results for indirect + scattering from complex systems without sacrificing appearance or + shadow accuracy. + If the BSDF has transmission and back-side reflection data, + a parallel BSDF surface may be + placed slightly less than the given thickness away from the front surface + to enclose the complex geometry on both sides. + The sign of the thickness is important, as it indicates + whether the proxied geometry is behind the BSDF + surface (when thickness is positive) or in front (when + thickness is negative). +

+ The second string argument is the name of the BSDF file, + which is found in the usual auxiliary locations. The + following three string parameters name variables for an + "up" vector, which together with the surface + normal, define the local coordinate system that orients the + BSDF. These variables, along with the thickness, are defined + in a function file given as the next string argument. An + optional transform is used to scale the thickness and + reorient the up vector. +

+ If no real arguments are given, the BSDF is used by itself + to determine reflection and transmission. If there are at + least 3 real arguments, the first triplet is an additional + diffuse reflectance for the front side. At least 6 real + arguments adds diffuse reflectance to the rear side of the + surface. If there are 9 real arguments, the final triplet + will be taken as an additional diffuse transmittance. All + diffuse components as well as the non-diffuse transmission + are modified by patterns applied to this material. The + non-diffuse reflection from either side are unaffected. + Textures perturb the effective surface normal in the usual + way. +

+ The surface normal of this type is not altered to face the + incoming ray, so the front and back BSDF reflections may + differ. (Transmission is identical front-to-back by physical + law.) If back visibility is turned off during rendering and + there is no transmission or back-side reflection, only then + the surface will be invisible from behind. Unlike other + data-driven material types, the BSDF type is fully supported + and all parts of the distribution are properly sampled. +

+ +

+ + aBSDF + + +
+ The aBSDF material is identical to the BSDF type with two + important differences. First, proxy geometry is not + supported, so there is no thickness parameter. Second, an + aBSDF is assumed to have some specular through component + (the ’a’ stands for "aperture"), + which is treated specially during the direct calculation + and when viewing the material. Based on the BSDF data, the + coefficient of specular transmission is determined and used + for modifying unscattered shadow and view rays. + +
+	mod aBSDF id
+	5+ BSDFfile ux uy uz funcfile transform
+	0
+	0|3|6|9
+	     rfdif gfdif bfdif
+	     rbdif gbdif bbdif
+	     rtdif gtdif btdif
+
+ +

+ If a material has no specular transmitted component, it is + much better to use the BSDF type with a zero thickness + than to use aBSDF. +

+ +

Antimatter @@ -1068,6 +1304,8 @@ unless the line integrals consider enclosed geometry. 0 +

+ The first modifier will also be used to shade the area leaving the antimatter volume and entering the regular volume. If mod1 is void, the antimatter volume is completely invisible. Antimatter does not work properly with the material type "trans", @@ -1122,6 +1360,8 @@ A texture is a perturbation of the surface normal, an n A1 A2 .. An +

+

@@ -1261,6 +1501,8 @@ A colorfunc is a procedurally defined color pattern [spacing] +

+ or:

@@ -1298,6 +1540,8 @@ or:
                 [spacing]
 
+

+ or:

@@ -1326,6 +1570,153 @@ or:
 	A section of text meant to  depict  a  picture, perhaps using a special purpose font such as hexbit4x1.fnt, calls for uniform  spacing.   
 	Reasonable  magnitudes  for  proportional  spacing are between 0.1 (for tightly spaced characters) and 0.3 (for wide spacing).
 
+

+ +

+ + Spectrum + + +
+ The spectrum primitive is the most basic type for introducing spectral + color to a material. + Since materials only provide RGB parameters, spectral patterns + are the only way to superimpose wavelength-dependent behavior. + +
+        mod spectrum id
+	0
+	0
+	5+ nmA nmB s1 s2 .. sN
+
+ +

+ The first two real arguments indicate the extrema of the + spectral range in nanometers. + 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 + and 1 at each wavelength, or average to 1.0 against a standard + sensitivity functions such as V(lambda). + The best results obtain when the spectral range and number + of samples match rendering options, though resampling will handle + any differences, zero-filling wavelenths outside the nmA to nmB + range. + A warning will be issued if the given wavelength range does not + adequately cover the visible spectrum. + +

+ +

+ + Specfile + + +
+ The specfile primitive is equivalent to the spectrum type, but + the wavelength range and values are contained in a 1-dimensional + data file. + This may be a more convenient way to specify a spectral color, + especially one corresponding to a standard illuminant such as D65 + or a library of measured spectra. + +
+        mod specfile id
+	1 datafile
+	0
+	0
+
+ +

+ As with the spectrum type, rendering wavelengths outside the defined + range will be zero-filled. + Unlike the spectrum type, the file may contain non-uniform samples. + +

+ +

+ + Specfunc + + +
+ The specfunc primitive offers dynamic control over a spectral + pattern, similar to the colorfunc type. + +
+        mod specfunc id
+	2+ sfunc funcfile transform
+	0
+	2+ nmA nmB A3 ..
+
+ +

+ Like the spectrum primitive, the wavelength range is specified + in the first two real arguments, and additional real values are + 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. + +

+ + Specdata + + +
+ Specdata is like brightdata and colordata, but with more + than 3 specular samples. + +
+	mod specdata id
+	3+n+
+		func datafile
+		funcfile x1 x2 .. xn transform
+	0
+	m A1 A2 .. Am
+
+ +

+ 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. + +

+ + Specpict + + +
+ 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. + +
+	mod specpict id
+	5+
+		func specfile
+		funcfile u v transform
+	0
+	m A1 A2 .. Am
+
+ +

+ 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". +

@@ -1336,6 +1727,7 @@ or: A mixture is a blend of one or more materials or textures and patterns. +Blended materials should not be light source types or virtual source types. The basic types are given below.

@@ -1357,6 +1749,8 @@ A mixfunc mixes two modifiers procedurally. It i n A1 A2 .. An

+

+ Foreground and background are modifier names that must be defined earlier in the scene description. If one of these is a material, then @@ -1365,8 +1759,6 @@ A mixfunc mixes two modifiers procedurally. It i which serves as a form of opacity control when used with a material.) Vname is the coefficient defined in funcfile that determines the influence of foreground. The background coefficient is always (1-vname). - Since the references are not resolved until run-time, the last definitions of the modifier id's will be used. - This can result in modifier loops, which are detected by the renderer.

@@ -1387,6 +1779,8 @@ A mixfunc mixes two modifiers procedurally. It i m A1 A2 .. Am +

+

Mixpict @@ -1410,7 +1804,6 @@ A mixfunc mixes two modifiers procedurally. It i arguments, the red, green and blue values corresponding to the pixel at (u,v). -

@@ -1432,6 +1825,8 @@ A mixfunc mixes two modifiers procedurally. It i [spacing] +

+ or:

@@ -1447,6 +1842,8 @@ or:
                 [spacing]
 
+

+

@@ -1491,6 +1888,8 @@ An example function file is given below: cfunc(x) : 10*x / sqrt(x) ; +

+ Many variables and functions are already defined by the program, and they are listed in the file rayinit.cal. The following variables are particularly important: @@ -1505,12 +1904,16 @@ The following variables are particularly important: arg(i) - i'th real argument +

+ For mesh objects, the local surface coordinates are available:

         	Lu, Lv                  - local (u,v) coordinates
 
+

+ For BRDF types, the following variables are defined as well:

@@ -1519,6 +1922,8 @@ For BRDF types, the following variables are defined as
                 CrP, CgP, CbP           - perturbed material color
 
+

+ A unique context is set up for each file so that the same variable may appear in different function files without conflict. @@ -1528,10 +1933,8 @@ If no file is needed by a given primitive because all the required variables are global, a period (`.') can be given in place of the file name. It is also possible to give an expression instead -of a straight variable name in a scene file, -although such expressions should be kept -simple if possible. -Also, functions (requiring parameters) must be given +of a straight variable name in a scene file. +Functions (requiring parameters) must be given as names and not as expressions.

@@ -1575,6 +1978,8 @@ The basic data file format is as follows: DATA, later dimensions changing faster. +

+ N is the number of dimensions. For each dimension, the beginning and ending coordinate values and the dimension size is given. Alternatively, individual coordinate values can be given when the points are not evenly spaced. @@ -1603,6 +2008,8 @@ All numbers are decimal integers: ... +

+ The ASCII codes can appear in any order. N is the number of vertices, and the last is automatically connected to the first. Separate polygonal sections are joined by coincident sides. The character coordinate system is a square with lower left corner at (0,0), lower right at (255,0) and upper right at (255,255). @@ -1678,7 +2085,7 @@ The details of this process are not important, but directs the use of a scene description.