public override bool FillRayBuffer(Core.Types.RayBuffer rayBuffer) { var leftSpace = rayBuffer.LeftSpace(); if (((PathState == PathTracerPathState.EyeVertex) && (2 > leftSpace)) || ((PathState == PathTracerPathState.ShadowRaysOnly) && (tracedShadowRayCount > leftSpace)) || ((PathState == PathTracerPathState.NextVertex) && (tracedShadowRayCount + 2 > leftSpace))) return false; if (PathState != PathTracerPathState.ShadowRaysOnly) { RayIndex = rayBuffer.AddRay(ref PathRay); if (!lightStoped) LightRayIndex = rayBuffer.AddRay(ref LightRay); } if (PathState == PathTracerPathState.NextVertex || PathState == PathTracerPathState.ShadowRaysOnly) { for (int i = 0; i < tracedShadowRayCount; ++i) secRays[i].ShadowRayIndex = rayBuffer.AddRay(ref secRays[i].ShadowRay); } return true; }