Next steps - lights, can't quite understand the difference between shadow rays and biased rays. #996
-
Hello, I've been having trouble trying to understand the second option for biased lighting.
I can't quite wrap my head around it. Here are the two main interpretations I have:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Lights are covered in book 2 and biasing is covered in book 3 As far as:
You pretty much have it correct. At every surface, just before the scatter, you'll shoot a "shadow ray" toward a light. Where typically you'll choose a number of shadow rays 1,2,3,4,8,16, etc and point them at a random point on any of the lights. There are structures that exist to prioritize certain lights over others, but the bottom line is that you are explicitly shooting a ray at a light. Then, you just check if the ray hits anything other than the light on the way there. If the ray hits the light, that light is used to calculate the luminance of the scatter point, if the shadow ray hits another object before the light, it is ocluded and it is assumed that the light is not illuminating the scatter point. If you do this many times for each scatter point, you can get a really good, noise-reduced approximation for the luminance in a scene. After you send out all of your shadow rays, the ray continues on, scattering and continues onto he next step of the recursion. Shadow rays tend to be desirable because it's a single ray where all you care about is a single intersection, no solving for the scattering direction, no solving for additional bounces, no solving for colors. So you'll typically see most renders use more shadow rays than bounce rays.
Not exactly. As stated above, a shadow ray is actually a simpler kind of ray than exists in the rest of the book. For biasing, we are literally biasing our rays toward the light. In the example of book 3 the way that we bias is that when solving for how a ray should scatter off of an object we flip a coin. If it's heads, we just shoot the ray straight toward the light (and since it's a regular ray, can just be bounced around or intersect at the light) if it's tails, we just scatter normally. It'd take a book (book 3 to be exact) to explain why this heads-tails thing introduces inaccuracies into the final render, but since we're unnaturrally making rays more likely to go toward light, the scene will appear waaaayy brighter than it actually is. |
Beta Was this translation helpful? Give feedback.
Lights are covered in book 2 and biasing is covered in book 3
As far as:
You pretty much have it correct. At every surface, just before the scatter, you'll shoot a "shadow ray" toward a light. Where typically you'll choose a number of shadow rays 1,2,3,4,8,16, etc and point them at a random point on any of the lights. There are structures that exist to prioritize certain ligh…