Sampling lights

Practical and theoretical implementation discussion.
Posts: 202
Joined: Mon Nov 28, 2011 8:18 am

Re: Sampling lights

Post by jbikker » Wed Dec 28, 2011 5:09 pm

ingenious wrote:Hm, looks similar indeed. Though I cannot understand Jacco's reply.
Hm, indeed, it's the same thing. Sorry for the confusion.
voidcycles wrote:What if you have more light sources than you can fit in memory? Would you still use a discrete sample table?
That would be an interesting scene. :) I target interactive rendering, so everything will definitely be in-core.

Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm

Re: Sampling lights

Post by spectral » Thu Dec 29, 2011 7:00 am

How a scene cannot fit all the light sources in memory ?

You can play with 2 arrays :
1 - A array for the lights source, N lights mean an array of size N
2 - An array of indices that point to the first array

This way you can have a lot of lights...

Of course, it is still possible to do some out-of-core rendering if you really have a hughe scene !
OMPF 2 global moderator

Posts: 12
Joined: Thu Dec 29, 2011 5:38 pm

Re: Sampling lights

Post by franz » Thu Dec 29, 2011 5:43 pm

Here's an article of interest about efficiently sampling discrete distributions: Of particular interest is the Alias method which can sample in O(1) with O(n) memory. If I'm not mistaking, Jacco's technique is described in "Simulating a Loaded Die with a Fair Die".


Post Reply