Replies: 1 comment 1 reply
-
Hi @aantg I'd need to go over the One thing to be noted: the Getting back to your original problem. If you want the following type of light paths: directional source -> shape -> directional sensor. We don't have anything that could support it - creating such light paths requires more advanced techniques that aren't implemented in Mitsuba 3. For convex shapes, the problem comes simpler: you can just integrate over the surface area and call the shape's bsdf's |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello mitsubers.
I would really appreciate if someone could help.
I need to measure an irradiance on a shape which it gets from directional light source and also irradiance reflected by this shape in particular direction (to detector). I need such measurements for different source-shape-detector angles (phase angles). Well, there is
irradiancemeter
sensor in Mitsuba that seems suitable for my needs. But I've examined some discussions here and learned thatpath
tracer is not good choice for my scenario, because it is (almost) impossible to connect sensor(s) with emitter with correct directions or something like this and that it is better to useptracer
. But I found that there's some problems.Firstly I made different test script based on test_irradiancemeter.py script from Mitsuba sources:
Test script 1 (sphere and constant emitter)
What I got from this:
path
integrator irradiancemeter returns expected ingoing irradiance value ofscalar_rgb
andcuda_ad_rgb
variants.path
integrator I didn't find any BSDF-dependency of ingoing irradiance value as it should be conceptually.path
integrator increasingspp
makes result just slightly worser (I mean increase difference with expected value). I tried spp = 4, 40, 400, 4000, 40000, 400000, 4000000 and got irradiance values 3.1415927410125732 -> 3.0622384548187256 respectively (scalar_rgb
), 3.1415927410125732 -> 3.145853281021118 respectively (cuda_ad_rgb
).ptracer
irradiance value is absolutely wrong (for example = 473.826 withscalar_rgb
, = 488.633 withcuda_ad_rgb
). Changingspp
causes relatively small irradiance value changes (scalar_rgb
: 473.826 (spp = 4) -> 479.035 (spp = 4000000),cuda_ad_rgb
: 503.440 with spp = 4 -> 481.093 with spp = 4000000), so irradiancemeter values stays wrong. This is very bad for my goals.ptracer
andscalar_rgb
variant I didn't find any BSDF-dependency of ingoing irradiance, but withcuda_ad_rgb
there's dependency. For example,diffuse
BSDF with reflectance = 0.0 gives irradiancemeter value of 473.826 (just likescalar_rgb
variant with any reflectance value), with reflectance = 0.5 it gives irradiance value of 488.633, and 503.440 with reflectance = 1.0. This is bad too.hide_emitters
parameter to True works as I expected withpath
integrator (irradiancemeter returns zero value), but withptracer
it doesn't (irradiancemeter returns smaller, but non-zero value: for example 479.03509521484375 with False -> 5.655997276306152 with True).BTW with
cuda_ad_rgb
I get:Secondly, despite of my findings I decided to test something close to my scenario so I changed scene by replacing constant emitter to directional with relevant irradiance value and added rectangular shape with another irradiancemeter attached to register reflected irradiance (though I found 3 additional problems here: 1. it will also recieve irradiance directly from directional light source and this irradiance should be excluded/blocked; 2. it will act as light occluder at small phase angles (possible solution:
mask
with zero opacity ornull
BSDF?); 3. It may itself act as reflector (possible solution:mask
with zero opacity ornull
BSDF?)). Here is script for this scenario (I added some parameters and calculations to "rotate" light and rectangular detector around the sphere):Test script 2 (sphere, directional emitter, rectangle)
Here I started from measuring ingoing irradiance on the sphere, so I commented out detector part of dictionary to exclude its potential influence. As far as I understand theoretically in this scenario ingoing irradiance on the sphere should be equal to$E_s * A_{eff} / A_{sensor} = E_s * \pi * r^2/ (4 * \pi * r^2) = 0.25 * E_s$ , where $E_s$ - is light source (emitter) irradiance, $A_{eff}$ - is effective illuminated area (in case of a sphere $A_{eff} = \pi * r^2$ , $r$ - radius of the sphere), $A_{sensor}$ - sensor's surface area (in this case $A_{sensor} = 4 * \pi * r^2$ ). So this ingoing irradiance depends on light source irradiance only, with $E_s = 1000$ expected value is 250. This shouldn't depend on sphere radius and light direction. As I mentioned above, conceptually, I think, measures of irradiancemeter shouldn't depend on BSDF of a shape it is attached, because "This sensor plugin implements an irradiance meter, which measures the incident power per unit area over a shape which it is attached to". There're problems with all this:
path
integrator inrradiancemeter returns zero, so, yes, it doesnt't work.ptracer
integrator all corresponding abovemensioned problems persists (wrong irradiance values, BSDF dependency, render variant dependency, hide_emitters doesn't work...).ptracer
there's light direction dependency.ptracer
there's sphere radius (i.e. sensor area, I think) dependency.I've made this table with some results for irradiance value on sphere (spp = 1000000 here):
Irradiance varies with light direction which I believe shouldn't be, and it noticeably differ for
scalar_rgb
andcuda_ad_rgb
.As for my reflected irradiance detector (rectangle with irradiancemeter).
null
BSDF ormask
BSDF with opacity = 0 it returns zero value (of course with rectangle normal properly oriented). Looks like withnull
BSDF ormask
BSDF with opacity = 0 irradiancemeter doesn't register irradiance that comes directly from light source whish is what I need.null
BSDF ormask
BSDF and even if its normal is pointing to the sphere. At same time irradiancemeter attached to the sphere returns non-zero value even if this rectangle-detector is between sphere and light source (btw, sides of rectangle = sphere diameter). Looks like withnull
BSDF ormask
BSDF with opacity = 0 my rectangle-detector doesn't occlude light which is what I need. Moreover if it is in between light source and sphere and I set sphere reflectance to zero, then rectangular irradiancemeter returns zero which may indicate that it indeed capture reflected irradiance only and since nothing is reflected it returns zero. The problem is that in this case sphere's irradiancemeter returns zero too, on the contrary to the previous scene where irradiance on the sphere was non-zero even with zero reflectance, ans so maybe that's the reason. Anyways irradiancemeters' values don't seem to be correct and shows strange behaviour IMO. For example, without rectangular shape in the scene, sphere's iradiancemeter returns 446.834 and with rectangular shape (withnull
BSDF), placed between sphere and light source, sphere's irradiancemeter returns 349.402 and rectangular irradiancemeter returns 1916.448. I don't know how to interpret this.It seems that it won't be possible to achieve what I need with
ptracer
and irradiancemeters (because of incorrect values in particular) and I should follow another approach. Actually, I more interested in getting irradiance that is reflected in particular direction and I suspect that irradiancemeter sensor accounts for all directions (not what I want). Maybe I could use path integrator and/or other sensor like othorgraphic and derive irradiance from its output (integrate over solid angle?)?Any suggestions? I hope I didn't confuse much anyone (including myself) with this text bedsheet.
Beta Was this translation helpful? Give feedback.
All reactions