Spaces:
Running on Zero
Running on Zero
Revert "Fix: Bypass C0 multiplication for DC-only SH - directly add 0.5 bias for correct shadow rendering"
Browse filesThis reverts commit 4d552879e0847f94a9a0674c55a44338fe189ac2.
trellis/renderers/gaussian_render.py
CHANGED
|
@@ -110,20 +110,11 @@ def render(viewpoint_camera, pc : Gaussian, pipe, bg_color : torch.Tensor, scali
|
|
| 110 |
colors_precomp = None
|
| 111 |
if override_color is None:
|
| 112 |
if pipe.convert_SHs_python:
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
dc = pc.get_features[:, 0, :] # Shape: [N, 3]
|
| 119 |
-
colors_precomp = torch.clamp_min(dc + 0.5, 0.0)
|
| 120 |
-
else:
|
| 121 |
-
# Higher SH degrees - use standard eval_sh with bias
|
| 122 |
-
shs_view = pc.get_features.transpose(1, 2).view(-1, 3, (pc.sh_degree+1)**2)
|
| 123 |
-
dir_pp = (pc.get_xyz - viewpoint_camera.camera_center.repeat(pc.get_features.shape[0], 1))
|
| 124 |
-
dir_pp_normalized = dir_pp/dir_pp.norm(dim=1, keepdim=True)
|
| 125 |
-
sh2rgb = eval_sh(pc.active_sh_degree, shs_view, dir_pp_normalized)
|
| 126 |
-
colors_precomp = torch.clamp_min(sh2rgb + 0.5, 0.0)
|
| 127 |
else:
|
| 128 |
shs = pc.get_features
|
| 129 |
|
|
|
|
| 110 |
colors_precomp = None
|
| 111 |
if override_color is None:
|
| 112 |
if pipe.convert_SHs_python:
|
| 113 |
+
shs_view = pc.get_features.transpose(1, 2).view(-1, 3, (pc.sh_degree+1)**2)
|
| 114 |
+
dir_pp = (pc.get_xyz - viewpoint_camera.camera_center.repeat(pc.get_features.shape[0], 1))
|
| 115 |
+
dir_pp_normalized = dir_pp/dir_pp.norm(dim=1, keepdim=True)
|
| 116 |
+
sh2rgb = eval_sh(pc.active_sh_degree, shs_view, dir_pp_normalized)
|
| 117 |
+
colors_precomp = torch.clamp_min(sh2rgb + 0.5, 0.0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
else:
|
| 119 |
shs = pc.get_features
|
| 120 |
|