Skip to content

Add SPZ support #2180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Add SPZ support #2180

wants to merge 8 commits into from

Conversation

Meakk
Copy link
Member

@Meakk Meakk commented Apr 25, 2025

Describe your changes

Adds support for .spz gaussians splatting

image

Issue ticket number and link if any

#38

Checklist for finalizing the PR

  • I have performed a self-review of my code
  • I have added tests for new features and bugfixes
  • I have added documentation for new features
  • If it is a modifying the libf3d API, I have updated bindings
  • If it is a modifying the default versions, I have updated timestamp

Continuous integration

Please check the checkbox of the CI you want to run, then push again on your branch.

  • Style checks
  • Fast CI
  • Coverage cached CI
  • Analysis cached CI
  • WASM CI
  • Android CI
  • macOS Intel cached CI
  • macOS ARM cached CI
  • Windows cached CI
  • Linux cached CI
  • Other cached CI

Sorry, something went wrong.

@Meakk Meakk self-assigned this Apr 25, 2025
@Meakk Meakk marked this pull request as draft April 25, 2025 22:12
@Meakk Meakk marked this pull request as ready for review April 29, 2025 22:26
@Meakk Meakk force-pushed the spz branch 2 times, most recently from 0bae0f8 to 48fb329 Compare April 29, 2025 22:34
Copy link
Member

@mwestphal mwestphal left a comment

Choose a reason for hiding this comment

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

Good proto !

Copy link

codecov bot commented Apr 30, 2025

Codecov Report

Attention: Patch coverage is 0% with 129 lines in your changes missing coverage. Please review.

Project coverage is 94.78%. Comparing base (5bc536c) to head (f20520f).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
plugins/native/module/vtkF3DSPZReader.cxx 0.00% 126 Missing ⚠️
plugins/native/module/vtkF3DSPZReader.h 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2180      +/-   ##
==========================================
- Coverage   95.88%   94.78%   -1.10%     
==========================================
  Files         127      129       +2     
  Lines       11118    11247     +129     
==========================================
  Hits        10661    10661              
- Misses        457      586     +129     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@mwestphal mwestphal left a comment

Choose a reason for hiding this comment

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

Running coverage without writing tests make review impossible ^^

Copy link
Member

@mwestphal mwestphal left a comment

Choose a reason for hiding this comment

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

need some tests and doc obv :)

@@ -41,4 +41,8 @@
<comment>Quake 1 MDL File Format</comment>
<glob pattern="*.mdl"/>
</mime-type>
<mime-type type="application/vnd.spz">
<comment>Niantic 3D Gaussians</comment>
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
<comment>Niantic 3D Gaussians</comment>
<comment>Compressed 3D gaussian splats</comment>

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • .github/actions/alembic-install-dep/action.yml
    • lines 1-6
    • lines 33-33
  • .github/actions/android-ci/action.yml
    • lines 1-4
    • lines 21-22
  • .github/actions/assimp-install-dep/action.yml
    • lines 1-6
    • lines 33-33
  • .github/actions/blosc-install-dep/action.yml
    • lines 1-5
    • lines 26-26
  • .github/actions/coverage-ci/action.yml
    • lines 1-14
    • lines 49-50
  • .github/actions/draco-install-dep/action.yml
    • lines 1-6
    • lines 33-33
  • .github/actions/external-build-ci/action.yml
    • lines 1-4
    • lines 34-34
  • .github/actions/f3d-dependencies/action.yml
    • lines 1-12
  • .github/actions/generic-ci/action.yml
    • lines 1-31
    • lines 86-86
    • lines 136-139
    • lines 244-245
  • .github/actions/generic-dependencies/action.yml
    • lines 1-17
  • .github/actions/imath-install-dep/action.yml
    • lines 1-5
    • lines 26-26
  • .github/actions/occt-install-dep/action.yml
    • lines 1-6
    • lines 34-34
  • .github/actions/openexr-install-dep/action.yml
    • lines 1-6
    • lines 34-34
  • .github/actions/openvdb-install-dep/action.yml
    • lines 1-6
    • lines 34-34
  • .github/actions/ospray-sb-install-dep/action.yml
    • lines 1-5
    • lines 26-26
  • .github/actions/pybind11-install-dep/action.yml
    • lines 1-4
    • lines 25-25
  • .github/actions/python-ci/action.yml
    • lines 1-14
    • lines 52-53
  • .github/actions/sanitizer-ci/action.yml
    • lines 1-11
    • lines 43-44
  • .github/actions/static-analysis-ci/action.yml
    • lines 1-12
    • lines 46-47
  • .github/actions/tbb-install-dep/action.yml
    • lines 1-5
    • lines 28-28
  • .github/actions/usd-install-dep/action.yml
    • lines 1-7
    • lines 37-38
  • .github/actions/vtk-dependencies/action.yml
    • lines 1-8
  • .github/actions/vtk-install-dep/action.yml
    • lines 1-9
    • lines 51-51
  • .github/actions/wasm-ci/action.yml
    • lines 1-3
  • .github/actions/zlib-install-dep/action.yml
    • lines 1-5
    • lines 26-26
  • .github/workflows/ci.yml
    • lines 7-12
    • lines 45-47
    • lines 79-94
    • lines 104-119
    • lines 157-181
    • lines 197-224
    • lines 236-257
    • lines 265-265
    • lines 383-414
    • lines 422-449
    • lines 461-461
    • lines 475-503
    • lines 512-517
    • lines 532-556
    • lines 571-597
    • lines 618-639
    • lines 656-678
    • lines 691-705
    • lines 720-734
    • lines 747-790
  • .github/workflows/nightly_vtk_master.yml
    • lines 5-9
    • lines 20-40
    • lines 68-84
    • lines 94-110
    • lines 119-146
    • lines 167-195
    • lines 205-231
    • lines 241-270
    • lines 290-313
  • .github/workflows/public-api-warn.yml
    • lines 5-6
  • .github/workflows/style-checks.yml
    • lines 9-12
    • lines 35-37
    • lines 47-82
  • .github/workflows/version-timestamp-warn.yml
    • lines 5-5
  • _config.yml
    • lines 38-39
    • lines 49-50
    • lines 58-137
    • lines 338-342
  • vtkext/private/module/vtkF3DRenderer.cxx
    • lines 2198-2200

std::array<float, 3> sh;
for (int i = 0; i < 3; i++)
{
sh[i] = constant<M,L>() * unquantize(packed[offset + i]);
Copy link

Choose a reason for hiding this comment

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

Suggested change
sh[i] = constant<M,L>() * unquantize(packed[offset + i]);
sh[i] = constant<M, L>() * unquantize(packed[offset + i]);

Comment on lines +2182 to +2187
sprites.Mapper->SetSplatShaderCode("//VTK::Color::Impl\n"
" float dist2 = dot(offsetVCVSOutput.xy,offsetVCVSOutput.xy);\n"
" float gaussian = exp(-0.5*dist2);\n"
" opacity = opacity*gaussian;\n"
" if (random(gl_FragCoord.xyz) >= opacity) discard;\n"
" opacity = 1.0;\n");
Copy link

Choose a reason for hiding this comment

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

Suggested change
sprites.Mapper->SetSplatShaderCode("//VTK::Color::Impl\n"
" float dist2 = dot(offsetVCVSOutput.xy,offsetVCVSOutput.xy);\n"
" float gaussian = exp(-0.5*dist2);\n"
" opacity = opacity*gaussian;\n"
" if (random(gl_FragCoord.xyz) >= opacity) discard;\n"
" opacity = 1.0;\n");
sprites.Mapper->SetSplatShaderCode(
"//VTK::Color::Impl\n"
" float dist2 = dot(offsetVCVSOutput.xy,offsetVCVSOutput.xy);\n"
" float gaussian = exp(-0.5*dist2);\n"
" opacity = opacity*gaussian;\n"
" if (random(gl_FragCoord.xyz) >= opacity) discard;\n"
" opacity = 1.0;\n");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants