[Radiance-general] Re: query about accurately modelling glazing

Greg Ward [email protected]
Sun, 18 Jan 2004 09:17:33 -0800


Hi Alex,

> From: alex Summerfield <[email protected]>
> Date: January 18, 2004 4:51:33 AM PST
>
> Hi Greg
> Many thanks for the feedback -
>>
>> Actually, refraction is never ignored in Radiance, even when tracing 
>> to light sources.  The sources will be missed or not depending on how 
>> big they are and how much refraction goes on.  If a pane of glass is 
>> modeled using dielectric, so that rays are refracted going through 
>> it, they get bent back straight so they still head in the same 
>> direction, albeit shifted, slightly.
>
> Ok that's interesting - it means that refraction through parallel 
> surfaces will never fail for direct sunlight - since they will be 
> heading in the right direction to hit the sun source. Great.
>
> Seems that for non-parallel situations refraction treatment in the 
> direct calc in Radiance is different to other raytracers in that when 
> the ray misses a direct source there is a null result - whereas i 
> think the usual treatment is to ignore refraction. I'm thinking of 
> sunlight only through a cylindrical glass of water - both packages 
> will show the scene through the glass refracted - but in std raytracer 
> the sunlight passes through and is cast onto the table simply changed 
> by the transmittance of the media.
>
> Radiance will presumably record transmission in places (small 
> deflection) and in other parts not so.  (Not a criticism, Greg - just 
> good to be aware in some situations, such as a wavey-glass brick wall, 
> may transmit less of the sunlight than anticipated by the material 
> spec).

You're absolutely right -- it is good to be aware of these things.  I 
never liked the approximation of "no refraction" in other ray-tracers.  
What I have is also wrong, and perhaps less well-balanced from an 
energy standpoint in the case of direct illumination through curved 
dielectrics, but at least it doesn't look quite so bizarre as light 
streaming unperturbed through a glass of water.  I was making the 
assumption that such objects were generally not as important for 
lighting in most architectural contexts.  This of course is not true if 
you have some kind of light redirecting system involving prisms and the 
like, which is why there are special materials for these sorts of 
surfaces.

>> Spheres and lenses are a different matter of course, and caustics are 
>> not modeled correctly for that reason.  You need to use the photon 
>> map for that!
>
> Indeed -  mind you perhaps the caustics produced will ultimately split 
> out just into the three primaries.
>  I'm thinking of a virtual Newton conducting his classic prism 
> experiment ;-)
>
>>
>>> I think refractive index also does not apply when tracing rays as 
>>> part of the indirect calculation - even though missing a large area 
>>> source (sky) is not likely to be a problem.
>>
>> I don't know where you heard this, but it's not true.
> I guess i got it from the (wrong) idea that refraction only works for 
> view rays.
>
>>
>>> Reflectance - in atria there are likely to be complex and multiple 
>>> glazing surfaces - eg the roof and then in large areas along the 
>>> offices lining the edge....
>
>> That's partially true.  Interreflections of the sky and other parts 
>> of the ambient calculation will consider the multiple reflections 
>> going on, specular as well as diffuse.  However, you would have to 
>> use virtual sources to get the pure specular reflections from light 
>> sources, which can be expensive.  You're better off doing that only 
>> when it really matters -- like when you have a mirrored building 
>> facade or something.
>
> Specular contributions are probably neglected more often than they 
> should, especially when we are dealing with direct sunlight on 
> polished floors or glazing around entrances or in atria.  It may not 
> be important overall - but in specific areas it can be highly 
> significant.
>
> The upside is that the source is just the sun and these specular 
> surfaces often lie in the same plane so that a single expanse of 
> 'mirror' will do the job for many windows. By comparison with the 
> ambient calculation the creation of one or two extra virtual suns to 
> cover these pathways in the direct calculation need not be costly.

That's an excellent point.  I was thinking more in terms of your atrium 
example -- I'd hate to think what adding a mirror for every glazed 
surface in an atrium would give you, though your trick of reducing 
coplanar glazings to single surfaces might help there, too.  There are 
quite a few optimizations in the virtual source calculation to prevent 
potential but impossible interreflections from creating a plethora of 
virtual lights, but these are no guarantee in all situations.

>>> (Daniel - this may have relevance for your work) it does not include 
>>> the contribution of indirect sources eg bright overcast skies are 
>>> not going to be specularly reflected around the atrium. The Radiance 
>>> indirect calculation essentially deals with diffuse-diffuse pathways 
>>> only.
>>
>> Again, these are accounted for correctly.
>
> OK Great! One subsequent question to clarify:
> Consider if we have no direct sources and a view ray that hits a 
> diffuse floor - we have hemisphere sampling and ambient bounce 1 - if 
> any of these rays is incident on a specular surface  then the ray is 
> traced back with specular reflection and then, for instance finds the 
> sky.
>
>  So would this pathway (where sky illuminates floor via glazing) 
> require a setting of  -ab 3 as a minimum as would be expected from a 
> purely diffuse pathway (1 ambient bounce - 2 specular reflection - 3 
> indirect sky source)?

No, it's just a 1-bounce calculation for the -ab parameter.  Remember 
-ab only counts diffuse scattering, and these rays are traced fully, 
wherever they go, including from the diffuse floor to a specular 
surface to the sky.

>  If the operator decides to switch to modelling the atrium aperture as 
> an illum (switching the indirect sky to a the direct source) - then 
> this pathway is no longer included  - again unless the surface is 
> identified explicitly as a mirror (modified by the reflection function 
> used on the  glazing).

This is true.  I actually had to double-check the "source" code to be 
sure of this.  Any ambient ray striking (directly or indirectly) a 
light or illum is discounted in the calculation to avoid over-counting 
of source contributions.  Before the advent of virtual sources, I 
actually used to include ambient rays that then took specular paths, 
but had to remove it again for this reason.

> This is useful to be aware of because the notion of changing a source 
> requiring a change to the model specs is not necessarily obvious - and 
> it may account for some of the differences in results between using an 
> illum or relying on the ambient calculation.

No argument.  This difference could be as little as a few percent to 
something quite a bit larger near grazing angles.

>>> Ok so does that mean specs and functions for reflectance changing 
>>> with angle of incidence are going to effect the appearance of the 
>>> scene visible in the glazing, the light transmitted, but not the 
>>> light reflected?
>>
>> They affect both.
>>
>>> And what about direct sunlight and diffusing glass? Is the light 
>>> transmitted - or does the random scattering cause the same problem 
>>> as refraction about missing the target when tracing the ray 
>>> backwards?
>>
>> The diffuse or rough specular part of transmission (and reflection) 
>> gets included in the indirect (ambient) calculation.  If modeled 
>> using the directional diffuse part of one of the *func or *data 
>> material types, this gets lumped into the Lambertian component, which 
>> admittedly is a very crude approximation.  Perhaps this is what you 
>> are thinking of above -- however, it doesn't apply to the Gaussian 
>> materials (plastic, metal, trans, plastic2, metal2, trans2).  These 
>> all work properly, which is why you should use them whenever 
>> possible.  Problems remain when you get strong caustics from a low 
>> roughness surface, however.
>>
>
> Still not sure about this - a ray in the direct calc is traced back 
> toward the sun - but is incident on some diffusing glass and is 
> scattered randomly and presumably misses its target. (?)

It's all rather complicated, isn't it?  The pure specular (transmitted) 
component of trans, trans2, and glass types is sent straight through to 
light sources.  Surface normal perturbations are ignored for shadow 
rays in this case.  The Lambertian and directional-diffuse portions are 
accounted for in the ambient calculation, if you have one.  Otherwise, 
these contributions (indirect from light sources) are lost.

> I agree about using the Gaussian materials as far as possible 
> especially given the role of indirect lighting in daylighting - i'm 
> not entirely convinced given the Lambertian diffuse approximation and 
> nevertheless good results in most cases -  if going to the trouble of 
> measuring and specifying BRTD materials often really make that much 
> difference.
>
> The number of times i've seen lighting studies blown away because some 
> such thing as people deciding to keep their blinds drawn so they can 
> see their computer screens clearly :-)
>
> Many thanks again Greg - very useful to clarify things.
> cheers
> alex

I guess most people don't really think carefully about these issues -- 
but it's a good idea to know what's going on in the calculation.  When 
I'm uncertain, I go back to the source code, and this is one of the 
benefits of an open source simulation.  The book is also quite useful 
on many of these points, and I'm happy to report that we should have a 
printing service online for that, shortly, thanks to Charles Ehrlich's 
continuing efforts.