skywolf829 / GSTK

Gaussian Splatting toolkit application. One stop shop for preprocessing your dataset, training your model with human-in-the-loop training, and editing saved GSplat PLY files.
MIT License
4 stars 1 forks source link

Combine standard OpenGL rendering with GS model #32

Closed skywolf829 closed 7 months ago

skywolf829 commented 7 months ago

In order to render some effects such as camera locations, current selector area, or even other objects, we want to allow other rendering to mesh seamlessly with the GS forward render. This issue is the backend work to support rendering standard OpenGL and allowing the model to still be rendered in that same scene.

Will be used for other issues like #14 #28 #26 etc.

skywolf829 commented 7 months ago

Started work with an off-screen PyOpenGL + GLUT (invisible) window which can be rendered to. The idea is to use that canvas to draw the OpenGL related items to before the model forward render. Then, the OpenGL rendered data (RGB + A + Depth) are all passed into the GS rendering backend with compositing working properly given the other OpenGL render. Splats in front of the depth buffer will splat as usual, but after the depth buffer will not be splatted. Instead, the RGBA from the OpenGL render will be composited, and splatting will only continue if the alpha is not saturated yet. Should work well with only a little overhead on backend.

So far I can render a cube outline using PyOpenGL to a hidden window and also obtain the depth buffer (normalized 0.0-1.0 for near/far plane), and obtain both these arrays as numpy/standard float arrays for passing to the GS CUDA backend.

image

Next steps

  1. Implement CUDA rasterizer updates to properly draw gaussians on top of/behind the given RGBAD buffers given to the rasterizer.
  2. Update OpenGL renderer to maintain a consistent view/projection matrix to the GS renderer model such that the buffer objects are pixel-wise accurate with each other per frame.
  3. Build out the OpenGL renderer with support for arbitrary objects (wireframe rectangles for cameras, images as textures for debug viewing, etc) so the main code can call high-level functions easily.

Useful Links

skywolf829 commented 7 months ago

Updates:

skywolf829 commented 7 months ago

Updates:

Left TODO: