<style type='text/css'>
.TerraceMsg { font-size: 12px; font-family:Dotum, Arial, Verdana, Sans-Serif;}
.Bold { font-weight: bold; }
</style><div class='TerraceMsg'><span style="font-size: 14px">Hi, everybody and Matthew:<br />
<br />
I happened to encounter the blog of Matthew in the internet, and left some notes in the blog. I was led to this <br />
mailing list with the following request:<br />
<br />
I like Python so much that I would like to do my experimentation with radiative transfer with Python environment.<br />
     So, yt is a perfect environment. But it does not support a full radiative transfer equation yet. <br />
<br />
By a full radiative transfer equation I mean:<br />
<br />
(1) dot (w, del L (x, w) ) = LeV_0 (x,w) + sigma_s (x) [  int_{ Sp} f_p( w, x, w' ) dw' ]  -  simga_t(x) L(x, w)<br />
<br />
                                                                                                                                     for all x in a given volume V<br />
                                                    where V_0 is the "free " part of the volume  V  in which objects are not occupied.<br />
 <br />
Here del is the spatial gradient operator, L(x,w) is the radiance at point x in the direction of w. LeV_0 (x,w) is the <br />
emitting radiance at point x in the direction of w. sigma_s(x) is the scattering coefficient at x. Sp  is the set of all solid angles. f_p(w, x, w') is the phase function at x, from direction w' to direction w. sigma_t (x) is the extinction or attenuation<br />
coefficient, and sigma_t = sigma_s + sigma_a, where sigma_a is the absorption coefficient. <br />
<br />
</span><br />
<span style="font-size: 14px">(2) boundary conditions: for all x on surfaces of objects within the volume V:<br />
<br />
   L(x,w) = LeS (x, w) + int_{Sp} f_s (w, x, w') L(x, w') dot ( N(x), w' ) dw'<br />
<br />
 Here LeS(x,w) is the emitting radiace at x on a surface to direction w. f_s(w, x, w') is the reflection function  at x from<br />
direction w' to direction w. <br />
<br />
By combining (1) and (2), we get a single integral equation:<br />
<br />
(3) L(x, w) = rau( x_S, w) L (x_S, w) + int_{x_S, x} tau(x', x)  [ LeV_0 (x', w) + sigma_s(x') int_{Sp } f_p( w, x', w') dw' ] dx' <br />
<br />
Here tau(x', x) is the optical depth from x' to x: <br />
<br />
tau(x', x) = exp [ -int_{x, x'} sigma_t (x'') dx''  ]<br />
<br />
It is not easy to find the radiance function L(x,w)  that satisfies the integral equation of (3), where L occurs in both sides of the equation. <br />
<br />
In computer graphics [within computer science], this problem has been solved mainly by means of Monte Carlo<br />
Integration technique, in particular "path tracing" techniques. In these techniques, we randomly generate a set of <br />
paths from the camera to the light sources, and compute the solution L by averaging the radiances carried by each path. A  path is a sequence of positions in space. The essence of the techniques comes down to how to sample good paths<br />
which contributes much to the final radiance at the camera. So may paths would not connect the camera and the light sources and thus would not contribute to the final radiance at the camera. <br />
<br />
I use the term "radiance"  to mean the radiant energy per unit area per solid angle, and is the same as<br />
the "intensity" often  used in the literature. <br />
<br />
NOW: As far as I gathered information from various sources, the yt volume renderer implements only a special<br />
case of a radiative transfer equation. It seems that it does not consider the second term ( the integration) in equation (3). <br />
Or  it simplifies the integration <br />
            int_{x_S, x} tau(x', x) [ LeV_0 (x', w) + sigma_s(x') int_{Sp } f_p( w, x', w') dw' ] dx' <br />
<br />
to<br />
<br />
 int_{x_S, x} tau(x', x) [ LeV_0 (x', w) ] dx'.<br />
<br />
That is, it does not support the phase function f_p(w, x', w'). <br />
<br />
But I would like to use the phase function. In that case, we may try a "single scattering" version or a "multiple scattering"<br />
version. In the first version, each sampled position in the volume scatters only the radiance coming directly from the <br />
light source. In the second version, each sampled  position in the volume scatters the radiances scattered by<br />
other positions. In this case, two or three multiple scattering would be good enough. But for me the single scattering<br />
version would be just fine. <br />
<br />
-----<br />
The project I am interested in is rainbow simulation. The phase functions of a collection of water drops will be computed<br />
by means of Mie theory or some other variants. <br />
<br />
The implementation in C++ of path tracers are available in open source in the following site:<br />
<br />
<a href="http://www.mitsuba-renderer.org/devblog/?p=473">http://www.mitsuba-renderer.org/devblog/?p=473</a><br />
<br />
This implementation is reliable and tested. I am willing to add the relevant parts of the code<br />
into the yt volume renderer. <br />
<br />
But as is well known, it is not easy to find where to hack the existing code....<br />
<br />
I think I need to cooperate with some one who knows the internal structure of the volume rendering code.<br />
<br />
Sincerely<br />
<br />
Moon R. Jung<br />
Professor<br />
Dept of Media Technology<br />
School of Media<br />
Sogang University.<br />
<br />
<br />
<br />
<br />
<br />
<br />
 <br />
 <br />
</span></div><br><br><br><br><table border=0 cellpadding=0 cellspacing=0 >
<tr><td>
<img src="cid:997535610-12032001-111632120128001" border=0></td><td width=10></td><td style='vertical-align: top;font-size:9pt;'>
Science is the refinement of everyday thinking.<br />
Zen is your everyday life<br />
Life is  at root  playing</td></tr></table>
<br>
<div id='TMSMDN' style="background:url('http://mail.sogang.ac.kr:80/mail/receiveMDN.do?mdnData=Cxm2Edsf0VN1ssjsPbyhWt%2B7N2v1nSHB8U4W4H%2BOVHpokLemTiwD8dMN5i3Hb0KyxmCTmHwGJDj8%0AwZ3AqBWvElVB2Ts9wC9XworUlX0bLTdrvtouNhzF395C0kPqXCdFeVnG7VAamcQ2pPDTa9qfi0sl%0Aghbo8SsDKWA9WMGMiaU%3D%0A')"/>