Skip to content
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

loading and rendering optimizations #21

Merged
merged 15 commits into from
Jul 12, 2024
Merged

Conversation

hyperlogic
Copy link
Owner

  • added --nosh option to skip rendering spherical harmonic data, which should give an fps boost.
  • ply file loading optimizations, ply files should load up to 2x faster.
  • render using interleaved vertex arrays. gives a small 10-20% fps boost on some hardware.

Added an empty default constructor to the struct used in a large std::vector.
This will skip the construction of each individual element in the vector.
The point here is to hide the actual structure of the point cloud data,
specifically PointData and the std::vector<PointData>.
The data can be accessed with an AttribData API and a raw void* ptr.
This allows us to load the raw data directly into an OpenGL buffer, and
contains the data we need to create interleaved vertex attributes into that buffer,
while still allowing us to iterate over each element, if necessary, using ForEachAttrib().

In the case of PointCloud this is probably overkill, but I want to use this same API for
GaussianCloud in the future. Because GaussianCloud can optionally have some or all spherical
harmonic coefficients, we don't know the data layout at compile time. This AttribData API
gives us the ability to only include what we need at run-time.
* GaussianCloud moved to AttribData style API.
* Moved all cooking of data for rendering into GaussianCloud,
  So setting up interleaved vertex arrays in SplatRenderer is straight forward.
* Overall 2x loading time improvement
* ~20% fps improvement on large scenes
* Still some cleanup necessary before merging into main.
  See AJT: comments
Also some prep work for Ply exporting,
build fix for linux
* still need to fix ComputeRotScaleFromCovMat()!
Doesn't work on some covariant matrices tho... wip
Need to check determinant of matrix before converting it to a quaternion,
and flip the sign of the matrix by multiplying all axes by -1, for quat convertion
to be correct.  GaussianClound::ExportPly() seems to work now.
… data

This reduces the memory requirements for large scenes, and can give
a performance boost as well.

GaussianCloud will use BaseGaussianData or FullGaussianData depending on this option.
This will intern reduce the gpu memory required for each vertex.
The shaders also use the FULL_SH pre-processor symbol define to handle this option.
@hyperlogic hyperlogic merged commit 2933489 into main Jul 12, 2024
2 checks passed
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.

1 participant