...
By convention, Bxdfs call the DrawSamples?DDrawSamples1D(), DrawSamples2D(), and/or DrawSamples3D() functions. These functions do not increment the sampleids
. This means that an Integrator calling a Bxdf has to do this incrementing after the Bxdf call – otherwise multiple bxdf samples will be the same sample value, ie. the same direction. Similar for light sampling and indirect illumination sampling: the Integrator has to increment the sampleids
after the samples have been used. This is easily done by looping over all the sample contexts in a RixRNG
like this:
...