Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How do you do diffuse lighting with ray tracing? Wouldn't you need an unreasonable number of rays to model it accurately?


Depends. The diffuse direct lighting from a point light only requires one ray, same as with rasterization. Diffuse bounce lighting may need more rays. Area lights may need more rays.

Since both of those things are lower frequency signals, they often don’t need to be re-computed independently for every pixel, so people have various algorithms and caching schemes that drastically reduce the number of rays needed. All of these names do somewhat similar kinds of caching of bounce lighting: photon mapping, irradiance caching, light maps, light baking. Additionally, there are tricks to get decent estimates of shadows from area lights in fewer samples. The demo-scene ray marching guys usually do a great job with one ray (not ray traced, but compatible with ray tracing and very fast.)

Sometimes though, people do use an unreasonable number of rays to render global illumination, area lights & diffuse lighting.


You do, the solution is to cheat. Use the same phong lighting model as you do for traditional rendering and add a reflection component via ray tracing.

(Or at least that's what I did when I wrote a real time raytacer)

For non-real time applications the solution is to use an unreasonable number of rays.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: