Spaces:
Running on Zero
Running on Zero
Rawal Khirodkar commited on
Commit ·
abde977
1
Parent(s): 04f5fcb
Pointmap: drop PBR material + doubleSided hack + process=True; just plain vertex colors
Browse files
app.py
CHANGED
|
@@ -321,15 +321,13 @@ def _make_glb(image_pil_texture: Image.Image, pointmap_hwc: np.ndarray,
|
|
| 321 |
vc[..., 3] = 255
|
| 322 |
vertex_colors = vc.reshape(-1, 4)
|
| 323 |
|
|
|
|
|
|
|
| 324 |
mesh = trimesh.Trimesh(
|
| 325 |
vertices=verts, faces=faces,
|
| 326 |
vertex_colors=vertex_colors,
|
| 327 |
-
process=
|
| 328 |
)
|
| 329 |
-
# Force double-sided so surfels are visible regardless of normal flip after the Y-flip.
|
| 330 |
-
if hasattr(mesh.visual, "material") and hasattr(mesh.visual.material, "doubleSided"):
|
| 331 |
-
mesh.visual.material.doubleSided = True
|
| 332 |
-
|
| 333 |
out_path = tempfile.NamedTemporaryFile(delete=False, suffix=".glb").name
|
| 334 |
mesh.export(out_path)
|
| 335 |
return out_path
|
|
|
|
| 321 |
vc[..., 3] = 255
|
| 322 |
vertex_colors = vc.reshape(-1, 4)
|
| 323 |
|
| 324 |
+
# Plain vertex colors only — no PBR material customization, no normals,
|
| 325 |
+
# nothing that would inject lighting variation between surfels.
|
| 326 |
mesh = trimesh.Trimesh(
|
| 327 |
vertices=verts, faces=faces,
|
| 328 |
vertex_colors=vertex_colors,
|
| 329 |
+
process=False,
|
| 330 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
out_path = tempfile.NamedTemporaryFile(delete=False, suffix=".glb").name
|
| 332 |
mesh.export(out_path)
|
| 333 |
return out_path
|