Rasterization using 3d gaussians#444
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds 3D Gaussian Splatting (3DGS) rasterization capability that enables rendering directly from world-space Gaussians rather than from 2D projections. This allows geometry gradients to flow through the rasterization step, which is particularly useful for non-pinhole camera models with distortion.
Changes:
- Adds new
render_images_from_world_3dgsmethod that performs ray-ellipsoid rasterization directly in world space - Introduces
CameraModelandRollingShutterTypeenums for flexible camera projection support - Implements CUDA kernels for forward and backward passes of the 3DGS rasterizer with support for multiple camera models (pinhole, orthographic, and OpenCV distortion variants)
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/fvdb/detail/ops/gsplat/GaussianCameraModels.h | Defines camera model and rolling shutter enums (contains critical duplication bug) |
| src/fvdb/detail/ops/gsplat/GaussianRasterizeFromWorld3DGS.cuh | Shared utilities for ray generation, distortion, and coordinate transformations |
| src/fvdb/detail/ops/gsplat/GaussianRasterizeFromWorld3DGSForward.cu | CUDA kernel for forward rasterization pass |
| src/fvdb/detail/ops/gsplat/GaussianRasterizeFromWorld3DGSBackward.cu | CUDA kernel for backward gradient computation |
| src/fvdb/detail/autograd/GaussianRasterizeFromWorld3DGS.{h,cpp} | PyTorch autograd wrapper for the rasterization operation |
| src/fvdb/GaussianSplat3d.{h,cpp} | Main API implementation routing to appropriate projection and rasterization paths |
| src/python/GaussianSplatBinding.cpp | Python bindings for the new enums and method |
| fvdb/gaussian_splatting.py | Python wrapper for the new rendering method |
| fvdb/enums.py | Python enum definitions for camera models and rolling shutter types |
| fvdb/_fvdb_cpp.pyi, fvdb/init.pyi, fvdb/init.py | Type stubs and exports for the new functionality |
| tests/unit/test_rasterize_world3dgs.py | Unit tests for gradient correctness and finite difference validation |
| src/CMakeLists.txt | Build configuration for new source files |
| src/fvdb/detail/ops/gsplat/GaussianProjectionUT.h | Refactored to use shared enum definitions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Could we get a description of the PR please? |
|
@swahtz : updated:
Folding camera model + rolling-shutter policy into |
7f39626 to
04b4862
Compare
Signed-off-by: Francis Williams <francis@fwilliams.info>
Signed-off-by: Francis Williams <francis@fwilliams.info>
Signed-off-by: Francis Williams <francis@fwilliams.info>
Signed-off-by: Francis Williams <francis@fwilliams.info>
Signed-off-by: Francis Williams <francis@fwilliams.info>
Signed-off-by: Francis Williams <francis@fwilliams.info>
harrism
left a comment
There was a problem hiding this comment.
Thanks for addressing my comments. I'm approving, but I'd like you to generate missing documentation before merging (see 3 comments).
Signed-off-by: Francis Williams <francis@fwilliams.info>
Signed-off-by: Francis Williams <francis@fwilliams.info>
swahtz
left a comment
There was a problem hiding this comment.
This is great, thanks for addressing all my notes. In principle, we could refactor all the feature/alpha writing to writeFeature/writeAlpha functions like on the other rasterization pipelines' Args classes but that can be left to further cleanup.
Summary
This PR adds a dense, differentiable rasterize-from-world path for Gaussian splatting that renders images directly from world-space 3D Gaussians (means/quats/log-scales) instead of relying only on 2D projected conics. It supports UT-based projection for OpenCV camera models, integrates into the
GaussianSplat3dpublic API, and includes extensive regression/gradient tests.Key changes
New public API
GaussianSplat3d.render_images_from_world(...)(Python + C++ bindings)CameraModel+RollingShutterTypeand packed OpenCV distortion coefficients.New kernels + autograd (dense-only)
Camera model consolidation + reuse
CameraModel/RollingShutterTypeenums (C++) and PythonIntEnumwrappers infvdb.enums.Masks + backgrounds parity
Docs + naming cleanup
render_images_from_world.*_3dgssuffix in the public API).Test plan
./build.sh ctest/tmpso Python imports the installed extension:conda run -n fvdb python -m pytest -q --rootdir /path/to/fvdb-core/tests /path/to/fvdb-core/testsNotes / follow-ups
CameraModel/RollingShutterTypeare kept explicit in some dispatch APIs; folding them intoRenderSettingscould be a follow-up if we want a single transport object everywhere.