 				m_primparams.ptr(),
 				texVtxPos, texVtxNml,
 				m_mtxparams.ptr(),
-				m_tex.ptr());
+				m_tex.ptr(),
+				m_random.ptr());
 		}
 		else {
 			shade<false> << <blockPerGrid, threadPerBlock >> > (

		return;
	}

	auto scramble = random[idx] * 0x1fe3434f + frame;
	scramble *= (sample + 1);
	path.sampler.init(scramble, sobolmatrices);

#if 1
	float s = (ix + path.sampler.nextSample()) / (float)(camera->width);
	float t = (iy + path.sampler.nextSample()) / (float)(camera->height);
#else
	float s = (ix) / (float)(camera->width);
	float t = (iy) / (float)(camera->height);
#endif

	AT_NAME::CameraSampleResult camsample;
	AT_NAME::PinholeCamera::sample(&camsample, camera, s, t);

	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;

