New WGMDfunc material type

Dear All,

Just last week, I introduced a new programmable material type to Radiance 6.0a. Its design provides greater control over different components in the Ward-Geisler-Moroder-Dür model that underpins the existing plastic, metal, trans, plastic2, metal2, and trans2 material types.

The new material offers separate modifier paths for each component. This provides a convenient way to specify spectral colors using the new spectral pattern primitives, and allows different textures (surface normal perturbations) and/or patterns to apply to each.

Naturally, there are some caveats and things to watch out for, as with any material. You need to be careful that your components don’t scatter more light than they receive. More subtly, if your specular reflectance varies as a function of incident angle, this will undermine BSDF reciprocity. Reciprocity also implies that transmission should be the same from either side of the material.

------------------------ here is the new reference manual entry --------------------------

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.

Hi Greg,

this does indeed seem like a very flexible material type. Following up on my rollershade work this summer, it seems like the combination of functional transmittance specification plus parameterized roughness could be useful. One thing I noticed with an initial test, it seems that the NxP etc… variables are not available as they are with BRTDfunc. Should they be since this material also does not flip the surface normal? It is quite useful to have access to Idx,Idy,Idz and while I can add those to the cal file,I thought this might make sense more generally. Related, this from rayinit.cal:

For *func & *data materials, the following are also available:

NxP, NyP, NzP			- perturbed surface normal
RdotP				- perturbed ray dot product
CrP, CgP, CbP			- perturbed material color

is not strictly true as these variables are not available in, for example, mixfunc. Is it only BRTDfunc that provides these?

Another related question: As soon as a specular component has any roughness (be it in trans, trans2 or WGMDfunc) shadow rays are blocked (no patch of sun transmitted) even if ss=0 and the material otherwise appears clear. I understand that in the general case this gets intractable for backwards raytracing, but for very small roughness values that visibly scatter on the order of the sun’s solid angle, is there anyway I can manipulate settings to let the shadow ray pass unperturbed as an approximation, but still use specular sampling and a roughness for the view rays?

thanks!

-Stephen

Hi Stephen,

Good questions. I thought about setting the “perturbed” variables in WGMDfunc, but it’s a significant expense whether they are applied or not. In the other BRTDF types, this expense is incurred just once, but for WGMDfunc, it would have to be reset for every modifier chain, so it might cost four times as much. And it wouldn’t make much sense to include the CrP, CgP, and CbP settings, as a big advantage of the new material is better spectral support, and the variables only compute Y values. That said, I could easily supply an always-positive, perturbed dot product if that’s all you need. It wouldn’t be too different from abs(Rdot), though.

Out of curiousity, what do you want to use the perturbed values for?

Regarding source rays, as soon as there is a non-zero roughness, the transmitted ray goes from being a TRANS type that is included in the direct calculation to being a SPECULAR type that is thrown in with the indirect calc. Harsh, I know, but having an arbitrary cut-off didn’t make much more sense, and knowing how the scattering and source size interact is not always straightforward. If you don’t want to use a BRTDfunc, which has separate view and specular transmission, you can apply a mixfunc and combine your desired appearance material with a straight trans or glass material to provide shadow ray transmission. (Yes, it’s sad to have to lean back on mixfunc, but at least it’s an option.)

Cheers,
-Greg

P.S. I created a trial implementation that adds the NxP, NyP, NzP, and RdotP settings, and it was only about a 2% performance hit, so I guess there’s no real harm in it.

Hi Greg,

First, to your question: I don’t directly use the perturbed value, just the transformed incident vector (Idx, Idy, Idz) to calculate the effective openness when there is some phi dependence. This also serves to orient the material (with an orientation vector provided). I also use the Ldx(), Ldy(), Ldz() functions to transform the source direction into local coordinates for the directional-diffuse part. When I do this in a mixfunc, I just duplicate those lines from rayinit.cal and change the perturbed normal to the regular normal, but with a BRTDfunc i use those declarations from rayinit directly.

Regarding your suggestion to use a mixfunc to provide shadow ray transmission, how do I distinguish between shadow ray and view ray in the mixfunc?

thanks,

Stephen

PS sorry this is now quite off topic, but seems better to keep the post in context

I did go ahead and check in the change to support N{x,y,z}P and RdotP in WGMDfunc, but not C{r,g,b}P as those didn’t really make sense for this material.

Using the mixfunc with “void” as the shadow-ray-permitting part would make most sense for mesh shades, since you are trying to mimic openings. You will also be able to see through the material under some lighting conditions. The flag variables are not accessible to the .cal environment to permit one and block the other. I think the prism1 and prism2 types are the only exception, as they provide a source-direction vector that is zero for non-source rays. You might be able to mix with prism1 with a pass-through direction rather than “void” to get what you want.

Yes, we are way off topic, but that’s what makes things interesting.

-Greg