 
 		auto cosShadow = dot(orienting_normal, dirToLight);
 
-		real pdfb = samplePDF(mtrl, orienting_normal, path.ray.dir, dirToLight, path.rec.u, path.rec.v);
-		auto bsdf = sampleBSDF(mtrl, orienting_normal, path.ray.dir, dirToLight, path.rec.u, path.rec.v);
+		real pdfb = samplePDF(mtrl, orienting_normal, ray.dir, dirToLight, path.rec.u, path.rec.v);
+		auto bsdf = sampleBSDF(mtrl, orienting_normal, ray.dir, dirToLight, path.rec.u, path.rec.v);
 
 		bsdf *= path.throughput;
 

				hitTest << <grid, block >> > (
				//hitTest << <1, 1 >> > (
					paths.ptr(),
					width, height,
					shapeparam.ptr(), shapeparam.num(),
					mtrlparam.ptr(),

__global__ void shade(
	cudaSurfaceObject_t outSurface,
	Path* paths,
	aten::ray* rays,
	ShadowRay* shadowRays,
	int width, int height,
	int depth, int rrDepth,
