Skip to content

Support backgrounds in Gaussian Rasterization#343

Merged
swahtz merged 9 commits into
openvdb:mainfrom
harrism:fea-backgrounds
Nov 20, 2025
Merged

Support backgrounds in Gaussian Rasterization#343
swahtz merged 9 commits into
openvdb:mainfrom
harrism:fea-backgrounds

Conversation

@harrism

@harrism harrism commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

Fixes #80

This adds support for backgrounds (per-camera background color / feature) to fVDB's Gaussian Splatting. The kernels already supported backgrounds, but it was not plumbed into the public interface. This PR:

  1. Adds gtests to verify kernel correctness
  2. Plumbs backgrounds parameters all the way up to the Python public interface.
  3. Adds pytests that exercise backgrounds.

Signed-off-by: Mark Harris mharris@nvidia.com

Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
@harrism harrism requested a review from a team as a code owner November 19, 2025 05:46
@harrism harrism added enhancement New feature or request core library Core fVDB library. i.e. anything in the _Cpp module (C++) or fvdb python module Gaussian Splatting Issues related to Gaussian splattng in the core library Python API labels Nov 19, 2025
@harrism harrism requested review from fwilliams and swahtz November 19, 2025 05:46
@harrism harrism added this to fVDB Nov 19, 2025
@harrism harrism requested a review from Copilot November 19, 2025 05:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for background colors/features to Gaussian Splatting rasterization. The feature allows per-camera background colors to be blended with transparent pixels during rendering, addressing issue #80.

Key changes:

  • Added backgrounds parameter to all rendering functions (dense and sparse, forward and backward passes)
  • Implemented comprehensive test coverage for background blending in both Python and C++ tests
  • Fixed a spelling error in an existing comment

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/unit/test_gsplat.py Added comprehensive Python tests for background rendering in multiple scenarios
src/tests/GaussianRasterizeForwardTest.cpp Added C++ tests for forward pass with backgrounds; fixed comment typo
src/tests/GaussianRasterizeBackwardTest.cpp Added C++ tests for backward pass with backgrounds
src/python/GaussianSplatBinding.cpp Added backgrounds parameter to Python bindings
src/fvdb/detail/ops/gsplat/GaussianRasterizeForward.h Updated function signatures to include backgrounds parameter
src/fvdb/detail/ops/gsplat/GaussianRasterizeForward.cu Plumbed backgrounds through forward implementation
src/fvdb/detail/ops/gsplat/GaussianRasterizeBackward.h Updated backward pass signatures to include backgrounds
src/fvdb/detail/ops/gsplat/GaussianRasterizeBackward.cu Plumbed backgrounds through backward implementation
src/fvdb/detail/autograd/GaussianRender.h Added backgrounds to autograd function signature
src/fvdb/detail/autograd/GaussianRender.cpp Implemented backgrounds handling in autograd
src/fvdb/GaussianSplat3d.h Added backgrounds parameter to public API methods
src/fvdb/GaussianSplat3d.cpp Updated rendering implementations to support backgrounds
fvdb/gaussian_splatting.py Added backgrounds parameter to Python API
fvdb/_fvdb_cpp.pyi Updated type stubs for backgrounds parameter
fvdb/init.pyi Updated type stubs for gaussian_render_jagged
fvdb/init.py Added backgrounds parameter to gaussian_render_jagged wrapper

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/unit/test_gsplat.py Outdated
Comment thread tests/unit/test_gsplat.py Outdated
Comment thread tests/unit/test_gsplat.py Outdated
Comment thread tests/unit/test_gsplat.py Outdated
Comment thread tests/unit/test_gsplat.py Outdated
Signed-off-by: Mark Harris <mharris@nvidia.com>

@fwilliams fwilliams left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small questions but overall looks good. We may want to have a mode where we pass in a full background image rather than a fixed color which would let us implement e.g. a learnable skybox, but this can be a different PR when we decide to actually implement that feature.

Comment thread src/fvdb/GaussianSplat3d.cpp Outdated
Comment thread src/fvdb/GaussianSplat3d.cpp Outdated
Signed-off-by: Mark Harris <mharris@nvidia.com>
Comment thread src/fvdb/GaussianSplat3d.cpp

@swahtz swahtz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks for plumbing that in and making the tests very complete. I like that the tests also include validating the expected alpha composited background result. I had thought that 'background' was a whole image-per-camera but now it makes sense it's just for training with random background values.

@swahtz swahtz merged commit 3b990ac into openvdb:main Nov 20, 2025
32 checks passed
@github-project-automation github-project-automation Bot moved this to Done in fVDB Nov 20, 2025
@harrism harrism deleted the fea-backgrounds branch December 9, 2025 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core library Core fVDB library. i.e. anything in the _Cpp module (C++) or fvdb python module enhancement New feature or request Gaussian Splatting Issues related to Gaussian splattng in the core library Python API

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Expose backgrounds parameter in rendering

4 participants