Skip to content

Commit

Permalink
return result array for lower sh degrees (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
YertleTurtleGit authored Apr 29, 2024
1 parent 0cef46c commit 8a19034
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gsplat/_torch_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def eval_sh_bases_fast(basis_dim: int, dirs: torch.Tensor):
result[..., 0] = 0.2820947917738781

if basis_dim <= 1:
return
return result

x, y, z = dirs.unbind(-1)

Expand All @@ -152,7 +152,7 @@ def eval_sh_bases_fast(basis_dim: int, dirs: torch.Tensor):
result[..., 1] = fTmpA * y

if basis_dim <= 4:
return
return result

z2 = z * z
fTmpB = -1.092548430592079 * z
Expand All @@ -166,7 +166,7 @@ def eval_sh_bases_fast(basis_dim: int, dirs: torch.Tensor):
result[..., 4] = fTmpA * fS1

if basis_dim <= 9:
return
return result

fTmpC = -2.285228997322329 * z2 + 0.4570457994644658
fTmpB = 1.445305721320277 * z
Expand All @@ -182,7 +182,7 @@ def eval_sh_bases_fast(basis_dim: int, dirs: torch.Tensor):
result[..., 9] = fTmpA * fS2

if basis_dim <= 16:
return
return result

fTmpD = z * (-4.683325804901025 * z2 + 2.007139630671868)
fTmpC = 3.31161143515146 * z2 - 0.47308734787878
Expand Down

0 comments on commit 8a19034

Please sign in to comment.