5
$\begingroup$

I want to show light reflected from a flat, mirror-like surface onto a diffuse surface. I noticed that even when everything else looks good, the light reflected from the mirror is 100% fireflies. When the roughness is increased a bit, they smooth out quickly to what I would expect. NOTE: mirror is flat - this is not a caustic issue. However, that is the direction I'm going next. Also, I'd like to see how well Blender can do - "just use another rendering program" is not helpful here.

  1. Is there a concise yet accurate way to explain why this happens? I'd like to understand as much as possible.

  2. Is there some particular setting (beyond just "Samples") that I can use to improve the reflected light pattern smoothness (for a given render time)?

  3. Could Light Portals be used to reduce render time for smooth reflected light?

The images below are 100 samples. 1000 doesn't really fix it.

I have found that this answer by @gandalf3 seems to address part of my question already - but I'm still interested in trying everything I can within Blender, before resorting to those measures.


Edit: This Blender Cookie is the best discussion/tutorial I have found so far on ray tracing and nodes in cycles. The .blend file is here.

rough=0.2 rough=0.1 enter image description here

So a ray from the camera hits the "floor" at a certain point (pixel) indicated by a tiny cube. Actually, in the case of a mirror (specular reflection) a similar number of rays from that point would reach the light directly and by reflection. So we can't just say there are "fewer rays". There is something more here.

two sets of rays two sets of rays zoomed

DIfferent areas require very different number of samples. Words describe my impression of how much noise in the direct lit areas, direct shadows, and reflected lit areas.

different number of samples

The .blend file is here.

$\endgroup$
  • $\begingroup$ Light portals work for interior rendering only, afaik. So if you put your sceen in a room, and light enters it from a window, you could try portals. Try also using bigger area lights. $\endgroup$ – m.ardito Oct 7 '15 at 7:06
  • $\begingroup$ anyway it should be caustics, try full global illumination and disable just "reflective caustics": no fireflies at all. Or try filter glossy. $\endgroup$ – m.ardito Oct 7 '15 at 7:20
  • $\begingroup$ Does Blender call reflections from FLAT surfaces caustics? In any case @m.ardito, I want the reflections - that's what I'm after. I just want them to be smooth. $\endgroup$ – uhoh Oct 7 '15 at 9:26
  • $\begingroup$ @uhoh Yes, Cycles considered this to be a caustic. AFAIK any glossy or transmission ray with a depth greater than 2 (has bounced once before) which then hits a lamp is considered a caustic. $\endgroup$ – gandalf3 Oct 8 '15 at 2:21
  • $\begingroup$ I've added the .blend file link to the question. $\endgroup$ – uhoh Oct 10 '15 at 11:05
5
$\begingroup$

This is pretty much the worst-case scenario for backwards path tracing.

On contact with the diffuse plane the ray could go in literally any direction, and only a tiny fraction of those directions will hit the glossy object at the right place and angle to rebound into the smallish light source.

enter image description here

To see why increasing the roughness of the glossy material helps, look at it from the point of view the ray right after hitting the diffuse plane:

enter image description here

As you can see, the area which the ray can hit and still find the lamp is much larger even with only .1 roughness. In addition, MIS probably can do a bit more to direct samples to the lamp when there is some roughness and the ray doesn't need to bounce at an exact angle (as is the case with specular reflection).

Note that with enough samples it does eventually converge (in this sense these aren't fireflies so much as noise). Here's a render with 10000 samples:

enter image description here

$\endgroup$
  • $\begingroup$ So in the pictures with the green and blue "cones of light" I'm illustrating that for a mirror, the number of actual rays in the real world, from the spot on the screen to the light are about the same for direct and reflected light. So I'm actually surprised that the direct light is almost smooth with 1 sample, but reflected light needs 1000 (see last montage of 4 sample numbers). The direct light must be using some super-intelligent averaging. It seems that there aren't any "magic" buttons to push here within Blender cycles. Thanks for your answer! $\endgroup$ – uhoh Oct 10 '15 at 10:54
  • $\begingroup$ I am reading the link for MIS in your answer now, thanks @gandalf3 for your help! $\endgroup$ – uhoh Oct 10 '15 at 11:10
  • $\begingroup$ @uhoh (regarding your first comment) That is because of MIS. Without it you would see that direct light is almost as noisy as indirect light $\endgroup$ – gandalf3 Oct 10 '15 at 18:07
3
$\begingroup$

I'm adding an answer, here, adding to my comments above, so that I can add a few images below: I tried a simple setup similar to yours, and you can see the result with settings aside, so that you can compare with yours: rendering size is small here, but fireflies are quite lower, it seems

enter image description here enter image description here

$\endgroup$
  • $\begingroup$ Thank you for your answer! I appreciate you point out the various settings. So you are right, it does seem like at 1000 samples the noise is almost low enough not to be noticeable for casual applications, and going a little higher can be enough. $\endgroup$ – uhoh Oct 11 '15 at 22:54
2
$\begingroup$
  1. Blender casts rays from the camera. It is very diffiult for it to make the rays hit the lamp, even more if it is small. And even more if the rays have to bounce from a mirror. If the mirror is rough, it will send multiple rays per sample (branch) and thus hit it more frequently.

  2. You could use the light path node to make the material show a smooth glossy to the camera and a rough one to anything else. The light path gives out values (1 or 0) depending on the type of the ray. (See http://www.blenderguru.com/articles/cycles-input-encyclopedia/ for more details)

  3. Light portals also help Blender find small lamps. However they are for cases where Blender can't know where to look for light. (a room with a small window is a typical case, as pointed out by m.ardito) This is no such case, so I don't think you could use them. Andrew Price illustrates this very well here: http://youtu.be/oveSskhIEAc

Massive kudos for a very clear question. I hope this may be useful to you.

So, this may clarify things:

This is how the fireflies are born on a perfect mirror: with a very little move in the position of the camera, the ray may completely miss the lamp:

Above the ray hits home, below it misses

Instead, with a rough mirror, the rays can be thought as spreading around within a small angle in 3D space:

Rays spreading

So with a rough mirror the effect of the lamp doesn't cut of in a hard way. Instead, it gradually decreases. The small angle in wich the rays spread is sampled, so theoretically this does create extra rays. Thus, no fireflies.

$\endgroup$
  • $\begingroup$ We are on the right track, but I still don't quite understand the ray frequency idea. Please see the Blender Cookie link I added and two more images showing similar number of rays. $\endgroup$ – uhoh Oct 7 '15 at 9:22
  • $\begingroup$ Blender sends camera rays from the camera. Depending on what they hit (glossy, diffuse, emission etc.) it may do a number of things: hit an emissive material. Hit a glossy material and send another ray. Hit a diffuse material and send multiple rays into multiple directions. Or, if we have a rough glossy, send many rays from the point of impact on the mirror. These rays go into many directions, thus making the reflection appear rough. Also, if the glossy is rough, the limits of the reflected lamp's shape are blurry, thus rays don't miss it entirely as they would do if it was a clear reflection. $\endgroup$ – Mörkö Oct 7 '15 at 9:28
  • $\begingroup$ The question is really about mirror reflections @user277143 where the rays go in exactly one direction. Non-zero roughness was included to show fireflies only really show up when reflections are almost mirror-like. $\endgroup$ – uhoh Oct 7 '15 at 9:30
  • $\begingroup$ I hope I understand you, but I am not sure. I am trying to come up with a picture. $\endgroup$ – Mörkö Oct 7 '15 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.