message: clipping with map_maxDepth fix
diff: @@ -139,10 +139,15 @@ inline void traceClippingRay(const World *uniform world,
  context.corrClippingDepth = 0;
  context.hitsCount = 0;
  - // Intersect all geometry along given ray
  + // Intersect all geometry along given ray,
  + // we have to temporarily extend the ray to inf because
  + // even distant intersections affect visibilty of close objects
  + float origT = ray.t;
  + ray.t = inf;
  rtcIntersectV(world->embreeSceneHandleClippers,
  &context.ectx,
  (varying RTCRayHit * uniform) & ray);
  + ray.t = origT;
  // Set initial clipping depth,
  // we have to apply correction because ray origin can be inside clipping area
  @@ -161,8 +166,14 @@ inline void traceClippingRay(const World *uniform world,
  // Iterate through collected hits and build ray intervals
  for (uint32 i = 0; i < context.hitsCount; i++) {
  + // Do not build ray intervals that are further than ray.t
  + float t = context.hits[i].t;
  + float absT = abs(t);
  + if (absT > ray.t)
  + break;
  +
  // Check if comming into or out of clipping area
  - if (context.hits[i].t < 0.0f) {
  + if (t < 0.0f) {
  clippingDepth--; // out of clipping area
  } else {
  clippingDepth++; // into clipping area
  @@ -170,13 +181,13 @@ inline void traceClippingRay(const World *uniform world,
  // Start interval if previous one is closed and we are not in clipping area
  if (and(clippingDepth == 0, intervalCompleted)) {
  - rayIntervals.intervals[intervalId].lower = abs(context.hits[i].t);
  + rayIntervals.intervals[intervalId].lower = absT;
  intervalCompleted = false;
  }
  // End interval if current one is not closed and we enter clipping area
  if (and(clippingDepth > 0, !intervalCompleted)) {
  - rayIntervals.intervals[intervalId].upper = abs(context.hits[i].t);
  + rayIntervals.intervals[intervalId].upper = absT;
  intervalCompleted = true;
  intervalId++;
  }
  