Understanding the pbrt input file for particpating media

Skip to first unread message

Curtis Johnson

Nov 16, 2022, 6:47:19 PM11/16/22
to pbrt
I put something similar on github but thought some people might check here too.

I'm trying model atomic emission from a magnetic fusion plasma. I have simulated data of emission from plasma and want to compare this to camera and spectroscopic measurements. The 2D plot is a cross-section (toroidally symmetric) of a charge state density but this can be easily converted into an emissivity for a given emission line of interest. I want to use PBRT to account for reflections off the inner walls and integration through the lines of sight (cyan lines for example).

The 3D plot is rendered from PBRT looking down onto a very course grid of the plasma without any of the inner wall structure.

While I can get something to render I don't think it is what I'm trying to model. I think my issues stem from not understanding the input file. There is no absorption/scattering of the emitted light from the plasma (at least at the densities I'm trying to model). I believe this means that I should set "float scale" [0] but when I do this nothing renders am I missing something? Same thing if I set sigma_a and sigma_s to zero individually. From my reading of the documentation I thought that "Le" and "density" would control the emission?

Below is how I'm specifying the volume

        Include "/home/curtis/test_og.pbrt"
       Material "interface"                              
        MediumInterface "test" ""
       Shape "sphere"
          "float radius" [3.1]
        Material "interface"                              


MakeNamedMedium "test" "string type" "uniformgrid" "float g" [ 0.0 ] "spectrum Le" [  500 .1] "float scale" [0.1] "integer nx" [ 30 ] "integer ny" [ 30 ] "integer nz" [ 30 ] "point3 p0" [ -1.4 -3 -3] "point3 p1" [ 1.4 3 3 ] "float density" [..........


Matt Pharr

Nov 20, 2022, 6:53:42 PM11/20/22
to pb...@googlegroups.com
Interesting application!

Unfortunately (for this case), pbrt’s model of volumetric emission requires a non-zero absorption coefficient (more specifically, the emitted volumetric radiance is scaled by the absorption coefficient); that’s how the equations work out. (One way to think about is that there has to be some matter there that is emitting light.) So setting scale to 0 (or sigma_a) eliminates the emission..

Now, you might decide to work around that with a very small absorption cross-section (and correspondingly scaled emission), but then you’d run into the problem that pbrt’s volumetric Monte Carlo sampling routines sample according to the extinction cross-section (absorption + scattering), so you’d have high error since they wouldn’t do a good job of sampling the emission.

So your best bet would probably be to specify a low absorption coefficient and then modify the sampling routines to sample more frequently even in areas of low absorption. I haven’t tried this, but if you added a line like:

sigma_t *= 100000;

before line 330 in pbrt/media.h, that should cause it to sample emission much more frequently along rays. (You’d have to experiment with that scale factor to find something that gave a good balance of performance versus accuracy…



You received this message because you are subscribed to the Google Groups "pbrt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pbrt+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pbrt/b9733624-b037-4d6d-98e6-fb36dbfc8e76n%40googlegroups.com.

Curtis Johnson

Nov 21, 2022, 10:58:01 AM11/21/22
to pbrt
Hi Matt,

Thanks for the explanation. I will have a go at changing this. I've been running into issues like this in my search for an optimized raytracer. My application is a pretty different problem than the problems raytracers are generally trying to solve. There is a code that people in plasma physics generally use for this kind of work, cherab/raysect but it is painfully slow and not at all optimized. Hence my search for something different. 


Reply all
Reply to author
0 new messages