Skip to content

USMizuki/gtracer

This branch is 2 commits ahead of fudan-zvg/gtracer:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 12, 2025
cf2cf9a ยท Jan 12, 2025

History

12 Commits
Nov 15, 2024
Nov 15, 2024
Jan 9, 2025
Jan 12, 2025
Jan 9, 2025
Nov 15, 2024
Nov 15, 2024
Nov 15, 2024
Nov 15, 2024
Nov 16, 2024
Nov 15, 2024

Repository files navigation

3D Gaussian Ray Tracer

An OptiX-based differentiable 3D Gaussian Ray Tracer, inspired by the work 3D Gaussian Ray Tracing: Fast Tracing of Particle Scenes. See gaussian-raytracing for 3D reconstruction.

Install

# clone the repo
git clone https://github.com/fudan-zvg/gtracer.git
cd gtracer

# use cmake to build the project for ptx file (for Optix)
rm -rf ./build && mkdir build && cd build && cmake .. && make && cd ../

# Install the package
pip install .

Example usage

Python API:

from gtracer import _C
# create a Gaussian Ray Tracer
bvh = _C.create_gaussiantracer()

# build it with triangles associated with each Gaussian
bvh.build_bvh(vertices_b[faces_b])

# update the vertices in bvh if you already build it, faster than build_bvh. 
# But the topology and the number of triangle faces should keep the same.
bvh.update_bvh(vertices_b[faces_b])

# trace forward
bvh.trace_forward(
    rays_o, rays_d, gs_idxs, means3D, opacity, SinvR, shs, 
    colors, depth, alpha, 
    alpha_min, transmittance_min, deg,
)

# trace backward
bvh.trace_backward(
    rays_o, rays_d, gs_idxs, means3D, opacity, SinvR, shs, 
    colors, depth, alpha, 
    grad_means3D, grad_opacity, grad_SinvR, grad_shs,
    grad_out_color, grad_out_depth, grad_out_alpha,
    ctx.alpha_min, ctx.transmittance_min, ctx.deg,
)

Example usage:

cd example
# Interactive viewer for 3DGS format point cloud
python renderer.py -p point_cloud.ply

Acknowledgement

๐Ÿ“œ Citation

If you find this work useful for your research, please cite our github repo:

@misc{gu2024gtracer,
    title = {3D Gaussian Ray Tracer},
    author = {Gu, Chun and Zhang, Li},
    howpublished = {\url{https://github.com/fudan-zvg/gtracer}},
    year = {2024}
}

About

3D Gaussian Ray Tracer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 78.2%
  • C++ 18.6%
  • JavaScript 1.3%
  • C 1.1%
  • Python 0.3%
  • CSS 0.2%
  • Other 0.3%