# Noisy Reflection Problem

Dear Group

First of all, I ask that you all will please forgive my lack of knowledge on the subject of Monte Carlo importance sampling. Although I am not familiar with this subject, I do possess an engineering degree so I am familiar with some complex mathematical concepts.

As for my question, I have had some issues with reflection on objects composed of metal and metal2 materials. Generally the reflections that I have had problems picking up are bright objects that are non-light sources sources. An example of such is picking up the reflection of a floor with a very bright area due to a light source such as the following example:

Generally, the reflections of the floor on the appliances will come out very noisy (instead of blurry). I have had some moderate success in eliminating the noise by increasing the rendering resolution. It takes a rendering of about 12 times the final resolution before filtering to reduce the noise. Although this is acceptable, it is inefficient to render an entire scene at this resolution due to the problems of a fraction of the scene. In my opinion, it is far more efficient to have a solution to rectify the problem locally where the problems exist rather than on the entire image.

I have attempted going into the software�s source code to find a solution to this problem. What I hypothesized was that by increasing the specular sampling, I can reduce the pixel variance and the cost of increased computational expense and the loss of some blurriness of the reflection (although I believe I would still capture the roughness of the material). I have read through Chapter 12 of �Rendering with Radiance� and have looked into materials file included with the CD-ROM. While delving into aniso.c, I thought I could accomplish my objective by increasing the value of the constant MAXITER (I actually renamed it to MAXITER2 to avoid any conflict with MAXITER in norm.c) from 10 to 256. Unfortunately, this did not work. I tried to do a small calculation to estimate the number of rays that would have to be traced in order to render the image with these settings. Most of the surfaces of the appliances in the above picture are anisotropic. I estimated that these surfaces comprise of about 1/3 of the scene. If I rendered the image at 1000 x 1000 (1 million total pixels) about 333K pixels would have their specular component sampled. At 256 samples per pixels and a pixel sample rate of 1, specular jittering of 1 and specular threshold of 0, the number of specular samples expected would equal to around 85 million. When I did render the image, a total of about 19 million rays were traced (including ambient). As you can see, the number of actual rays traced is not on the same order of the number that I expected to trace. I did a comparison between a rendering with and without the source code modifications that I had performed. There were differences in the render settings. The image quality was no different between the two renders and there were only about 2-3 million more rays total traces.

For my questions:

Firstly, am I off base in my assumption that increasing the number of specular samples will decrease the pixel variance/noise in my renders or am I over simplifying the problem? Secondly, if this is a proper assumption, would simply changing a few constants in the sources code help achieve my objective or would a lot more work be necessary? Lastly, are my assumptions concerning the number of samples required off base?

Thanks

Marcus D. Jacobs

···

_________________________________________________________________

Hi Marcus,

The MAXITER macro is not the one to change in aniso.c to get additional specular samples. In fact, you would have to rewrite a bit of code to do this -- a macro change is not enough. Something more like a loop at line 276, where agaussamp() is called would be necessary.

Another thing to try is the -m option of pfilt. Have you tried this, yet? This option may reduce the appearance of specular noise by blurring these samples more widely. Play around with some different values -- start at 0.25 and reduce down as low as 0.05 to see the effect.

-Greg

Marcus Jacobs wrote:

Dear Group

First of all, I ask that you all will please forgive my lack of knowledge on the subject of Monte Carlo importance sampling. Although I am not familiar with this subject, I do possess an engineering degree so I am familiar with some complex mathematical concepts.

As for my question, I have had some issues with reflection on objects composed of metal and metal2 materials. Generally the reflections that I have had problems picking up are bright objects that are non-light sources sources.

Hi Marcus,

if I interpret this correctly, I think you're running into some fundamental limitations of RADIANCE. If you're getting noise from specular reflections off your cool microwaves 'n' stuff, you're looking at so-called *caustics*. RADIANCE is conceptually a backward raytracer, tracing rays from the viewer via surfaces to the light sources. This paradigm, even coupled with importance sampling, will inevitably result in noticeable noise when you're dealing with specular reflections. According to MC theory, variance will *gradually* drop with increasing number of samples, but you'll soon wind up with astronomical rendering times.

The more efficient way to handle this is a forward raytracer, tracing rays from the light sources via surfaces towards the viewer. This paradigm is the method of choice for renderings caustics, and it's situations like the one you decribe that motivated the development of the photon map add-on for RADIANCE (see the URL in my signature). Unfortunately, the RADIANCE photon map is based on the (somewhat buggy) official 3.5 release, and you'll have to BYO (build your own). To my knowledge there are no current binaries available for download. (Volunteers, anyone?)

See ya!

--Roland

···

--
Roland Schregle
PhD candidate, Fraunhofer Institute for Solar Energy Systems

END OF LINE. (MCP)

Dear Group

Thanks for all of the advise with my problem with noisy reflections.

I have done some experimenting in finding a solution. One solution to the problem iI found is increasing the render resolution. The following picture was rendered at 8500 x 8500 prior to filtering to 500 x 500:

As you can see here, just about all of the noise is gone. What noise is remaining can easily be smoothed by using the -m option with pfilt. Although I got the results that I wanted, The render time is quite large (hey, life is a compromise). One way that I have considered to increase quality while minimizing the render time penalty is to render the portions of the scene that would benefit from the increased sampling at the high resolutions while rendering the remainder of the scene at lower resolutions. From the above picture, you can see that only a small portion of the scene has problem areas as far as specular sampling is concerned (the appliances). The remainder of the scene doesn't need to be rendered at such a high resolution (the walls, windows, ceiling and floor). It would be much more efficient to just render the appliances at the higher resolution.

For this, I have been looking in to altering the source code to rpiece to allow me to render specific parts of the scene. HDRShop has a selection tool that allows for a user to precisely specify the boundaries of a selection window. I could pass these parameters to the altered rpiece program and have it render those portions of the scene. I would subsequently use pcompos to stich the scene back together. There is one primary concern for this approach. This issue would be the how seamless would each of the separate renders would blend together given that they are originally rendered at different resolutions. To explore this, I basically used HDRShop to cut and paste two separate renders of my test scene to see if there are any noticable seams in the image. The following picture shows the results:

The above picture is consist of two separate renders done at 1500 x 1500 and 6000 x 6000. The picture actually is consist of 2 rows each with 5 alternating columns taken from both renders (Sort of like a brick wall). HDRShop was used to cut individual columns from each render. Pcompos was used to stitch each of the colums and rows together. As you can see, the only seams that are visable are at the appliances. The while looking at the walls and floors, one can not detect that the image is actually a composite. I do believe that this may be a viable option.

The other approach that could be used to reduce the noise in the reflection (I think) is by increasing the number of specular samples taken at each pixel. I do understand that convergence occurs at a sub-linear pace while doing Monte Carlo sampling. But if I am correct, couldn't the error be reduced by half by taking 4 times as many samples? If I am correct, does Radiance take only one sample probalistically if the material has a roughness is non-zero. If only one sample is taken, would it be terribly expensive to take four? I am curious to take this approach. Unfortunately, my background in such subjects as Monte Carlo raytracing and random functions is not very strong. I know that there has to be additional source code changes that would involve quite a bit of math (not that I am scared) in order to do what I am trying to accomplish. Any help and insight as to all that is involved on this would be most helpful.

Thanks

Marcus

BTW, I know that we Americans like to eat a lot but the appliances that are mistaken for microwave ovens are actually just normal convection ovens. Normally they would be placed in a wall cabinet. I just brought them out so I could study the reflections.

···

From: Roland Schregle <[email protected]>
Subject: Re: [Radiance-dev] Noisy Reflection Problem

Hi Marcus,

if I interpret this correctly, I think you're running into some
fundamental limitations of RADIANCE. If you're getting noise from
specular reflections off your cool microwaves 'n' stuff, you're looking
at so-called *caustics*. RADIANCE is conceptually a backward raytracer,
tracing rays from the viewer via surfaces to the light sources. This
paradigm, even coupled with importance sampling, will inevitably result
in noticeable noise when you're dealing with specular reflections.
According to MC theory, variance will *gradually* drop with increasing
number of samples, but you'll soon wind up with astronomical rendering
times.

The more efficient way to handle this is a forward raytracer, tracing
rays from the light sources via surfaces towards the viewer. This
paradigm is the method of choice for renderings caustics, and it's
situations like the one you decribe that motivated the development of
the photon map add-on for RADIANCE (see the URL in my signature).
Unfortunately, the RADIANCE photon map is based on the (somewhat buggy)
official 3.5 release, and you'll have to BYO (build your own). To my
(Volunteers, anyone?)

See ya!

--Roland

--
Roland Schregle
PhD candidate, Fraunhofer Institute for Solar Energy Systems

END OF LINE. (MCP)

--__--__--

_______________________________________________