Measuring radiance

38 views
Skip to first unread message

psycho...@gmail.com

unread,
May 27, 2009, 12:12:49 PM5/27/09
to pbrt
I'm trying to measure the amount of light that strikes particular
pieces of geometry in my scene. I have created a series of Spectrum
objects that I would like to add to whenever a photon strikes the
object.

My first impulse was to extend the sphere plug-in (that's the shape
I'm using) to do the addition from within the sphere's intersect
method. However, intersect only passes the ray information, not the
radiance.

Since I'm using photon mapping another idea was to create a special
material with my incrementer embedded in it. But that seems more
complicated than necessary.

I don't think this should be very complicated but I guess my lack of
deeper understanding of PBRT is keeping me from seeing an obvious way
of doing this.

Any thoughts on how I should proceed?

Kevin Egan

unread,
May 27, 2009, 12:58:01 PM5/27/09
to pb...@googlegroups.com
You might be able to change the photon mapping code so that the filter
that tries to measure incoming irradiance is changed to simply count
the number of nearby photons within a certain radius. Usually the
filter will try to weight the photons by energy and distance. You
basically want to take all that out and just make a flat count.

Kevin

psycho...@gmail.com

unread,
May 27, 2009, 3:04:41 PM5/27/09
to pbrt
The problem with altering the photon mapping code is that seems like a
global solution. By that route, I'm not seeing how I can associate the
collected photons with a particular piece of geometry.

Also, another point I forgot to mention in my initial post is that the
geometry is perfectly transparent. It reflects nothing. So actually
what I want to measure is the energy being transmitted through the
geometry.

Kevin Egan

unread,
May 27, 2009, 3:09:26 PM5/27/09
to pb...@googlegroups.com
The quickest hack that I can think of is to make a new BSDF that does
specular transmission, but also counts the number of rays that pass
through it (you could also have the BSDF class have a global count for
each different geometry label, where the geometry label would be
passed in to the BSDF as a string parameter in the scene file).

Kevin

psycho...@gmail.com

unread,
May 27, 2009, 3:34:06 PM5/27/09
to pbrt
Hmm, yeah. I like that approach. I was experimenting with something
like that last night that but I ran into trouble getting the incoming
Spectrum information. Counting Rays won't work because I need to know
the radiometric characteristics of the incoming Ray. Any thoughts on
how I could capture that information?

Kevin Egan

unread,
May 27, 2009, 4:04:33 PM5/27/09
to pb...@googlegroups.com
Hmmm... you may need to get really hacky and modify the integrator
(path tracing or whatever) to set a global spectrum variable before
calling the BSDF.

Kevin

psycho...@gmail.com

unread,
May 27, 2009, 4:41:58 PM5/27/09
to pbrt
It only needs to run with the photon mapping integrator. If my
understanding of photon mapping is right, it would seem the global
spectrum variable should be incremented somewhere in the execution of
Li(). Does that sound right? If so, I'm not certain at which point the
increment should occur.

Kevin Egan

unread,
May 27, 2009, 4:48:47 PM5/27/09
to pb...@googlegroups.com
It sounds like for what you're doing you only want to increment during
the photon shooting stage. I don't have the pbrt source with me right
now, but I think that's in a function called Preprocess or something
similar.

Kevin

psycho...@gmail.com

unread,
May 27, 2009, 5:07:42 PM5/27/09
to pbrt
Yeah, preprocess seems right to me too. I'll try it tonight and will
post the results. Thanks so much, Kevin!

Matt Pharr

unread,
Jun 1, 2009, 5:39:53 PM6/1/09
to pb...@googlegroups.com
I'm wondering if photon mapping is the best approach for this. What
exactly do you want to measure? Total irradiance at a point, some
sort of directional radiance distribution, or ... ?

My suggestion might be to hack up the system so that it doesn't do all
this 'render an image stuff', but instead you do a loop over all the
points where you want to compute this measurement, call Scene::Li() in
a bunch of directions at that point (maybe with the path integrator
wired up to compute radiance along rays, or whatever), and then
average/accumulate those values however is most useful. Does that
seem like it'd solve the problem?

Thanks,
-matt

psycho...@gmail.com

unread,
Jun 1, 2009, 10:07:07 PM6/1/09
to pbrt
I'm trying to emulate a physical experiment that was performed in
which a flux meter was poked into a chamber and it measured the
irradiance at a series of points. My ultimate goal is to create a
virtual world that is a copy of the previously measured physical one
and compare the two environments' irradiance distributions.

The physical sensor's sensitivity was from all directions and in all
visible wavelengths (I've already added full spectrum lighting to my
version of pbrt). I've created a perfectly transparent sphere to
represent the sensing area of the flux meter. Whenever a ray strikes
the sphere's surface, the amount of light transmitted through it is
added to an irradiance counter. Once all the photons have been
collected then analysis occurs.

As for photon mapping being the best choice, I do not know for sure
that it is. I chose that since the rays originate from the light
source and intensities are deposited on geometry - it seemed like a
good match. For my purposes I'm not even interested in the final
rendered image per se, I'm just using it as an indirect indicator of
whether I've got the photon mapping parameters correct. Ultimately, I
just need to know how much irradiance is hanging around at Point in
Space X1, X2, X3, .... When I run my final experiments, I'll be
skipping the image rendering anyway.

I considered the path integrator and I see what you're saying in your
suggested approach. That very well might be a better approach.
However, photon mapping seems a bit easier to implement and I think it
should be functionally equivalent for my purposes. Is this assumption
correct? Considering my goals do you think the path integrator would
be a better choice than photon mapping?

Thank you very much for your advice.

dave


On Jun 1, 5:39 pm, Matt Pharr <matt.ph...@gmail.com> wrote:
> I'm wondering if photon mapping is the best approach for this.  What  
> exactly do you want to measure?  Total irradiance at a point, some  
> sort of directional radiance distribution, or ... ?
>
> My suggestion might be to hack up the system so that it doesn't do all  
> this 'render an image stuff', but instead you do a loop over all the  
> points where you want to compute this measurement, call Scene::Li() in  
> a bunch of directions at that point (maybe with the path integrator  
> wired up to compute radiance along rays, or whatever), and then  
> average/accumulate those values however is most useful.  Does that  
> seem like it'd solve the problem?
>
> Thanks,
> -matt
>
> On May 27, 2009, at 9:58 AM, Kevin Egan wrote:
>
>
>
> > You might be able to change the photon mapping code so that the filter
> > that tries to measure incoming irradiance is changed to simply count
> > the number of nearby photons within a certain radius.  Usually the
> > filter will try to weight the photons by energy and distance.  You
> > basically want to take all that out and just make a flat count.
>
> >        Kevin
>
Reply all
Reply to author
Forward
0 new messages