Skip to content

Commit

Permalink
updating background for different rendering modes [D, ED, RGB+D, RGB+… (
Browse files Browse the repository at this point in the history
#240)

* updating background for different rendering modes [D, ED, RGB+D, RGB+ED] to be compatible for rasterization

* updating formatting to black 22.3.0
  • Loading branch information
vye16 authored Jun 27, 2024
1 parent 2aa70c2 commit 880425c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gsplat/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,14 @@ def rasterization(
# Rasterize to pixels
if render_mode in ["RGB+D", "RGB+ED"]:
colors = torch.cat((colors, depths[..., None]), dim=-1)
if backgrounds is not None:
backgrounds = torch.cat(
[backgrounds, torch.zeros(C, 1, device=backgrounds.device)], dim=-1
)
elif render_mode in ["D", "ED"]:
colors = depths[..., None]
if backgrounds is not None:
backgrounds = torch.zeros(C, 1, device=backgrounds.device)
else: # RGB
pass
if colors.shape[-1] > channel_chunk:
Expand Down

0 comments on commit 880425c

Please sign in to comment.