Giter VIP home page Giter VIP logo

Comments (3)

skywolf829 avatar skywolf829 commented on September 15, 2024

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

from gstk.

skywolf829 avatar skywolf829 commented on September 15, 2024

Updates:

  • Creates a frameBufferObject (FBO) to render to, which ignores the frame buffer for the actual window output. Truly "off-screen" rendering. Able to read the colors and depths still
  • Uses glLoadMatrixf to load the exact modelview matrix and projection matrix, so the OpenGL camera has the exact same parameters as the gaussian splatting one. Had to reverse the z-sign for the projection matrix, seems GS and OpenGL use opposite z-signs (camera forward)
  • Reorganized the OpenGL_renderer into an object that can be rendered with the render_cam object we use to render the GS model. Should be trivial to add opengl_renderer.render(render_cam) in the main render thread.

from gstk.

skywolf829 avatar skywolf829 commented on September 15, 2024

Updates:

  • Moves OpenGL context to glfw. More modern and nicer than GLUT it seems. Plus, GLFW actually allows a fully hidden window for truly off-screen rendering.
  • Properly renders depth + rgba in opengl for use later
  • Adjusted CUDA code for GS to accept an RGBA + depth buffer. While traversing splats (per pixel), will properly composite OpenGL rendered objects behind/in front of splats as needed.
  • OpenGL camera is now the exact same as the GS model at all times.

Left TODO:

  • Still need to build out backend OpenGL objects for visualization. At the moment, only a wireframe cube is available. Will begin with this for the selector editor

from gstk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.