Skip to content

Commit

Permalink
fix to update T when break
Browse files Browse the repository at this point in the history
  • Loading branch information
wonjune23 committed Feb 10, 2025
1 parent 0880d2b commit 1dc06b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions gsplat/cuda/csrc/rasterize_to_pixels_2dgs_fwd.cu
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,6 @@ __global__ void rasterize_to_pixels_fwd_2dgs_kernel(
continue;
}

const S next_T = T * (1.0f - alpha);
if (next_T <= 1e-4) { // this pixel is done: exclusive
done = true;
break;
}

// run volumetric rendering..
int32_t g = id_batch[t];
const S vis = alpha * T;
Expand Down Expand Up @@ -344,6 +338,13 @@ __global__ void rasterize_to_pixels_fwd_2dgs_kernel(

cur_idx = batch_start + t;

const S next_T = T * (1.0f - alpha);
if (next_T <= 1e-4) { // this pixel is done: exclusive
T = next_T;
done = true;
break;
}

T = next_T;
}
}
Expand Down
13 changes: 7 additions & 6 deletions gsplat/cuda/csrc/rasterize_to_pixels_fwd.cu
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,6 @@ __global__ void rasterize_to_pixels_fwd_kernel(
continue;
}

const S next_T = T * (1.0f - alpha);
if (next_T <= 1e-4) { // this pixel is done: exclusive
done = true;
break;
}

int32_t g = id_batch[t];
const S vis = alpha * T;
const S *c_ptr = colors + g * COLOR_DIM;
Expand All @@ -162,6 +156,13 @@ __global__ void rasterize_to_pixels_fwd_kernel(
}
cur_idx = batch_start + t;

const S next_T = T * (1.0f - alpha);
if (next_T <= 1e-4) { // this pixel is done: exclusive
T = next_T;
done = true;
break;
}

T = next_T;
}
}
Expand Down

0 comments on commit 1dc06b3

Please sign in to comment.