 
 	auto& path = paths[idx];
 	const auto& ray = rays[idx];
+
+#if IDATEN_SAMPLER == IDATEN_SAMPLER_SOBOL
+	auto scramble = random[idx] * 0x1fe3434f;
+	path.sampler.init(frame, 4 + bounce * 300, scramble);
+#elif IDATEN_SAMPLER == IDATEN_SAMPLER_CMJ
+	auto rnd = random[idx];
+	auto scramble = rnd * 0x1fe3434f * ((frame + 331 * rnd) / (aten::CMJ::CMJ_DIM * aten::CMJ::CMJ_DIM));
+	path.sampler.init(frame % (aten::CMJ::CMJ_DIM * aten::CMJ::CMJ_DIM), 4 + bounce * 300, scramble);
+#endif
 
 	aten::hitrecord rec;
 

				m_primparams.ptr(),
				texVtxPos, texVtxNml,
				m_mtxparams.ptr(),
				m_tex.ptr());
		}

		checkCudaKernel(shade);

	cudaTextureObject_t vtxPos,
	cudaTextureObject_t vtxNml,
	const aten::mat4* __restrict__ matrices,
	cudaTextureObject_t* textures,
	unsigned int* random)
{
	int idx = blockIdx.x * blockDim.x + threadIdx.x;

