[Radiance-general] transfunc with measured data (poor man's BSDF)

Greg Ward gregoryjward at gmail.com
Tue May 17 11:23:52 PDT 2016


Hi Stephen,

This would probably be a little easier to set up using transdata, which is meant for this kind of input.  However, none of the older types handle soft-specular interactions from non-sources.  This is a big caveat with these material types and one of the main motivations for implementing the more general BSDF framework.

Since you already have this function implemented, you can use it to create an XML file for the BSDF primitive (see refman.pdf pp.10-11) using either bsdf2klems or bsdf2ttree, which take functional descriptions.  To given an example, we can define the following wgmdiso.cal file:

{ Ward-Geisler-Moroder-Duer isotropic BRDF model }

rho_d = 0.095;
rho_s = 0.05;
a = 0.08;

exfunc(hx,hy,hz) = exp(-(hx*hx + hy*hy)/(hz*hz*a*a)) *
			(hx*hx + hy*hy + hz*hz) /
			(PI*a*a*hz*hz*hz*hz);

{ Note that we assume i and o vectors are normalized }

wgmdiso(ix,iy,iz,ox,oy,oz) = if( -iz*oz, 0,
			rho_d/PI + rho_s*exfunc(ix+ox,iy+oy,iz+oz) );
----------

This can then be passed to bsdf2ttree to create an XML representation:

	bsdf2ttree -t3 -f wgmdiso.cal wgmdiso > wgmdiso.xml

The "-t3" option tells bsdf2ttree that the function is isotropic.  There's no such choice for the Klems representation, where you would use:

	bsdf2klems -f wgmdiso.cal wgmdiso > wgmdisok.xml

It's a homework assignment to convert your function into one that takes incident and exiting vectors (both pointing away from the surface), and remember that you need to include same-side vectors for reflection, which should return 0.2*0.9 for the diffuse portion in your case.

The reward should be a BSDF description that does proper sampling of the transmitted light!

Best of luck!
-Greg

P.S.  Apropos to this discussion, Peter Apian-Bennewitz wrote an excellent review of different Radiance materials and how best to apply them a few years back, including the transfunc type.  His paper is available as at <http://arxiv.org/abs/1307.4214>.

> From: Stephen Wasilewski <stephen at coolshadow.com>
> Date: May 17, 2016 10:33:44 AM PDT
> 
> I'm trying to set up a transfunc material to approximate some rough measured data I have.  Assume my material is isotropic and I have a unscaled transmission profile from 0-90 degrees.
> 
> here is my material:
> 
> void transfunc pane
> 2 tdis distribution.cal
> 0
> 7 .9 .9 .9 0 .8 1 12
> 
> .8 is my measured total VLT, and 12 is a magical factor that fits the simulation with a physical model (this number is different for every material, which is why I know I'm missing something, mostly likely math skills)
> 
> and here is the contents of distribution.cal:
> 
> tcoef = .5*90*A7;
> 
> ang(x,y,z) = acos(x*Dx+y*Dy+z*Dz)/DEGREE;
> 
> bound2(x,y,z) = if(ang(x,y,z)-90,90,ang(x,y,z));
> 
> tdis(ix,iy,iz) = tcoef*tdat(91-floor(bound2(ix,iy,iz)));
> 
> tdat(i) : select(i,
> 0.000310656,
> 0.000312042,
> ...
> 0.238534447,
> 0.426770895)
> 
> Im getting the expected distribution for direct light sources (at least for near normal incidence, which is all I am worried about for now), but glows and indirect light seem to revert to a lambertian.   I have no idea how to scale these values to insure the right transmittance or as the reference manual puts it "The function brtd should integrate to 1 over each projected hemisphere". 
> 
> Help with integration, what is going on with diffuse transmission, anything else I may be missing and/or that I am barking up the wrong tree entirely would be greatly appreciated.
> 
> Thanks,
> 
> Stephen Wasilewski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20160517/ba1a12e7/attachment.html>


More information about the Radiance-general mailing list