3 ms·
It's not something I've played with before but it seems to me it would make sense to include a concept of local intensity in selecting lights. Luminosity/dista
by LorenPechtel 5y ago
It's not something I've played with before but it seems to me it would make sense to include a concept of local intensity in selecting lights. Luminosity/distance/distance.
I also suspect that in most situations you can cache most results. Cast one shadow ray at a light selected randomly distributed based on intensity (thus if half the light that could hit a pixel comes from one source that light gets picked half the time) and a cache of the other answers. Sit still and it will be basically perfect, the more you move the more error there will be but there will also be less ability to notice that error.
I've also been curious about using Z-buffer techniques to determine visibility. Render a frame off screen, "color" it with the distance to the pixel. An object is visible if this frame shows it in the color corresponding to it's distance.
- gmueckl 5y agoAll of these techniques already exist, sometimes in more than one form. There are multiple published papers on sampling millions of light sources efficiently, mainly in offline rendering. There are other approaches that e.g. cluster far away light sources. What is far away is different for each pixel, so the solution is a global cluster hierarchy and a location specific cut through that tree - a light cut). Efficiently determining visibility, even approximate visibility, is what makes rendering such a tough problem in the first place. Naturally, many ideas have been gathered in this space. Shadow maps for light sources act as caches of discretely sampled visibility information per light source. Their sampled nature makes them highly problematic in practice. Many workarounds for shortcomings have been found over the years, but it's like building a jenga tower on a shaky foundation. Similarly, you can reasonably estimate shadowing from objects in a local area around a pixel by doing screen space tracing, that is, walking the projected line towards the light source in the depth buffer and see if any fragment in that line has a depth close enough to your ray at that pixel). Again, this is dealing with sampled and incomplete information (e.g. any shadow caster occluded from view or off screen is missed). But this method is often used on top of other methods to ensure that contact shadows are accurate. There are many other approaches that try to precompute or cache visibiliy or lighting information in one way or another. The big problem they all run up against is that the data needs to be sampled somehow and the memory requirements start to explode with increasing sampling resolution.