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

			isectTmp.t,
			hitobj);

		if (isHit) {
			auto cosShadow = dot(orienting_normal, dirToLight);

			real pdfb = samplePDF(&ctxt, &mtrl, orienting_normal, ray.dir, dirToLight, rec.u, rec.v);

	}
	AT_NAME::material::applyNormalMap(normalMap, orienting_normal, orienting_normal, rec.u, rec.v);

#ifdef SEPARATE_SHADOWRAY_HITTEST
	shadowRays[idx].isActive = false;
#endif

	// Explicit conection to light.
	if (!mtrl.attrib.isSingular)
	{
